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

Commit 2c57d97

Browse files
committed
Add Androidacy test-mode fix to non test-mode.
1 parent 4811028 commit 2c57d97

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,16 @@ private String injectToken(String url) {
288288
// Do not inject token for non Androidacy urls
289289
if (!AndroidacyUtil.isAndroidacyLink(url))
290290
return url;
291-
if (this.testMode && url.startsWith("https://api.androidacy.com/")) {
292-
Log.e(TAG, "Got non test mode url: " + AndroidacyUtil.hideToken(url));
293-
url = "https://staging-api.androidacy.com/" + url.substring(27);
291+
if (this.testMode) {
292+
if (url.startsWith("https://api.androidacy.com/")) {
293+
Log.e(TAG, "Got non test mode url: " + AndroidacyUtil.hideToken(url));
294+
url = "https://staging-api.androidacy.com/" + url.substring(27);
295+
}
296+
} else {
297+
if (url.startsWith("https://staging-api.androidacy.com/")) {
298+
Log.e(TAG, "Got test mode url: " + AndroidacyUtil.hideToken(url));
299+
url = "https://api.androidacy.com/" + url.substring(35);
300+
}
294301
}
295302
String token = "token=" + this.token;
296303
if (!url.contains(token)) {

0 commit comments

Comments
 (0)