android 7.1 apk的systemuid和系统应用Setting相同导致开机找不到库的问题

640?wx_fmt=jpeg

640?wx_fmt=jpeg

640?wx_fmt=png

1、前言

640?wx_fmt=png

640?wx_fmt=png

640?wx_fmt=png

Android apk加载机制

这就是我最近在解决的一个问题,32位的apk可以用32位的库,那64位的apk可以用64位的库,如果我想64位的apk同时使用32和64位的库呢?
android加载so文件的机制
apk在安装的过程中,系统就会对apk进行解析根据里面so文件类型,确定这个apk安装是在32 还是 64位的虚拟机上,如果是32位虚拟机那么就不能使用64位so,如果是64位虚拟机也不能使用32位so。而64位设备可以提供32和64位两种虚拟机,根据apk选择开启哪一种,因此说64位设备兼容32的so库。

具体来说就是apk在安装的时候,apk解包的时候,就已经确定要加载多少位的库了,如果apk里面放有两种库,实际用的时候,也是只会加载一种库。

2、我遇到的问题

我们遇到的问题是,我们自己编写的应用是系统应用,使用了系统的systemuid,就是和setting的uid是一样的,而且我们是32位apk,setting是64位apk,这样开机的时候经常遇到setting到不到lib库。对应的日志如下。

03-12 10:48:50.245 1381 1381 D AndroidRuntime: Shutting down VM
03-12 10:48:50.247 1381 1381 E AndroidRuntime: FATAL EXCEPTION: main
03-12 10:48:50.247 1381 1381 E AndroidRuntime: Process: com.android.settings, PID: 1381
03-12 10:48:50.247 1381 1381 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate application com.android.settings.SettingsApplication: java.lang.ClassNotFoundException: Didn’t find class “com.android.settings.SettingsApplication” on path: DexPathList[[zip file “/system/priv-app/Settings/Settings.apk”],nativeLibraryDirectories=[/system/priv-app/Settings/lib/arm64, /system/priv-app/Settings/Settings.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /system/lib, /vendor/lib]]
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:802)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5379)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.app.ActivityThread.-wrap2(ActivityThread.java)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.app.ActivityThreadH.handleMessage(ActivityThread.java:1546)03−1210:48:50.24713811381EAndroidRuntime:atandroid.os.Handler.dispatchMessage(Handler.java:102)03−1210:48:50.24713811381EAndroidRuntime:atandroid.os.Looper.loop(Looper.java:154)03−1210:48:50.24713811381EAndroidRuntime:atandroid.app.ActivityThread.main(ActivityThread.java:6121)03−1210:48:50.24713811381EAndroidRuntime:atjava.lang.reflect.Method.invoke(NativeMethod)03−1210:48:50.24713811381EAndroidRuntime:atcom.android.internal.os.ZygoteInit H.handleMessage(ActivityThread.java:1546)03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6121)03-12 10:48:50.247 1381 1381 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)03-12 10:48:50.247 1381 1381 E AndroidRuntime: at com.android.internal.os.ZygoteInitH.handleMessage(ActivityThread.java:1546)03−1210:48:50.24713811381EAndroidRuntime:atandroid.os.Handler.dispatchMessage(Handler.java:102)03−1210:48:50.24713811381EAndroidRuntime:atandroid.os.Looper.loop(Looper.java:154)03−1210:48:50.24713811381EAndroidRuntime:atandroid.app.ActivityThread.main(ActivityThread.java:6121)03−1210:48:50.24713811381EAndroidRuntime:atjava.lang.reflect.Method.invoke(NativeMethod)03−1210:48:50.24713811381EAndroidRuntime:atcom.android.internal.os.ZygoteInitMethodAndArgsCaller.run(ZygoteInit.java:912)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.android.settings.SettingsApplication” on path: DexPathList[[zip file “/system/priv-app/Settings/Settings.apk”],nativeLibraryDirectories=[/system/priv-app/Settings/lib/arm64, /system/priv-app/Settings/Settings.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /system/lib, /vendor/lib]]
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.app.Instrumentation.newApplication(Instrumentation.java:992)
03-12 10:48:50.247 1381 1381 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:796)

因为我们自己的应用是32位,又使用了系统的uid,这样引导系统也去找对应的32位lib。
当然了,很不幸,setting是没有32位Lib的,所以,就出现了问题,设置挂逼,出现问题的时候,把我们的应用删除掉就可以了。

