diff --git a/patches/src/main/kotlin/app/template/patches/shared/Constants.kt b/patches/src/main/kotlin/app/template/patches/shared/Constants.kt index 4e5be42ea..658711cb7 100644 --- a/patches/src/main/kotlin/app/template/patches/shared/Constants.kt +++ b/patches/src/main/kotlin/app/template/patches/shared/Constants.kt @@ -3,6 +3,7 @@ package app.template.patches.shared import app.morphe.patcher.patch.ApkFileType import app.morphe.patcher.patch.AppTarget import app.morphe.patcher.patch.Compatibility +import app.morphe.patcher.patch.SupportedAbi object Constants { val COMPATIBILITY_EXAMPLE = Compatibility( @@ -14,8 +15,13 @@ object Constants { // "version = null" means the patch works with the latest app target // and is expected to work with all future app targets. // - // It is highly recommended to always include the exact app version you developed your patches for - // or the last version you have confirmed as 100% working. + // It is highly recommended to always include the exact app version developed + // your patches for or the last version you have confirmed as 100% working. + // + // It is highly preferred to use app versions that are + // available on apkmirror.com or uptodown.com, as Morphe web-search will + // redirect users to these sites. If an app version is not available + // on ApkMirror or UpToDown, then the user will be sent to Google search. AppTarget( version = "2.0.0" ), @@ -25,9 +31,8 @@ object Constants { ) ) - val COMPATIBILITY_EXAMPLE_2 = Compatibility( - name = "ABC app", + name = "XYZ app", packageName = "com.example.app", apkFileType = ApkFileType.APKM, appIconColor = 0x00FF45, // Icon color in Morphe Manager. Usually the same color as the icon background. @@ -44,4 +49,29 @@ object Constants { ) ) + // Version code restriction. + // Required for certain apps that can have multiple architecture releases with the same + // version name (1.0.1) but different version codes (584009457). + val COMPATIBILITY_EXAMPLE_3 = Compatibility( + name = "XYZ app", + packageName = "com.example.app", + apkFileType = ApkFileType.APKM, + appIconColor = 0x00FF45, + targets = listOf( + AppTarget( + version = "1.0.5", + // Required version code. If the user tries to patch a different version code + // then Manager will warn they have the wrong original apk/apkm. + // + // This declaration is only required when multiple architecture releases have the + // same version code but only 1 specific version code works or has been well tested. + // If there is only 1 release for each architecture file type, then it's best + // not to declare this. + versionCodes = mapOf( + SupportedAbi.ARM64_V8A to 584009457, + SupportedAbi.ARMEABI_V7A to 584119423 + ) + ) + ) + ) }