Skip to content

Commit c9eafe9

Browse files
fix f-droid crashes
fixes #10 Signed-off-by: androidacy-user <opensource@androidacy.com>
1 parent 5af6420 commit c9eafe9

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/src/main/java/com/fox2code/mmm/MainActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.fox2code.mmm;
22

3-
import static com.fox2code.mmm.MainApplication.Iof;
3+
import static com.fox2code.mmm.MainApplication.o;
44
import static com.fox2code.mmm.manager.ModuleInfo.FLAG_MM_REMOTE_MODULE;
55

66
import android.animation.Animator;
@@ -121,9 +121,9 @@ protected void onCreate(Bundle savedInstanceState) {
121121
TrackHelper.track().event("enabled_repos", enabledRepos.toString()).with(MainApplication.getINSTANCE().getTracker());
122122
realm.close();
123123
// hide this behind a buildconfig flag for now, but crash the app if it's not an official build and not debug
124-
if (BuildConfig.ENABLE_PROTECTION && !Iof && !BuildConfig.DEBUG) {
124+
if (BuildConfig.ENABLE_PROTECTION && !o && !BuildConfig.DEBUG) {
125125
throw new RuntimeException("This is not an official build of FoxMMM");
126-
} else if (!Iof && !BuildConfig.DEBUG) {
126+
} else if (!o && !BuildConfig.DEBUG) {
127127
Timber.w("You may be running an untrusted build.");
128128
// Show a toast to warn the user
129129
Toast.makeText(this, R.string.not_official_build, Toast.LENGTH_LONG).show();

app/src/main/java/com/fox2code/mmm/MainApplication.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public class MainApplication extends FoxApplication implements androidx.work.Con
9494
// Use FoxProcess wrapper helper.
9595
private static final boolean wrapped = !FoxProcessExt.isRootLoader();
9696
private static final ArrayList<String> callers = new ArrayList<>();
97-
public static boolean Iof = false;
97+
public static boolean o = false;
9898
private static String SHOWCASE_MODE_TRUE = null;
9999
private static long secret;
100100
private static Locale timeFormatLocale = Resources.getSystem().getConfiguration().getLocales().get(0);
@@ -425,10 +425,10 @@ public void onCreate() {
425425
}
426426
try {
427427
@SuppressLint("PackageManagerGetSignatures") Signature[] s = this.getPackageManager().getPackageInfo(this.getPackageName(), PackageManager.GET_SIGNATURES).signatures;
428-
@SuppressWarnings("SpellCheckingInspection") String[] osh = new String[]{"7bec7c4462f4aac616612d9f56a023ee3046e83afa956463b5fab547fd0a0be6", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"};
428+
@SuppressWarnings("SpellCheckingInspection") String[] osh = new String[]{"7bec7c4462f4aac616612d9f56a023ee3046e83afa956463b5fab547fd0a0be6", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "e8ce7deca880304d7ff09f8fc37656cfa927cee7f6a0bb7b3feda6a5942931f5", "339af2fb5b671fa4af6436b585351f2f1fc746d1d922f9a0b01df2d576381015"};
429429
//noinspection SpellCheckingInspection
430430
String oosh = Hashing.sha256().hashBytes(s[0].toByteArray()).toString();
431-
Iof = Arrays.asList(osh).contains(oosh);
431+
o = Arrays.asList(osh).contains(oosh);
432432
} catch (PackageManager.NameNotFoundException ignored) {
433433
}
434434
SharedPreferences sharedPreferences = MainApplication.getSharedPreferences("mmm");

app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
825825
String flavor = BuildConfig.FLAVOR;
826826
String type = BuildConfig.BUILD_TYPE;
827827
// Set the summary of pref_pkg_info to something like default-debug v1.0 (123) (Official)
828-
String pkgInfo = getString(R.string.pref_pkg_info_summary, flavor + "-" + type, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, MainApplication.Iof ? getString(R.string.official) : getString(R.string.unofficial));
828+
String pkgInfo = getString(R.string.pref_pkg_info_summary, flavor + "-" + type, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, MainApplication.o ? getString(R.string.official) : getString(R.string.unofficial));
829829
findPreference("pref_pkg_info").setSummary(pkgInfo);
830830
// special easter egg :)
831831
var ref = new Object() {

0 commit comments

Comments
 (0)