03-12 10:48:34.351 634 634 I SystemServiceManager: Starting com.android.server.pm.Installer
03-12 10:48:34.359 634 634 I SystemServiceManager: Starting com.android.server.am.ActivityManagerServiceKaTeX parse error: Expected '}', got 'EOF' at end of input: …id.view.DisplayHdrCapabilities@a69d6308, density 280, 213.0 x 213.0 dpi, appVsyncOff 1000000, presDeadline 16129032, touch INTERNAL, rotation 0, type BUILT_IN, state UNKNOWN, FLAG_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
03-12 10:48:34.359 634 634 I SystemServiceManager: Starting com.android.server.am.ActivityManagerServiceKaTeX parse error: Expected '}', got 'EOF' at end of input: …id.view.DisplayHdrCapabilities@a69d6308, density 280, 213.0 x 213.0 dpi, appVsyncOff 1000000, presDeadline 16129032, touch INTERNAL, rotation 0, type BUILT_IN, state UNKNOWN, FLAG_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
03-12 10:48:34.772 634 655 I DisplayManagerService: Display device changed state: “Built-in Screen”, ON
03-12 10:48:34.773 634 634 I SystemServiceManager: Starting phase 100
03-12 10:48:34.774 634 634 I SystemServer: StartPackageManagerService
03-12 10:48:34.926 634 634 I PackageManager: No settings file; creating initial state
03-12 10:48:34.953 634 634 W PackageManager: Library not found: /system/framework/org.apache.http.legacy.jar
03-12 10:48:34.976 634 634 W PackageManager: Library not found: /system/framework/org.apache.http.legacy.jar
03-12 10:48:34.995 634 634 W PackageManager: Failed to parse /system/framework/arm: Missing base APK in /system/framework/arm
03-12 10:48:34.996 634 634 W PackageManager: Failed to parse /system/framework/arm64: Missing base APK in /system/framework/arm64
03-12 10:48:35.044 634 634 I PackageManager: /system/framework/framework-res.apk changed; collecting certs
03-12 10:48:35.237 634 634 W PackageManager: Failed to parse /system/framework/oat: Missing base APK in /system/framework/oat
03-12 10:48:35.249 634 634 I PackageManager: /system/priv-app/BackupRestoreConfirmation changed; collecting certs
03-12 10:48:35.266 634 634 I PackageManager: /system/priv-app/DefaultContainerService changed; collecting certs
03-12 10:48:35.288 634 634 I PackageManager: /system/priv-app/DeviceTest changed; collecting certs
03-12 10:48:35.329 634 634 I PackageManager: /system/priv-app/ExtServices changed; collecting certs
03-12 10:48:35.344 634 634 I PackageManager: /system/priv-app/ExternalStorageProvider changed; collecting certs
03-12 10:48:35.357 634 634 I PackageManager: /system/priv-app/FusedLocation changed; collecting certs
03-12 10:48:35.371 634 634 I PackageManager: /system/priv-app/InputDevices changed; collecting certs
03-12 10:48:35.384 634 634 I PackageManager: /system/priv-app/KeyChain changed; collecting certs
03-12 10:48:35.401 634 634 I PackageManager: /system/priv-app/ManagedProvisioning changed; collecting certs
03-12 10:48:35.419 634 634 I PackageManager: /system/priv-app/MediaProvider changed; collecting certs
03-12 10:48:35.431 634 634 I PackageManager: /system/priv-app/MtpDocumentsProvider changed; collecting certs
03-12 10:48:35.442 634 634 I PackageManager: /system/priv-app/OneTimeInitializer changed; collecting certs
03-12 10:48:35.476 634 634 I PackageManager: /system/priv-app/PackageInstaller changed; collecting certs
03-12 10:48:35.509 634 634 I PackageManager: /system/priv-app/Provision changed; collecting certs
03-12 10:48:35.521 634 634 I PackageManager: /system/priv-app/ProxyHandler changed; collecting certs
03-12 10:48:35.535 634 634 I PackageManager: /system/priv-app/RetailDemo changed; collecting certs
03-12 10:48:35.661 634 634 I PackageManager: /system/priv-app/Settings changed; collecting certs
03-12 10:48:35.817 634 634 I PackageManager: /system/priv-app/SettingsProvider changed; collecting certs
03-12 10:48:35.831 634 634 I PackageManager: /system/priv-app/SharedStorageBackup changed; collecting certs
03-12 10:48:35.848 634 634 I PackageManager: /system/priv-app/Shell changed; collecting certs
03-12 10:48:35.863 634 634 I PackageManager: /system/priv-app/StatementService changed; collecting certs
03-12 10:48:35.889 634 634 I PackageManager: /system/priv-app/StorageManager changed; collecting certs
03-12 10:48:35.889 634 634 I PackageManager: /system/priv-app/StorageManager changed; collecting certs
03-12 10:48:35.931 634 634 I PackageManager: /system/priv-app/StressTest changed; collecting certs
03-12 10:48:36.049 634 634 I PackageManager: /system/priv-app/SystemUI changed; collecting certs
03-12 10:48:36.154 634 634 I PackageManager: /system/app/Bluetooth changed; collecting certs
03-12 10:48:36.173 634 634 I PackageManager: /system/app/BluetoothMidiService changed; collecting certs
03-12 10:48:36.201 634 634 I PackageManager: /system/app/Camera2 changed; collecting certs
03-12 10:48:36.242 634 634 I PackageManager: /system/app/CertInstaller changed; collecting certs
03-12 10:48:36.261 634 634 I PackageManager: /system/app/DownloadProviderUi changed; collecting certs
03-12 10:48:36.275 634 634 I PackageManager: /system/app/ExtShared changed; collecting certs
03-12 10:48:36.295 634 634 I PackageManager: /system/app/FactoryTest changed; collecting certs
03-12 10:48:36.345 634 634 I PackageManager: /system/app/jjjjj110 changed; collecting certs
03-12 10:48:37.598 634 634 W PackageManager: Permission android.permission.FLASHLIGHT from package com.xxxxxx.jjjjj.titket.oceanFlower in an unknown group android.permission-group.HARDWARE_CONTROLS
03-12 10:48:37.689 634 634 I PackageManager: /system/app/LatinIME changed; collecting certs
03-12 10:48:37.868 634 634 I PackageManager: /system/app/Launcher3 changed; collecting certs
03-12 10:48:37.879 634 634 W PackageManager: Permission com.android.launcher3.permission.READ_SETTINGS from package com.android.launcher3 in an unknown group android.permission-group.SYSTEM_TOOLS
03-12 10:48:37.879 634 634 W PackageManager: Permission com.android.launcher3.permission.WRITE_SETTINGS from package com.android.launcher3 in an unknown group android.permission-group.SYSTEM_TOOLS
03-12 10:48:37.879 634 634 W PackageManager: Permission com.android.launcher.permission.INSTALL_SHORTCUT from package com.android.launcher3 in an unknown group android.permission-group.SYSTEM_TOOLS
03-12 10:48:37.895 634 634 I PackageManager: /system/app/LiveWallpapersPicker changed; collecting certs
03-12 10:48:37.915 634 634 I PackageManager: /system/app/MediaFloat changed; collecting certs
03-12 10:48:37.938 634 634 I PackageManager: /system/app/NfcNci changed; collecting certs
03-12 10:48:37.964 634 634 I PackageManager: /system/app/PrintRecommendationService changed; collecting certs
03-12 10:48:37.983 634 634 I PackageManager: /system/app/PrintSpooler changed; collecting certs
03-12 10:48:38.000 634 634 I PackageManager: /system/app/RFTestTool changed; collecting certs
03-12 10:48:38.015 634 634 I PackageManager: /system/app/RKUpdateService changed; collecting certs
03-12 10:48:38.044 634 634 I PackageManager: /system/app/RkExplorer changed; collecting certs
03-12 10:48:38.064 634 634 I PackageManager: /system/app/SecretCode changed; collecting certs
03-12 10:48:38.080 634 634 I PackageManager: /system/app/UserDictionaryProvider changed; collecting certs
03-12 10:48:38.095 634 634 I PackageManager: /system/app/WallpaperPicker changed; collecting certs
03-12 10:48:38.118 634 634 I PackageManager: /system/app/webview changed; collecting certs
03-12 10:48:39.617 634 634 W PackageManager: Protected action; cap priority to 0; package: com.android.packageinstaller activity: com.android.packageinstaller.PackageInstallerActivity origPrio: 1
03-12 10:48:39.617 634 634 I PackageManager: Adjusting ABI for com.android.providers.media to arm64-v8a (requirer=com.android.mtp, scannedPackage=null)
03-12 10:48:39.619 634 634 I PackageManager: Adjusting ABI for com.android.providers.downloads.ui to arm64-v8a (requirer=com.android.mtp, scannedPackage=null)
03-12 10:48:39.620 634 634 W PackageManager: Instruction set mismatch, PackageSetting{1e08467 com.xxxxxx.jjjjj.titket.oceanFlower/1000} requires arm whereas PackageSetting{51ca86c android.rockchip.update.service/1000} requires arm64
03-12 10:48:39.620 634 634 W PackageManager: Instruction set mismatch, PackageSetting{1e08467 com.xxxxxx.jjjjj.titket.oceanFlower/1000} requires arm whereas PackageSetting{992cb54 android/1000} requires arm64
03-12 10:48:39.620 634 634 I PackageManager: Adjusting ABI for com.android.location.fused to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.621 634 634 I PackageManager: Adjusting ABI for com.android.rk to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.622 634 634 I PackageManager: Adjusting ABI for com.DeviceTest to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.623 634 634 I PackageManager: Adjusting ABI for com.cghs.stresstest to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.623 634 634 I PackageManager: Adjusting ABI for com.android.keychain to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.624 634 634 I PackageManager: Adjusting ABI for com.android.rk.mediafloat to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.625 634 634 I PackageManager: Adjusting ABI for com.xingluo.engineermode.test to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.626 634 634 I PackageManager: Adjusting ABI for com.android.inputdevices to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.626 634 634 I PackageManager: Adjusting ABI for com.android.providers.settings to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.628 634 634 I PackageManager: Adjusting ABI for com.android.settings to armeabi-v7a (requirer=com.xxxxxx.jjjjj.titket.oceanFlower, scannedPackage=null)
03-12 10:48:39.632 634 634 I PackageManager: Time to scan packages: 4.701 seconds
03-12 10:48:39.634 634 634 W PackageManager: Unknown permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS in package com.android.providers.downloads.ui
03-12 10:48:39.634 634 634 W PackageManager: Unknown permission android.permission.ACCESS_ALL_DOWNLOADS in package com.android.providers.downloads.ui
03-12 10:48:39.634 634 634 W PackageManager: Unknown permission android.permission.ACCESS_ALL_DOWNLOADS in package com.android.certinstaller
03-12 10:48:39.635 634 634 W PackageManager: Unknown permission android.permission.NFC_UNLOCK in package com.android.nfc
03-12 10:48:39.636 634 634 W PackageManager: Unknown permission com.android.launcher.permission.READ_SETTINGS in package com.android.launcher3
03-12 10:48:39.636 634 634 W PackageManager: Unknown permission com.android.launcher.permission.WRITE_SETTINGS in package com.android.launcher3
03-12 10:48:39.636 634 634 W PackageManager: Not granting permission android.permission.BIND_APPWIDGET to package com.android.launcher3 (protectionLevel=18 flags=0x3c4bbe45)
03-12 10:48:39.637 634 634 W PackageManager: Unknown permission android.permission.RECORD_VIDEO in package com.xxxxxx.jjjjj.titket.oceanFlower
03-12 10:48:39.637 634 634 W PackageManager: Unknown permission com.android.launcher.permission.READ_SETTINGS in package com.android.onetimeinitializer
03-12 10:48:39.637 634 634 W PackageManager: Unknown permission com.android.launcher.permission.WRITE_SETTINGS in package com.android.onetimeinitializer
03-12 10:48:39.637 634 634 W PackageManager: Unknown permission com.google.android.permission.INSTALL_WEARABLE_PACKAGES in package com.android.packageinstaller
03-12 10:48:39.637 634 634 W PackageManager: Unknown permission android.permission.DOWNLOAD_WITHOUT_NOTIFICATION in package com.android.inputmethod.latin
03-12 10:48:39.638 634 634 W PackageManager: Unknown permission android.permission.SENSOR_INFO in package com.xingluo.engineermode.test
03-12 10:48:39.638 634 634 W PackageManager: Unknown permission android.permission.SENSOR_ENABLE in package com.xingluo.engineermode.test
03-12 10:48:39.639 634 634 W PackageManager: Unknown permission com.android.launcher.permission.READ_SETTINGS in package com.xingluo.engineermode.test
03-12 10:48:39.639 634 634 W PackageManager: Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings
03-12 10:48:39.639 634 634 W PackageManager: Unknown permission android.permission.ACCESS_DOWNLOAD_MANAGER in package com.android.settings
03-12 10:48:39.639 634 634 W PackageManager: Unknown permission android.permission.ACCESS_DOWNLOAD_MANAGER in package com.android.settings
03-12 10:48:39.640 634 634 W PackageManager: Unknown permission com.android.launcher.permission.READ_SETTINGS in package com.android.settings
03-12 10:48:39.640 634 634 W PackageManager: Unknown permission com.android.launcher.permission.WRITE_SETTINGS in package com.android.settings
03-12 10:48:39.644 634 634 W PackageManager: Unknown permission com.android.launcher.permission.READ_SETTINGS in package com.DeviceTest
03-12 10:48:39.645 634 634 W PackageManager: Unknown permission com.google.android.gallery3d.permission.GALLERY_PROVIDER in package com.android.bluetooth
03-12 10:48:39.645 634 634 W PackageManager: Unknown permission com.android.gallery3d.permission.GALLERY_PROVIDER in package com.android.bluetooth
03-12 10:48:39.646 634 634 V PackageManager: reconcileAppsData for null u0 0x3
03-12 10:48:39.901 634 634 V PackageManager: reconcileAppsData finished 47 packages
03-12 10:48:40.599 634 634 D PackageManager: Ephemeral resolver NOT found; no matching intent filters
03-12 10:48:40.600 634 634 I PackageManager: Ephemeral deactivated; missing resolver and installer
03-12 10:48:40.652 634 634 I SystemServer: StartUserManagerService
03-12 10:48:40.652 634 634 I SystemServiceManager: Starting com.android.server.pm.UserManagerServiceLifeCycle03−1210:48:40.672634634ISystemServiceManager:Startingcom.android.server.BatteryService03−1210:48:40.688634634ISystemServiceManager:Startingcom.android.server.usage.UsageStatsService03−1210:48:40.710634634ISystemServiceManager:Startingcom.android.server.webkit.WebViewUpdateService03−1210:48:40.718634634ISystemServer:Readingconfiguration…03−1210:48:40.718634634ISystemServer:StartSchedulingPolicyService03−1210:48:40.720634634ISystemServer:StartEntropyMixer03−1210:48:40.721634634WEntropyMixer:Noexistingentropyfile−−firstboot?03−1210:48:40.722634634IEntropyMixer:Writingentropy…03−1210:48:40.727634634ISystemServer:CameraService03−1210:48:40.730634634ISystemServiceManager:Startingcom.android.server.camera.CameraService03−1210:48:40.734634685IServiceThread:EnabledStrictModeloggingforCameraServiceproxylooper.03−1210:48:40.735634634ISystemServer:StartAccountManagerService03−

