system/app或者priv-app目录下的系统应用需要可卸载
vendor/mediatek/proprietary/frameworks/base/data/etc/pms_sysapp_removable_system_list.txt
在文件中添加需要可卸载应用的包名
com.android.quicksearchbox
com.android.calendar
com.android.dreams.basic
com.android.musicfx
com.android.calculator2
com.android.email
com.android.exchange
+com.android.fmradio
将systemapp改为可卸载后打开报错,如:
01-02 03:58:32.208: E/AndroidRuntime(12271): FATAL EXCEPTION: main
01-02 03:58:32.208: E/AndroidRuntime(12271): Process: com.android.fmradio, PID: 12271
01-02 03:58:32.208: E/AndroidRuntime(12271): java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/priv-app/FMRadio/lib/arm/libfmjni.so" needed or dlopened by "/system/lib/libnativeloader.so" is not accessible for the namespace "classloader-namespace"
01-02 03:58:32.208: E/AndroidRuntime(12271): at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
01-02 03:58:32.208: E/AndroidRuntime(12271): at java.lang.System.loadLibrary(System.java:1657)
01-02 03:58:32.208: E/AndroidRuntime(12271): at com.android.fmradio.FmNative.<clinit>(FmNative.java:24)
01-02 03:58:32.208: E/AndroidRuntime(12271): at com.android.fmradio.FmNative.openDev(Native Method)
01-02 03:58:32.208: E/AndroidRuntime(12271): at com.android.fmradio.FmService.openDevice(FmService.java:667)
01-02 03:58:32.208: E/AndroidRuntime(12271): at com.android.fmradio.FmService.onCreate(FmService.java:1485)
01-02 03:58:32.208: E/AndroidRuntime(12271): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3380)
01-02 03:58:32.208: E/AndroidRuntime(12271): at android.app.ActivityThread.-wrap4(Unknown Source:0)
01-02 03:58:32.208: E/AndroidRuntime(12271): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1711)
01-02 03:58:32.208: E/AndroidRuntime(12271): at android.os.Handler.dispatchMessage(Handler.java:106)
01-02 03:58:32.208: E/AndroidRuntime(12271): at android.os.Looper.loop(Looper.java:164)
01-02 03:58:32.208: E/AndroidRuntime(12271): at android.app.ActivityThread.main(ActivityThread.java:6548)
01-02 03:58:32.208: E/AndroidRuntime(12271): at java.lang.reflect.Method.invoke(Native Method)
01-02 03:58:32.208: E/AndroidRuntime(12271): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
01-02 03:58:32.208: E/AndroidRuntime(12271): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
将需要引用的so库添加到system/core/rootdir/etc/public.libraries.android.txt 文件中
libandroid.so
libaaudio.so
libc.so
libcamera2ndk.so
libdl.so
libEGL.so
libGLESv1_CM.so
libGLESv2.so
libGLESv3.so
libicui18n.so
libicuuc.so
libjnigraphics.so
liblog.so
libmediandk.so
libm.so
libnativewindow.so
libneuralnetworks.so
libOpenMAXAL.so
libOpenSLES.so
libRS.so
libstdc++.so
libsync.so
libvulkan.so
libwebviewchromium_plat_support.so
libz.so
+libfmjni.so