Skip to content

Commit 9460ac9

Browse files
Added: Enable TERMUX_APP_PACKAGE_VARIANT apt-android-5 builds
1 parent ccaf413 commit 9460ac9

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

app/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ext {
88
// crash at startup.
99
// Bootstrap of a different variant must not be manually installed by the user after app installation
1010
// by replacing $PREFIX since app code is dependant on the variant used to build the APK.
11-
// Currently supported values are: [ "apt-android-7" ]
11+
// Currently supported values are: [ "apt-android-7" "apt-android-5" ]
1212
packageVariant = System.getenv("TERMUX_PACKAGE_VARIANT") ?: "apt-android-7" // Default: "apt-android-7"
1313
}
1414

@@ -219,6 +219,12 @@ task downloadBootstraps() {
219219
downloadBootstrap("arm", "f8ec9505081b81da0ee66413762c52e6cb4a6ebd7be1a2a5ddee8953e0795dc9", version)
220220
downloadBootstrap("i686", "0491f12ed84a5ef3c28bd742311fed9f176e32100a2c6bbdb017df8f48044484", version)
221221
downloadBootstrap("x86_64", "94073a0e136bf5a9c05c1997a55dc261248f4ccb8bffaa9a950a132529cd1529", version)
222+
} else if (packageVariant == "apt-android-5") {
223+
def version = "2022.04.25-r1" + "+" + packageVariant
224+
downloadBootstrap("aarch64", "66eac22c1626cfa8c37f0d30e5cc987bf5e01356ef8c883a12d9b65c93b60e64", version)
225+
downloadBootstrap("arm", "84637d87f176bd647c9e05b161ae4de3611773871727b11405076a54cbf43467", version)
226+
downloadBootstrap("i686", "20d7c399bfba5de95309838effb782a2b16e9eff4f72a55150617ee513e25fea", version)
227+
downloadBootstrap("x86_64", "ae35f4d17027df562e241835299d7e711944825f10c1c2d9c5eb91d5e247daba", version)
222228
} else {
223229
throw new GradleException("Unsupported TERMUX_PACKAGE_VARIANT \"" + packageVariant + "\"")
224230
}

termux-shared/src/main/java/com/termux/shared/termux/TermuxBootstrap.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public static boolean isAppPackageVariantAPTAndroid7() {
5858
return PackageVariant.APT_ANDROID_7.equals(TERMUX_APP_PACKAGE_VARIANT);
5959
}
6060

61-
///** Is {@link PackageVariant#APT_ANDROID_5} set as {@link #TERMUX_APP_PACKAGE_VARIANT}. */
62-
//public static boolean isAppPackageVariantAPTAndroid5() {
63-
// return PackageVariant.APT_ANDROID_5.equals(TERMUX_APP_PACKAGE_VARIANT);
64-
//}
61+
/** Is {@link PackageVariant#APT_ANDROID_5} set as {@link #TERMUX_APP_PACKAGE_VARIANT}. */
62+
public static boolean isAppPackageVariantAPTAndroid5() {
63+
return PackageVariant.APT_ANDROID_5.equals(TERMUX_APP_PACKAGE_VARIANT);
64+
}
6565

6666
///** Is {@link PackageVariant#TAPM_ANDROID_7} set as {@link #TERMUX_APP_PACKAGE_VARIANT}. */
6767
//public static boolean isAppPackageVariantTAPMAndroid7() {
@@ -132,10 +132,10 @@ public static PackageManager managerOf(String name) {
132132
public enum PackageVariant {
133133

134134
/** {@link PackageManager#APT} variant for Android 7+. */
135-
APT_ANDROID_7("apt-android-7");
135+
APT_ANDROID_7("apt-android-7"),
136136

137-
///** {@link PackageManager#APT} variant for Android 5+. */
138-
//APT_ANDROID_5("apt-android-5");
137+
/** {@link PackageManager#APT} variant for Android 5+. */
138+
APT_ANDROID_5("apt-android-5");
139139

140140
///** {@link PackageManager#TAPM} variant for Android 7+. */
141141
//TAPM_ANDROID_7("tapm-android-7");

0 commit comments

Comments
 (0)