Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release' of https://github.com/substratum/substratum in…
Browse files Browse the repository at this point in the history
…to release
  • Loading branch information
AsdMonio committed Jul 4, 2018
2 parents f1e008d + ec3291e commit 84e3fc0
Show file tree
Hide file tree
Showing 152 changed files with 4,743 additions and 5,396 deletions.
31 changes: 14 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ final def gitHash = { ->
final def keystorePropertiesFile = rootProject.file("keystore.properties")

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 28
lintOptions {
checkReleaseBuilds false
abortOnError false
}
dataBinding {
enabled true
}
dataBinding.enabled true
android.applicationVariants.all { final variant ->
variant.outputs.all {
outputFileName = "substratum_${variant.versionCode}_${gitHash()}.apk"
Expand All @@ -49,9 +46,9 @@ android {
defaultConfig {
applicationId "projekt.substratum"
minSdkVersion 24
targetSdkVersion 27
versionCode 994
versionName "nine hundred ninety four"
targetSdkVersion 28
versionCode 997
versionName "nine hundred ninety seven"
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + System.currentTimeMillis() + "L)"
buildConfigField "String", "GIT_HASH", "\"${gitHash()}\""
}
Expand Down Expand Up @@ -103,7 +100,7 @@ android {

ext {
supportLibsVersion = '27.1.1'
firebaseVersion = '15.0.0'
firebaseVersion = '16.0.1'
glideVersion = '4.7.1'
}
dependencies {
Expand All @@ -121,9 +118,9 @@ dependencies {
implementation "com.android.support:preference-v14:$supportLibsVersion"

// Firebase
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-crash:15.0.2"
implementation "com.google.firebase:firebase-database:15.0.1"
implementation "com.google.firebase:firebase-core:$firebaseVersion"
implementation "com.google.firebase:firebase-crash:$firebaseVersion"
implementation "com.google.firebase:firebase-database:$firebaseVersion"

// Image Downloading and Caching
implementation "com.github.bumptech.glide:glide:$glideVersion"
Expand All @@ -134,7 +131,7 @@ dependencies {
implementation 'commons-io:commons-io:2.5'

// APK Signer
implementation 'com.android.tools.build:apksig:3.1.2'
implementation 'com.android.tools.build:apksig:3.1.3'

// App Intro
implementation 'com.stephentuso:welcome:1.4.1'
Expand All @@ -143,7 +140,7 @@ dependencies {
implementation 'com.gordonwong:material-sheet-fab:1.2.1'

// About Libraries
implementation('com.mikepenz:aboutlibraries:6.0.6@aar') {
implementation('com.mikepenz:aboutlibraries:6.0.9@aar') {
transitive = true
}

Expand All @@ -152,16 +149,16 @@ dependencies {

// ZT Zip
//noinspection GradleDependency
implementation 'org.zeroturnaround:zt-zip:1.8'
implementation 'org.zeroturnaround:zt-zip:1.13'

// Image Processing
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'

// Expandable Layout
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'

// Floating App Head
implementation 'com.github.recruit-lifestyle:FloatingView:2.3.1'
implementation 'com.github.recruit-lifestyle:FloatingView:2.3.2'

// Crash Activity
implementation 'cat.ereza:customactivityoncrash:2.2.0'
Expand Down
84 changes: 35 additions & 49 deletions app/src/main/java/projekt/substratum/InformationActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,13 @@ public class InformationActivity extends AppCompatActivity {
public static boolean compilingProcess = false;
public static boolean shouldRestartActivity = false;
private static List<String> tabChecker;
Toolbar toolbar;
TabLayout tabLayout;
CollapsingToolbarLayout collapsingToolbar;
TextView toolbarCollapsedTitle;
ViewPager viewPager;
AppBarLayout appBarLayout;
CardView sheetView;
DimOverlayFrameLayout overlay;
Switch enableSwap;
TextView compileEnableSelected;
TextView compileUpdateSelected;
TextView disableSelected;
FloatingActionMenu floatingActionButton;
View fabMenuDivider;
LinearLayout enableZone;
TextView enableSelected;
TextView enableDisableSelected;
ImageView heroImage;
private TabLayout tabLayout;
private CollapsingToolbarLayout collapsingToolbar;
private TextView toolbarCollapsedTitle;
private ViewPager viewPager;
private AppBarLayout appBarLayout;
private FloatingActionMenu floatingActionButton;
private ImageView heroImage;

private String themeName;
private String themePid;
Expand Down Expand Up @@ -455,23 +444,23 @@ protected void onCreate(Bundle savedInstanceState) {
InformationActivityBinding binding =
DataBindingUtil.setContentView(this, R.layout.information_activity);

toolbar = binding.toolbar;
Toolbar toolbar = binding.toolbar;
tabLayout = binding.tabs;
collapsingToolbar = binding.collapsingToolbarTabbedLayout;
toolbarCollapsedTitle = binding.toolbarCollapsedTitle;
viewPager = binding.viewpager;
appBarLayout = binding.appbar;
sheetView = binding.fabSheet;
overlay = binding.overlay;
enableSwap = binding.enableSwap;
compileEnableSelected = binding.compileEnableSelected;
compileUpdateSelected = binding.compileUpdateSelected;
disableSelected = binding.disableSelected;
CardView sheetView = binding.fabSheet;
DimOverlayFrameLayout overlay = binding.overlay;
Switch enableSwap = binding.enableSwap;
TextView compileEnableSelected = binding.compileEnableSelected;
TextView compileUpdateSelected = binding.compileUpdateSelected;
TextView disableSelected = binding.disableSelected;
floatingActionButton = binding.applyFab;
fabMenuDivider = binding.fabMenuDivider;
enableZone = binding.enable;
enableSelected = binding.enableSelected;
enableDisableSelected = binding.enableDisableSelected;
View fabMenuDivider = binding.fabMenuDivider;
LinearLayout enableZone = binding.enable;
TextView enableSelected = binding.enableSelected;
TextView enableDisableSelected = binding.enableDisableSelected;
heroImage = binding.heroImage;

localBroadcastManager = LocalBroadcastManager.getInstance(context);
Expand Down Expand Up @@ -578,13 +567,13 @@ protected void onCreate(Bundle savedInstanceState) {
Context otherContext = context.createPackageContext
(themePid, 0);
AssetManager am = otherContext.getAssets();
List foundFolders = Arrays.asList(am.list(""));
String[] foundFolders = am.list("");
tabChecker = new ArrayList<>();
if (!Systems.checkOMS(context)) {
for (int i = 0; i < foundFolders.size(); i++) {
for (String foundFolder : foundFolders) {
if (Resources.allowedForLegacy
(foundFolders.get(i).toString())) {
tabChecker.add(foundFolders.get(i).toString());
(foundFolder)) {
tabChecker.add(foundFolder.toString());
}
}
} else {
Expand Down Expand Up @@ -1027,19 +1016,18 @@ public boolean onOptionsItemSelected(MenuItem item) {
List<String> stateAll = ThemeManager.listAllOverlays(context);

ArrayList<String> allOverlays = new ArrayList<>();
for (int j = 0; j < stateAll.size(); j++) {
for (String state : stateAll) {
try {
String current = stateAll.get(j);
ApplicationInfo appInfo = context
.getPackageManager().getApplicationInfo(
current, PackageManager.GET_META_DATA);
state, PackageManager.GET_META_DATA);
if ((appInfo.metaData != null) &&
(appInfo.metaData.getString(
metadataOverlayParent) != null)) {
String parent =
appInfo.metaData.getString(metadataOverlayParent);
if ((parent != null) && parent.equals(themePid)) {
allOverlays.add(current);
allOverlays.add(state);
}
}
} catch (Exception ignored) {
Expand Down Expand Up @@ -1073,19 +1061,18 @@ public boolean onOptionsItemSelected(MenuItem item) {
context, ThemeManager.STATE_ENABLED);

ArrayList<String> allOverlays = new ArrayList<>();
for (int j = 0; j < stateAll.size(); j++) {
for (String state : stateAll) {
try {
String current = stateAll.get(j);
ApplicationInfo appInfo = context
.getPackageManager().getApplicationInfo(
current, PackageManager.GET_META_DATA);
state, PackageManager.GET_META_DATA);
if ((appInfo.metaData != null) &&
(appInfo.metaData.getString(
metadataOverlayParent) != null)) {
String parent =
appInfo.metaData.getString(metadataOverlayParent);
if ((parent != null) && parent.equals(themePid)) {
allOverlays.add(current);
allOverlays.add(state);
}
}
} catch (Exception ignored) {
Expand Down Expand Up @@ -1120,19 +1107,18 @@ public boolean onOptionsItemSelected(MenuItem item) {
context, ThemeManager.STATE_DISABLED);

ArrayList<String> allOverlays = new ArrayList<>();
for (int j = 0; j < stateAll.size(); j++) {
for (String state : stateAll) {
try {
String current = stateAll.get(j);
ApplicationInfo appInfo = context
.getPackageManager().getApplicationInfo(
current, PackageManager.GET_META_DATA);
state, PackageManager.GET_META_DATA);
if ((appInfo.metaData != null) &&
(appInfo.metaData.getString(
metadataOverlayParent) != null)) {
String parent =
appInfo.metaData.getString(metadataOverlayParent);
if ((parent != null) && parent.equals(themePid)) {
allOverlays.add(current);
allOverlays.add(state);
}
}
} catch (Exception ignored) {
Expand Down Expand Up @@ -1260,7 +1246,7 @@ public void onDestroy() {
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
private static class LayoutLoader extends AsyncTask<String, Integer, String> {
private WeakReference<InformationActivity> ref;
private final WeakReference<InformationActivity> ref;

LayoutLoader(InformationActivity informationActivity) {
super();
Expand Down Expand Up @@ -1315,7 +1301,7 @@ protected String doInBackground(String... sUrl) {
* Class to create the app shortcut on the launcher
*/
private static class AppShortcutCreator extends AsyncTask<String, Integer, String> {
private WeakReference<InformationActivity> ref;
private final WeakReference<InformationActivity> ref;

AppShortcutCreator(InformationActivity informationActivity) {
super();
Expand Down Expand Up @@ -1363,7 +1349,7 @@ protected String doInBackground(String... sUrl) {
* Class to remove all app shortcuts on the launcher
*/
private static class AppShortcutClearer extends AsyncTask<String, Integer, String> {
private WeakReference<InformationActivity> ref;
private final WeakReference<InformationActivity> ref;

AppShortcutClearer(InformationActivity informationActivity) {
super();
Expand Down Expand Up @@ -1408,7 +1394,7 @@ protected String doInBackground(String... sUrl) {
* Class to uninstall the current theme, of which closes out the theme just to end gracefully
*/
private static class uninstallTheme extends AsyncTask<String, Integer, String> {
private WeakReference<InformationActivity> ref;
private final WeakReference<InformationActivity> ref;

uninstallTheme(InformationActivity informationActivity) {
super();
Expand Down
14 changes: 6 additions & 8 deletions app/src/main/java/projekt/substratum/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public class MainActivity extends AppCompatActivity implements
public SearchView searchView;
public TextView actionbarContent;
private TextView actionbarTitle;
Toolbar toolbar;
BottomNavigationView bottomBar;
private Toolbar toolbar;
private BottomNavigationView bottomBar;
private ActionBar supportActionBar;
private int permissionCheck = PackageManager.PERMISSION_DENIED;
private Dialog progressDialog;
Expand Down Expand Up @@ -843,8 +843,7 @@ public boolean onQueryTextSubmit(String query) {
* based on whether there is no root, or Andromeda mode has been disconnected.
*/
private static class RootRequester extends AsyncTask<Void, Void, Boolean> {
boolean isRunning = true;
private WeakReference<MainActivity> ref;
private final WeakReference<MainActivity> ref;

private RootRequester(MainActivity activity) {
super();
Expand Down Expand Up @@ -1066,7 +1065,6 @@ protected void onPostExecute(Boolean dialogReturnBool) {

private void showDialogOrNot(boolean passthrough) {
MainActivity activity = ref.get();
isRunning = false;
if (activity != null) {
Context context = activity.context;
if (passthrough) {
Expand Down Expand Up @@ -1232,7 +1230,7 @@ protected Boolean doInBackground(Void... sUrl) {
* This will not work for Samsung or RRO Legacy as the intended purpose allows.
*/
public static class DoCleanUp extends AsyncTask<Void, Void, Void> {
private WeakReference<Context> ref;
private final WeakReference<Context> ref;

public DoCleanUp(Context context) {
super();
Expand Down Expand Up @@ -1288,8 +1286,8 @@ protected Void doInBackground(Void... sUrl) {
* Accompaniment function for {@link #cleanLogCharReportsIfNecessary()}
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
public static class ClearLogs extends AsyncTask<Void, Void, Void> {
private WeakReference<MainActivity> ref;
static class ClearLogs extends AsyncTask<Void, Void, Void> {
private final WeakReference<MainActivity> ref;

ClearLogs(MainActivity activity) {
super();
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/projekt/substratum/Substratum.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public class Substratum extends Application {

private static final String BINDER_TAG = "BinderService";
private static final FinishReceiver finishReceiver = new FinishReceiver();
public static int initialPackageCount = 0;
public static int initialOverlayCount = 0;
private static int initialPackageCount = 0;
private static int initialOverlayCount = 0;
public static Thread currentThread;
private static Substratum substratum;
private static boolean isWaiting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected void onDestroy() {
* Clear the cache of the application
*/
private static class ClearCache extends AsyncTask<Void, Void, Void> {
private WeakReference<ManageSpaceActivity> ref;
private final WeakReference<ManageSpaceActivity> ref;

ClearCache(ManageSpaceActivity activity) {
super();
Expand Down Expand Up @@ -159,7 +159,7 @@ protected void onPostExecute(Void result) {
* Clear the saved LogChars
*/
private static class ClearLogs extends AsyncTask<Void, Void, Void> {
private WeakReference<ManageSpaceActivity> ref;
private final WeakReference<ManageSpaceActivity> ref;

ClearLogs(ManageSpaceActivity activity) {
super();
Expand Down Expand Up @@ -194,7 +194,7 @@ protected void onPostExecute(Void result) {
* Reset the application to the near-out-of-box experience
*/
private static class ResetApp extends AsyncTask<Void, Void, Void> {
private WeakReference<ManageSpaceActivity> ref;
private final WeakReference<ManageSpaceActivity> ref;

ResetApp(ManageSpaceActivity activity) {
super();
Expand Down
Loading

0 comments on commit 84e3fc0

Please sign in to comment.