Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
no auto updates on fdroid taking in account the subfix
Browse files Browse the repository at this point in the history
fix tmo
  • Loading branch information
raulhaag committed Sep 1, 2018
1 parent f516fca commit 0062f0e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
}
github {
signingConfig signingConfigs.release
versionNameSuffix '-github'
//removed to maintain updates as now are
dimension "builds"
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/ar/rulosoft/mimanganu/MainFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.os.AsyncTask;
import android.os.Bundle;
Expand Down Expand Up @@ -143,7 +144,7 @@ public void onResume() {
}

// App Update
if (pm.getBoolean("app_update", true)) {
if (pm.getBoolean("app_update", true) && !BuildConfig.VERSION_NAME.contains("fdroid")) {
boolean onLatestAppVersion = pm.getBoolean("on_latest_app_version", false);
if (onLatestAppVersion) {
long last_check = pm.getLong("last_app_update", 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
final Preference prefAbout = getPreferenceManager().findPreference("about_text");
prefAbout.setSummary("v" + BuildConfig.VERSION_NAME);

/* Hide app update pref o f-droid users */
if(BuildConfig.VERSION_NAME.contains("fdroid")){
getPreferenceManager().findPreference("app_update").setVisible(false);
}

/* This will check how much storage is taken by the mangas */
new calcStorage().execute(current_filepath);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public void chapterInit(Chapter chapter) throws Exception {
if (chapter.getPages() == 0) {
String web = getNavWithNeededHeaders().getRedirectWeb("https://tumangaonline.me/goto/" + chapter.getPath());
String data = getNavWithNeededHeaders().get(web.replaceAll("/[^/]+$", "/cascade"));
String basedir = getFirstMatch("dirPath\\s*=\\s*\"([^\"]+)\";", data, context.getString(R.string.error));
ArrayList<String> imgs = getAllMatch(".src\\s*=\\s*\\S*\\s*\\+\\s*'([^']+)'\\s*;", data);
String basedir = getFirstMatch("(https://[^']+/uploads/[^']+)", data, context.getString(R.string.error));
ArrayList<String> imgs = getAllMatch("getImage\\('([^']+)", data);
chapter.setPages(imgs.size());
chapter.setExtra( web + "|" + basedir + TextUtils.join("|" + basedir, imgs));
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/ar/rulosoft/mimanganu/utils/UpdateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.List;
import java.util.concurrent.TimeUnit;

import ar.rulosoft.mimanganu.BuildConfig;
import ar.rulosoft.mimanganu.MessageActivity;
import ar.rulosoft.mimanganu.R;
import ar.rulosoft.navegadores.Navigator;
Expand Down Expand Up @@ -254,8 +255,7 @@ protected void onPreExecute() {
protected Void doInBackground(Void... params) {
try {
Triple<String,String, String> info = getCurrentVersion();
String currentVersionTmp = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
if (!currentVersionTmp.equals(info.getFirst())) {
if (!BuildConfig.VERSION_NAME.equals(info.getFirst())) {
Intent intent = new Intent(context, MessageActivity.class);
intent.putExtra(MessageActivity.MESSAGE_VALUE, MessageActivity.MESSAGE_UPDATE);
Util.getInstance().createNotification(context, false, (int) System.currentTimeMillis(), intent, context.getString(R.string.app_update), context.getString(R.string.app_name) + " v" + info.getFirst() + context.getString(R.string.is_available));
Expand Down

0 comments on commit 0062f0e

Please sign in to comment.