看上面的日志,日志是开机的时候打印,过滤掉PackageManager,就可以看到系统开机安装apk的顺序,对我们调试来说也是非常有帮助。
里面有两条日志,如下:

03-12 10:48:39.620 634 634 W PackageManager: Instruction set mismatch, PackageSetting{1e08467 com.xxxxxx.jjjjj.titket.oceanFlower/1000requires arm whereas PackageSetting{51ca86c android.rockchip.update.service/1000requires arm64
03-12 10:48:39.620 634 634 W PackageManager: Instruction set mismatch, PackageSetting{1e08467 com.xxxxxx.jjjjj.titket.oceanFlower/1000requires arm whereas PackageSetting{992cb54 android/1000requires arm64

大概意思就是说,一个apk需要arm,就是32位的库,一个apk需要arm64,就是64位的库。好吧,这样已经对我们的问题非常明显的。

3、如何查看apk是32位还是64位?

使用Zygote来判断应用是32位还是64位,Android生出Zygote,Zygote生出SystemServer,SystemServer又启动PackageManagerService和ActivityManagerService。由此可以知道Zygote在Android系统中的重要性。

640?wx_fmt=png

如上图,在64位的android机器中,有两个Zygote。
640?wx_fmt=png

从Zygote64出生出来的都是64位的Apk,从Zygote出生来的都是32位的Apk。


4、如何修改?

  • 通过上面的日志,可以想出第一种修改,就是把我们的apk不使用系统的uid。

  • 可是我们又需要系统的uid权限,这个方法被无耻的否决掉。

  • 还有一种方法,就是把我们的apk修改为64位的,那他就自己去找64位的库就好了。

  • 这个方法也很不幸,我们有一个库是第三方的,就只有32位的库。
    最后一种方法是从网上找到的,需要修改两个位置。

  • 1.在apk对应的android.mk中
    LOCAL_DEX_PREOPT := nostripping

  • 2./device/rockchip/rk3399/BoardConfig.mk,
    DEX_PREOPT_DEFAULT := nostripping

    640?wx_fmt=png

5、隐患

我们上面的修改保证了可以在apk的uid相同的情况下使用不同的Lib位库,但是32位的apk理论上运行的速度肯定没有64位的速度快,CPU跟外设的交互有地址总线,数据总线,和控制总线,64位的cpu寻址的宽度更大,理论上运行速度肯定是更加快的。就像拿一个水杯和一个水桶去装水,肯定是水桶能装的水更多。

6、参考

https://www.jianshu.com/p/62b3c153ad68
https://www.jianshu.com/p/3dbe46439359
https://blog.csdn.net/lemonpi/article/details/79620039
https://blog.csdn.net/cqupt_chen/article/details/9019841


640?wx_fmt=png


当你看到这里的时候,说明你已经阅读完上面的内容

不管怎样,感谢您有心或者无意的关注和支持

想获取学习1024G资料,请点击状态栏公众号福利按钮


640?wx_fmt=jpeg




本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/468725.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

怎样的人适合当码农?

1高中的时候,我一个友仔,他说要创办一个科技协会,然后跟我说电脑里面的代码都是0和1组成的,我现在还记得那天我们在学校开会的时候讨论电脑如何运行,我一脸痴呆的听他给我讲解电子知识,而且他后面自己做了一…

android 7.1 apk的systemuid [2]

1 上周发的一篇文章《android 7.1 apk的systemuid和系统应用Setting相同导致开机找不到库的问题》,然后有个小伙伴找我讨论了,觉得自己的脑洞了打开了很多,所以针对这个问题再次做一次总结,如果大家有好的建议也可以在文末留言。…

Struts2_3_国际化处理_自定义拦截器_文件上传及下载_OGNL

Struts2国际化处理 浏览器根据当前的语言环境自动查找对应的语言环境资源包, 使jsp显示合适的语言数据环境 Struts2实现国际化, 动作类必须继承ActionSupport 创建资源包 资源包由多个properties文件组成, properties文件的文件名必须满足命名规范: 文件名_语言代码_国家代码…

RBAC 基于角色的访问控制

RBAC(Role-Based Access Control,基于角色的访问控制),就是用户通过角色与权限进行关联。简单地说,一个用户拥有若干角色,每一个角色拥有若干权限。这样,就构造成“用户-角色-权限”的授权模型。…

C语言书籍大全

学习过linux的同学应该都知道,linux系统几乎都是用c编写,包括现在主流的android,ios系统,都是使用c编程。为了方便大家学习C语言,小编搜集整理了市面几乎所有的C语言书籍,下面给出部分比较有名的,在微信公众…

android 7.1 apk的systemuid相同导致问题[2]

1上周发的一篇文章《android 7.1 apk的systemuid和系统应用Setting相同导致开机找不到库的问题》,然后有个小伙伴找我讨论了,觉得自己的脑洞了打开了很多,所以针对这个问题再次做一次总结,如果大家有好的建议也可以在文末留言。2先…

送书送书送书,(包邮)送,仅此而已!

亲爱的各位fans们,大家好,这次小编联合5个公众号朋友一起送书,一共送出 6本,当然包邮!感谢本次活动的赞助商北京大学出版社。6个公众号联合送书,一共6本书,每个公众号送1本(包邮)。 6个公众号同…

requests 获取div_爬虫系列第五篇 使用requests与BeautifulSoup爬取豆瓣图书Top250

上一篇我们学习了BeautifulSoup的基本用法,本节我们使用它来爬取豆瓣图书Top250。一、网页分析我们爬取的网页的url是https://book.douban.com/top250?icnindex-book250-all。首页如图与豆瓣电影Top250差不多,将页面拉到最底部,可以看到分页…

python--socket套接字/TCP

socket套接字/TCP 一 客户端/服务器架构 C/S架构,包括 硬件C/S架构(打印机)软件C/S 架构(web服务)C/S架构的软件(软件属于应用层)是基于网络进行通信的Server端要: 1.力求一直提供服…

uniapp封装网络请求_八张图带你走进“通过一个完美请求封装一个网络模块”

本文提供视频课程讲解,需要的小伙伴可以点赞私信‘’网络模块‘’前往领取学习大纲1、网络模块在应用中的地位1.1当今占统治地位的网络组件OKHttp OkHttp 是一个相对成熟的解决方案,据说 Android4.4 的源码中可以看到 HttpURLConnection 已经替换成 OkHt…

毕业的这0111年

1.2004年,不知道大家对这个时间有没有感觉,那几年我正在读高中,韩寒的《三重门》席卷校园,同样还有郭敬明的《夏至未至》。那时候的我,还挣扎在温饱阶段,我每天吃饭的时候都想上食堂的三楼吃风味&#xff0…

我的互助小蜜圈

写在前面 从不久之前到现在,我的微信公众号从一个小小小阶段到了另一个小小阶段,非常感谢各位读者对我的信任和支持,当然我也是非常用心的维护这这群大佬,时刻想着怎样给各位大佬做好服务 ,比如我正在溜娃&#xff0c…

比较两个表格的不同_两表数据的核对,WPS表格似乎更加方便容易

在EXCEL中的两个表格的数据对比,可能使用的方法会采用到查询语句,VBA之类的。显得在使用的过程显得有些复杂。在不经间发现WPS表格的功能处理此类的问题显得就比较的简单的多。查看并标识出分数相同的内容如下面的分数表,选择分数栏的范围&am…

我的知识小密圈

写在前面从不久之前到现在,我的微信公众号从一个小小小阶段到了另一个小小阶段,非常感谢各位读者对我的信任和支持,当然我也是非常用心的维护这这群朋友,时刻想着怎样给大家做好服务 ,比如我正在溜娃,隔断时…

vk_down 每次下翻丙行 c++_笔记本接口不够用?不妨试试这款Type-C拓展坞,给你7个接口用...

随着笔记本电脑越来越轻薄化,已经很难再布局较多的数据接口了,但是在办公等环境下总是需要这些接口来满足需求。就拿小新个人来说,使用的是小米笔记本12.5寸款的,该款笔记本仅有三个接口,分别是全功能 USB-C 接口 x 1、…

学习,才是最好的投资~

推荐语:我因为王小波常说而喜欢的英国哲学家罗素的一句话: 参差多态乃是幸福的本源。正是因为有了多种多样的行业,才使得我们的职业也是多种多样,行行出大牛!这个世界天生就注定有人搞互联网的,Linux&#…

第二百四十八节,Bootstrap轮播插件

Bootstrap轮播插件 学习要点: 1.轮播插件 本节课我们主要学习一下 Bootstrap 中的轮播插件。 一.轮播 轮播插件就是将几张同等大小的大图,按照顺序依次播放。 基本实例。 第一步,给轮播器区域div设置一个id给轮播器区域div设置样…

xgboost分类_XGBoost(Extreme Gradient Boosting)

一、XGBoost在Ensemble Learning中的位置机器学习中,有一类算法叫集成学习(Ensemble Learning),所谓集成学习,指将多个分类器的预测结果集成起来,作为最终预测结果,它要求每个分类器具备一定的“…

Android技术架构演进与未来

本文阅读大约需15分钟 引言众所周知,Android是谷歌开发的一款基于Linux的开源操作系统,每年迭代一次大版本升级。 小米、华为、OPPO、VIVO、三星等各大厂商对Android原生系统进行二次开发衍生出具有各家特色的系统(比如MIUI)&…

Hibernate_1_配置文件详解_基础案例_Hibernate工具类_API详解_持久化类编写规则

Hibernate( ORM框架 ) Hibernate是一个数据持久化层的ORM框架. 它通过JavaBean, 数据库中的表与自身的映射关系达到表中数据的增删改查 特性 1.对JDBC访问数据库的代码进行封装, 简化数据访问的重复性代码 2.使用反射机制完成对Bean的封装 3.轻量级框架,支持关系型数据库 核…