mirror of
https://github.com/Fox2Code/FoxMagiskModuleManager
synced 2024-10-30 15:20:15 +00:00
Change version string when there is an update (Fix #24)
This commit is contained in:
parent
0affbe7aee
commit
0ecc413041
@ -10,7 +10,7 @@ android {
|
||||
applicationId "com.fox2code.mmm"
|
||||
minSdk 21
|
||||
targetSdk 31
|
||||
versionCode 15
|
||||
versionCode 16
|
||||
versionName "0.2.5"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
@ -177,8 +177,11 @@ public final class ModuleViewAdapter extends RecyclerView.Adapter<ModuleViewAdap
|
||||
|
||||
ModuleInfo moduleInfo = moduleHolder.getMainModuleInfo();
|
||||
this.titleText.setText(moduleInfo.name);
|
||||
this.creditText.setText(moduleInfo.version + " " +
|
||||
this.getString(R.string.module_by) + " " + moduleInfo.author);
|
||||
this.creditText.setText((localModuleInfo == null ||
|
||||
moduleInfo.version.equals(localModuleInfo.version) ? moduleInfo.version :
|
||||
localModuleInfo.version + " (" + this.getString(
|
||||
R.string.module_last_update) + moduleInfo.version + ")") +
|
||||
" " + this.getString(R.string.module_by) + " " + moduleInfo.author);
|
||||
this.descriptionText.setText(moduleInfo.description);
|
||||
String updateText = moduleHolder.getUpdateTimeText();
|
||||
if (!updateText.isEmpty()) {
|
||||
|
@ -129,7 +129,8 @@ public class PropUtils {
|
||||
}
|
||||
break;
|
||||
case "author":
|
||||
moduleInfo.author = value;
|
||||
moduleInfo.author = value.endsWith(" development team") ?
|
||||
value.substring(0, value.length() - 17) : value;
|
||||
break;
|
||||
case "description":
|
||||
moduleInfo.description = value;
|
||||
@ -200,7 +201,8 @@ public class PropUtils {
|
||||
if (moduleInfo.name == null || !readName) {
|
||||
moduleInfo.name = makeNameFromId(moduleInfo.id);
|
||||
}
|
||||
if (moduleInfo.version == null || !readVersion) {
|
||||
// We can't accept too long version names for usability reason.
|
||||
if (moduleInfo.version == null || !readVersion || moduleInfo.version.length() > 16) {
|
||||
moduleInfo.version = "v" + moduleInfo.versionCode;
|
||||
}
|
||||
if (moduleInfo.minApi == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user