简体   繁体   English

64位android,32位应用程序,32位本机库

[英]64 bit android, 32 bit application with 32 bit native library

Let's say we have 64 bit hardware with 64 bit linux kernel and 64 bit android. 假设我们有64位硬件,64位Linux内核和64位android。
So Zygote will be running as 64 bit process with its own instance of DVM. 所以Zygote将以64位进程运行,并拥有自己的DVM实例。

Now assume that there is a third party application which contains a 32 bit native library that is loaded at runtime using system.loadlibrary call. 现在假设存在第三方应用程序,其中包含使用system.loadlibrary调用在运行时加载的32位本机库。

I think that when we try to run this application, zygote will be able to start the process and DVM will be able to interpret classes.dex file even if the apk was built for 32 bit machine. 我认为当我们尝试运行这个应用程序时,zygote将能够启动该过程,即使apk是为32位机器构建的,DVM也能够解释classes.dex文件。 But failure will happen when the application will try to load 32 bit native library since on the device bionic libc and other libraries will be all 64 bit. 但是当应用程序尝试加载32位本机库时会发生故障,因为在设备仿生libc和其他库都将是64位。

Is this understanding correct? 这种理解是否正确?

As I knew, 32bits Native libraries will run successfully at 64bits OS if the OS supports many 32bits libraries( Java Native Interface 32 bit dll on 64 bit system ), and In Android system, the OS arch is 32bits limit( https://android.stackexchange.com/questions/36291/is-android-a-32-bit-or-64-bit-os ), so you need compiling 32 bits native libraries. 据我所知,如果操作系统支持许多32位库( 64位系统上的Java Native Interface 32位dll ),32位Native库将在64位操作系统上成功运行,而在Android系统中,OS arch是32位限制( https:// android .stackexchange.com / questions / 36291 / is-android-a-32-bit-or-64-bit-os ),因此需要编译32位本机库。

In summary, 32bits need 32bits libraries if it runs at 64bits OS. 总之,如果32位运行在64位OS,则32位需要32位库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM