fix crash

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/31/head
androidacy-user 2 years ago
parent cf095f39be
commit 3fe42f6f3b

@ -704,7 +704,8 @@ class MainApplication : FoxApplication(), Configuration.Provider {
private set private set
get() { get() {
if (field == null) { if (field == null) {
throw IllegalStateException("Application not created yet!") Timber.w("MainApplication.INSTANCE is null, using fallback!")
return null
} }
return field return field
} }

@ -120,7 +120,7 @@ public enum ActionButtonType {
IntentHelper.openUrlAndroidacy(button.getContext(), updateZipUrl, true, moduleInfo.name, moduleInfo.config); IntentHelper.openUrlAndroidacy(button.getContext(), updateZipUrl, true, moduleInfo.name, moduleInfo.config);
return; return;
} }
boolean hasRoot = InstallerInitializer.peekMagiskPath() != null && !MainApplication.isShowcaseMode(); boolean hasRoot = InstallerInitializer.peekMagiskPath() != null && !MainApplication.Companion.isShowcaseMode();
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(button.getContext()); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(button.getContext());
builder.setTitle(moduleInfo.name).setCancelable(true).setIcon(R.drawable.ic_baseline_extension_24); builder.setTitle(moduleInfo.name).setCancelable(true).setIcon(R.drawable.ic_baseline_extension_24);
CharSequence desc = moduleInfo.description; CharSequence desc = moduleInfo.description;

@ -225,7 +225,7 @@ public final class ModuleHolder implements Comparable<ModuleHolder> {
if (this.repoModule != null && this.moduleInfo != null && !hasUpdate()) { if (this.repoModule != null && this.moduleInfo != null && !hasUpdate()) {
return true; return true;
} }
return this.notificationType != null ? this.notificationType.shouldRemove() : this.footerPx == -1 && this.moduleInfo == null && (this.repoModule == null || !this.repoModule.repoData.isEnabled() || (PropUtils.isLowQualityModule(this.repoModule.moduleInfo) && !MainApplication.isDisableLowQualityModuleFilter())); return this.notificationType != null ? this.notificationType.shouldRemove() : this.footerPx == -1 && this.moduleInfo == null && (this.repoModule == null || !this.repoModule.repoData.isEnabled() || (PropUtils.isLowQualityModule(this.repoModule.moduleInfo) && !MainApplication.Companion.isDisableLowQualityModuleFilter()));
} }
public void getButtons(Context context, List<ActionButtonType> buttonTypeList, boolean showcaseMode) { public void getButtons(Context context, List<ActionButtonType> buttonTypeList, boolean showcaseMode) {

@ -232,7 +232,7 @@ public final class RepoManager extends SyncManager {
} }
if (BuildConfig.DEBUG) Timber.d("Updating meta-data"); if (BuildConfig.DEBUG) Timber.d("Updating meta-data");
int updatedModules = 0; int updatedModules = 0;
boolean allowLowQualityModules = MainApplication.isDisableLowQualityModuleFilter(); boolean allowLowQualityModules = MainApplication.Companion.isDisableLowQualityModuleFilter();
for (int i = 0; i < repoUpdaters.length; i++) { for (int i = 0; i < repoUpdaters.length; i++) {
// Check if the repo is enabled // Check if the repo is enabled
if (!repoUpdaters[i].repoData.isEnabled()) { if (!repoUpdaters[i].repoData.isEnabled()) {
@ -373,7 +373,7 @@ public final class RepoManager extends SyncManager {
private AndroidacyRepoData addAndroidacyRepoData() { private AndroidacyRepoData addAndroidacyRepoData() {
// cache dir is actually under app data // cache dir is actually under app data
File cacheRoot = this.mainApplication.getDataDirWithPath("realms/repos/androidacy_repo"); File cacheRoot = this.mainApplication.getDataDirWithPath("realms/repos/androidacy_repo");
AndroidacyRepoData repoData = new AndroidacyRepoData(cacheRoot, MainApplication.isAndroidacyTestMode()); AndroidacyRepoData repoData = new AndroidacyRepoData(cacheRoot, MainApplication.Companion.isAndroidacyTestMode());
this.repoData.put(ANDROIDACY_MAGISK_REPO_ENDPOINT, repoData); this.repoData.put(ANDROIDACY_MAGISK_REPO_ENDPOINT, repoData);
this.repoData.put(ANDROIDACY_TEST_MAGISK_REPO_ENDPOINT, repoData); this.repoData.put(ANDROIDACY_TEST_MAGISK_REPO_ENDPOINT, repoData);
return repoData; return repoData;

Loading…
Cancel
Save