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

Commit 0aa4abc

Browse files
(chore) final bugfixes
Signed-off-by: androidacy-user <opensource@androidacy.com>
1 parent 37c22ee commit 0aa4abc

File tree

4 files changed

+171
-199
lines changed

4 files changed

+171
-199
lines changed

app/build.gradle.kts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ android {
3737
applicationId = "com.fox2code.mmm"
3838
minSdk = 24
3939
targetSdk = 33
40-
versionCode = 65
40+
versionCode = 66
4141
versionName = "2.0.0"
4242
vectorDrawables {
4343
useSupportLibrary = true
4444
}
4545
multiDexEnabled = true
46-
resourceConfigurations += setOf()
46+
resourceConfigurations.addAll(listOf("ar", "bs", "de", "es-rMX", "fr", "hu", "id", "ja", "nl", "pl", "pt", "pt-rBR", "ro", "ru", "tr", "uk", "zh-rCN", "zh-rTW", "en"))
4747
}
4848

4949
splits {
@@ -94,6 +94,7 @@ android {
9494
flavorDimensions.add("type")
9595
productFlavors {
9696
create("default") {
97+
dimension = "type"
9798
// debug http requests. do not set this to true if you care about performance!!!!!
9899
buildConfigField("boolean", "DEBUG_HTTP", "false")
99100
// Latest commit hash as BuildConfig.COMMIT_HASH
@@ -102,18 +103,18 @@ android {
102103
buildConfigField("String", "BRANCH_NAME", "\"$gitBranch\"")
103104
// Get remote url as BuildConfig.REMOTE_URL
104105
buildConfigField("String", "REMOTE_URL", "\"$gitRemote\"")
105-
dimension = "type"
106106
buildConfigField("boolean", "ENABLE_AUTO_UPDATER", "true")
107107
buildConfigField("boolean", "DEFAULT_ENABLE_CRASH_REPORTING", "true")
108108
buildConfigField("boolean", "DEFAULT_ENABLE_CRASH_REPORTING_PII", "true")
109109
buildConfigField("boolean", "DEFAULT_ENABLE_ANALYTICS", "true")
110110
val properties = Properties()
111111
if (project.rootProject.file("local.properties").exists()) {
112+
properties.load(project.rootProject.file("local.properties").reader())
112113
// grab matomo.url
113114
buildConfigField(
114115
"String", "ANALYTICS_ENDPOINT", "\"" + properties.getProperty(
115-
"matomo.url", "https://s-api.androidacy.com/matomo.php" + "\""
116-
)
116+
"matomo.url", "https://s-api.androidacy.com/matomo.php"
117+
) + "\""
117118
)
118119
} else {
119120
buildConfigField(
@@ -127,7 +128,7 @@ android {
127128
// If androidacy.properties doesn"t exist, use the default client ID which is heavily
128129
// rate limited to 30 requests per minute
129130
if (project.rootProject.file("androidacy.properties").exists()) {
130-
propertiesA.load(project.rootProject.file("androidacy.properties").inputStream())
131+
propertiesA.load(project.rootProject.file("androidacy.properties").reader())
131132
properties.setProperty(
132133
"client_id", "\"" + propertiesA.getProperty(
133134
"client_id",
@@ -153,6 +154,8 @@ android {
153154

154155
// play variant. pretty similiar to default, but with an empty inital online repo list, and use play_client_id instead of client_id
155156
create("play") {
157+
dimension = "type"
158+
applicationIdSuffix = ".play"
156159
// debug http requests. do not set this to true if you care about performance!!!!!
157160
buildConfigField("boolean", "DEBUG_HTTP", "false")
158161
// Latest commit hash as BuildConfig.COMMIT_HASH
@@ -161,18 +164,18 @@ android {
161164
buildConfigField("String", "BRANCH_NAME", "\"$gitBranch\"")
162165
// Get remote url as BuildConfig.REMOTE_URL
163166
buildConfigField("String", "REMOTE_URL", "\"$gitRemote\"")
164-
dimension = "type"
165167
buildConfigField("boolean", "ENABLE_AUTO_UPDATER", "false")
166168
buildConfigField("boolean", "DEFAULT_ENABLE_CRASH_REPORTING", "true")
167169
buildConfigField("boolean", "DEFAULT_ENABLE_CRASH_REPORTING_PII", "true")
168170
buildConfigField("boolean", "DEFAULT_ENABLE_ANALYTICS", "true")
169171
val properties = Properties()
170172
if (project.rootProject.file("local.properties").exists()) {
173+
properties.load(project.rootProject.file("local.properties").reader())
171174
// grab matomo.url
172175
buildConfigField(
173176
"String", "ANALYTICS_ENDPOINT", "\"" + properties.getProperty(
174-
"matomo.url", "https://s-api.androidacy.com/matomo.php" + "\""
175-
)
177+
"matomo.url", "https://s-api.androidacy.com/matomo.php"
178+
) + "\""
176179
)
177180
} else {
178181
buildConfigField(
@@ -186,7 +189,7 @@ android {
186189
// If androidacy.properties doesn"t exist, use the default client ID which is heavily
187190
// rate limited to 30 requests per minute
188191
if (project.rootProject.file("androidacy.properties").exists()) {
189-
propertiesA.load(project.rootProject.file("androidacy.properties").inputStream())
192+
propertiesA.load(project.rootProject.file("androidacy.properties").reader())
190193
properties.setProperty(
191194
"client_id", "\"" + propertiesA.getProperty(
192195
"play_client_id",
@@ -234,6 +237,7 @@ android {
234237
buildConfigField("boolean", "DEFAULT_ENABLE_ANALYTICS", "false")
235238
val properties = Properties()
236239
if (project.rootProject.file("local.properties").exists()) {
240+
properties.load(project.rootProject.file("local.properties").reader())
237241
// grab matomo.url
238242
buildConfigField(
239243
"String", "ANALYTICS_ENDPOINT", "\"" + properties.getProperty(
@@ -463,8 +467,7 @@ android {
463467
}
464468
//noinspection GrDeprecatedAPIUsage
465469
buildToolsVersion = "34.0.0 rc3"
466-
@Suppress("DEPRECATION")
467-
packagingOptions {
470+
@Suppress("DEPRECATION") packagingOptions {
468471
jniLibs {
469472
useLegacyPackaging = true
470473
}

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

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
import io.realm.Realm;
8484
import timber.log.Timber;
8585

86-
@SuppressWarnings("CommentedOutCode")
8786
public class MainApplication extends FoxApplication implements androidx.work.Configuration.Provider {
8887
// Warning! Locales that don't exist will crash the app
8988
// Anything that is commented out is supported but the translation is not complete to at least 60%
@@ -380,51 +379,12 @@ public synchronized Tracker getTracker() {
380379

381380
@Override
382381
public void onCreate() {
383-
supportedLocales.add("ar");
384-
// supportedLocales.add("ar_SA");
385-
supportedLocales.add("bs");
386-
supportedLocales.add("cs");
387-
supportedLocales.add("de");
388-
// supportedLocales.add("el");
389-
// supportedLocales.add("es");
390-
supportedLocales.add("es-rMX");
391-
// supportedLocales.add("et");
392-
supportedLocales.add("fr");
393-
supportedLocales.add("hu");
394-
// supportedLocales.add("hi");
395-
supportedLocales.add("id");
396-
supportedLocales.add("it");
397-
supportedLocales.add("ja");
398-
// supportedLocales.add("ko");
399-
// supportedLocales.add("nb-rNO");
400-
// supportedLocales.add("ne");
401-
supportedLocales.add("pl");
402-
supportedLocales.add("pt-rBR");
403-
// supportedLocales.add("pt-rPT");
404-
supportedLocales.add("ro");
405-
supportedLocales.add("ru");
406-
supportedLocales.add("sk");
407-
supportedLocales.add("tr");
408-
// supportedLocales.add("th");
409-
supportedLocales.add("uk");
410-
// supportedLocales.add("vi");
411-
supportedLocales.add("zh-rCN");
412-
supportedLocales.add("zh-rTW");
413-
supportedLocales.add("en");
382+
supportedLocales.addAll(Arrays.asList("ar", "bs", "de", "es-rMX", "fr", "hu", "id", "ja", "nl", "pl", "pt", "pt-rBR", "ro", "ru", "tr", "uk", "zh-rCN", "zh-rTW", "en"));
414383
if (INSTANCE == null) INSTANCE = this;
415384
relPackageName = this.getPackageName();
416385
super.onCreate();
417386
SentryMain.initialize(this);
418387
// Initialize Timber
419-
/*if (BuildConfig.DEBUG) {
420-
Timber.plant(new Timber.DebugTree());
421-
} else {
422-
if (isCrashReportingEnabled()) {
423-
Timber.plant(new SentryTimberTree(Sentry.getCurrentHub(), SentryLevel.ERROR, SentryLevel.ERROR));
424-
} else {
425-
Timber.plant(new ReleaseTree());
426-
}
427-
}*/
428388
TimberUtils.configTimber();
429389
Timber.i("Starting FoxMMM version %s (%d) - commit %s", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, BuildConfig.COMMIT_HASH);
430390
// Update SSL Ciphers if update is possible
@@ -500,6 +460,7 @@ public void onCreate() {
500460
Timber.w("Androidacy client id is empty! Please set it in androidacy.properties. Will not enable Androidacy.");
501461
SharedPreferences.Editor editor = sharedPreferences.edit();
502462
editor.putBoolean("pref_androidacy_repo_enabled", false);
463+
Timber.w("ANDROIDACY_CLIENT_ID is empty, disabling AndroidacyRepoData 1");
503464
editor.apply();
504465
}
505466
}

app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyRepoData.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ protected boolean prepare() {
190190
SharedPreferences.Editor editor = MainApplication.getPreferences("mmm").edit();
191191
editor.putBoolean("pref_androidacy_repo_enabled", false);
192192
editor.apply();
193+
Timber.w("ANDROIDACY_CLIENT_ID is empty, disabling AndroidacyRepoData 2");
193194
return false;
194195
}
195196
if (Http.needCaptchaAndroidacy()) return false;

0 commit comments

Comments
 (0)