I created an app that is used for app distribution.
It downloads apk files and prompts the user to install them.
If I distribute an app with native code only for x86_x64
it won't install on a arm / arm64 device.
The package installer says that the app is not compatible with the device.
Is there a way I can determine the compatibility before I prompt the user?
Since Api Level 21 I can use Build.SUPPORTED_ABIS
to determine what kind of ABIs the device's CPU can handle.
But how can I know from the APK if it contains native code?
On my computer I can do it with "aapt d --values badging vlc-arm64.apk
"
which gives "native-code:
'arm64-v8a
'"
But I don't have aapt on the Android Device.
Is there an equivalent?
thanks for the tip, I thought there's maybe a more elegant way. But your suggested solution works. I'm iterating over the zip archive with ZipInputStream and check for all paths that start with lib/xxxx/fileZ and save the xxxx part which is the ABI that is supported by the apk. If the apk doesn't have any included libraries, the apk is supported by every Android device with the minimum sdk.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With