The program I wrote compiled armeabi, armeabi-v7a, arm64-v8a, and x86 four so files. I want to reduce the APK size by deleting the so files, but after deleting some functions of some models will be lost. An error was reported, and then I found that WeChat only compiled an so file called armeabi, without armeabi-v7a, arm64-v8a. How does x86 run on mobile phones with various processors?
Because armeabi supports running under armeabi, armeabi-v7a, arm64-v8a, and also supports some x86. There are basically no mips architecture mobile phones on the market, so in theory one armeabi can support all mobile phones. armeabi runs under v7 v8, but the efficiency will be different.
You can read this about what you need to know about Android so files
All x86/x86_64/armeabi-v7a/arm64-v8a devices support armeabi architecture .so files, so it seems that removing .so files from other ABIs is a good trick to reduce APK size. But in fact it is not: this not only affects the performance and compatibility of the function library.
x86 devices can run ARM type function libraries very well, but there is no guarantee that crashes will not occur 100%, especially for old devices. 64-bit devices (arm64-v8a, x86_64, mips64) can run 32-bit function libraries, but when running in 32-bit mode, running 32-bit versions of ART and Android components on a 64-bit platform will lose the 64-bit optimizations. performance (ART, webview, media, etc.).
It may be loaded dynamically.
First of all, armeabi is compatible with other architectures armeabi-v7a, arm64-v8a, and x86. Secondly, you just saw the WeChat armeabi directory. You can also place SO files of other architectures in this directory, and then choose which architecture's SO file to load through code.