forked from REAndroid/APKEditor
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug with processing multiple split APKs at once with the option "Ask where to save the file each time" disabled disable desugaring clean up
- Loading branch information
1 parent
995cc9c
commit 52f5b7f
Showing
15 changed files
with
645 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
916 changes: 390 additions & 526 deletions
916
app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MainActivity.java
Large diffs are not rendered by default.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MyAPKLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.abdurazaaqmohammed.AntiSplit.main; | ||
|
||
import android.view.View; | ||
import android.widget.TextView; | ||
|
||
import androidx.core.widget.NestedScrollView; | ||
|
||
import com.reandroid.apk.APKLogger; | ||
|
||
public class MyAPKLogger implements APKLogger { | ||
private final MainActivity mainActivity; | ||
private final TextView logField; | ||
private final NestedScrollView scrollView; | ||
|
||
MyAPKLogger(MainActivity mainActivity, TextView logField, NestedScrollView scrollView) { | ||
this.mainActivity = mainActivity; | ||
this.logField = logField; | ||
this.scrollView = scrollView; | ||
} | ||
|
||
@Override | ||
public void logMessage(String s) { | ||
if (mainActivity.logEnabled) { | ||
mainActivity.getHandler().post(() -> logField.append(new StringBuilder(s).append('\n'))); | ||
scrollView.post(() -> scrollView.fullScroll(View.FOCUS_DOWN)); | ||
} | ||
} | ||
|
||
@Override | ||
public void logError(String s, Throwable throwable) { | ||
mainActivity.showError(throwable); | ||
} | ||
|
||
@Override | ||
public void logVerbose(String s) { | ||
logMessage(s); | ||
} | ||
|
||
public void logMessage(int resourceId) { | ||
if (mainActivity.logEnabled) logMessage(mainActivity.getRss().getString(resourceId)); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/abdurazaaqmohammed/utils/CompareUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.abdurazaaqmohammed.utils; | ||
|
||
import com.abdurazaaqmohammed.AntiSplit.main.AppInfo; | ||
|
||
import java.util.Locale; | ||
|
||
public class CompareUtils { | ||
public static int compareAppInfoByName(AppInfo p1, AppInfo p2) { | ||
return p1.name.toLowerCase(Locale.ROOT).compareTo(p2.name.toLowerCase(Locale.ROOT)); | ||
} | ||
public static int compareByName(String p1, String p2) { | ||
return p1.toLowerCase(Locale.ROOT).compareTo(p2.toLowerCase(Locale.ROOT)); | ||
} | ||
public long getSortField(AppInfo appInfo, int sortMode) { | ||
return sortMode == 1 ? appInfo.lastUpdated : appInfo.firstInstall; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/abdurazaaqmohammed/utils/LanguageUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.abdurazaaqmohammed.utils; | ||
|
||
import android.content.res.Resources; | ||
import android.widget.ScrollView; | ||
import android.widget.TextView; | ||
|
||
import com.abdurazaaqmohammed.AntiSplit.R; | ||
import com.abdurazaaqmohammed.AntiSplit.main.MainActivity; | ||
import com.google.android.material.textfield.TextInputLayout; | ||
|
||
public class LanguageUtil { | ||
public static void updateLang(Resources res, ScrollView settingsDialog, MainActivity context) { | ||
updateMain(res, context); | ||
updateSettingsDialog(settingsDialog, res); | ||
} | ||
|
||
public static void updateMain(Resources res, MainActivity context) { | ||
context.<TextView>findViewById(R.id.decodeButton).setText(res.getString(R.string.merge)); | ||
context.<TextView>findViewById(R.id.fromAppsButton).setText(res.getString(R.string.select_from_installed_apps)); | ||
context.findViewById(R.id.settingsButton).setContentDescription(res.getString(R.string.settings)); | ||
context.findViewById(R.id.installButton).setContentDescription(res.getString(R.string.install)); | ||
context.findViewById(R.id.cancelButton).setContentDescription(res.getString(R.string.cancel)); | ||
context.findViewById(R.id.copyButton).setContentDescription(res.getString(R.string.copy_log)); | ||
} | ||
|
||
public static void updateSettingsDialog(ScrollView settingsDialog, Resources res) { | ||
((TextView) settingsDialog.findViewById(R.id.langPicker)).setText(res.getString(R.string.lang)); | ||
((TextView) settingsDialog.findViewById(R.id.logToggle)).setText(res.getString(R.string.enable_logs)); | ||
((TextView) settingsDialog.findViewById(R.id.ask)).setText(res.getString(R.string.ask)); | ||
((TextView) settingsDialog.findViewById(R.id.showDialogToggle)).setText(res.getString(R.string.show_dialog)); | ||
((TextView) settingsDialog.findViewById(R.id.signToggle)).setText(res.getString(R.string.sign_apk)); | ||
((TextView) settingsDialog.findViewById(R.id.forceToggle)).setText(res.getString(R.string.force)); | ||
((TextView) settingsDialog.findViewById(R.id.selectSplitsForDeviceToggle)).setText(res.getString(R.string.automatically_select)); | ||
((TextView) settingsDialog.findViewById(R.id.updateToggle)).setText(res.getString(R.string.auto_update)); | ||
((TextView) settingsDialog.findViewById(R.id.checkUpdateNow)).setText(res.getString(R.string.check_update_now)); | ||
((TextInputLayout) settingsDialog.findViewById(R.id.suffixLayout)).setHint(res.getString(R.string.suffix)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.