How to find if apk is 32-bit or 64-bit

后端 未结 2 574
谎友^
谎友^ 2020-12-09 10:31

Given a APK, how can we find whether its a 32-bit app or a 64-bit app? I am observing an app is unable to run on 64-bit android OS. I guess its a 32-bit app.

相关标签:
2条回答
  • 2020-12-09 10:38

    APK is ZIP. You can open it and check directory lib to see which architectures are supported. If there is no directory lib, it supports all architectures.

    64-bit Android is backwards compatible and can run 32-bit applications. On the other hand, Intel Android (both 32-bit and 64-bit) has very limited compatibility with ARM Android (a binary translator called libhoudini is shipped on Intel but from my experience, it works for only very simple code), and ARM Android is completely incompatible with Intel Android. This affects only applications with NDK code in lib, pure Java applications can be run on both.

    0 讨论(0)
  • 2020-12-09 10:53

    Apps without JNI

    If you're not using the JNI, your APK won't contain any .so files.

    Apps with JNI

    Unzip the APK, e.g. unzip tensorflow-lite.aar -d tensorflow-lite

    Look inside /jni, and observe the directories inside it:

    It looks like the APK/ AAR I unzipped contains .so files for all 4 JNI ABI's. This is good, because I built the tensorflow lite library for all platforms.

    0 讨论(0)
提交回复
热议问题