作者:容源伯依79 | 来源:互联网 | 2023-02-09 12:45
Iwanttomakemyappbecomesystemappprogrammatically.Imanagedtodoitinmyphonewithroota
I want to make my app become system app programmatically. I managed to do it in my phone with root and busybox. any idea how achieve this without busybox?
我想以编程方式将我的应用程序变为系统应用程序。我设法在我的手机中使用root和busybox。任何想法如何没有busybox实现这一点?
Runtime.getRuntime().exec(new String[] { "su", "-c", "mount -o rw,remount -t yaffs2 /system; " +
"cp `ls /data/app/xxx*` /system/app; " +
"rm /data/app/xxx*; " +
"mount -o ro,remount -t yaffs2 /system; " +
"reboot" });
Beside this, I also faced another issue. If i switch back my app from system app > user app and reboot. Android system still recognize my app as system app even though the app already reside in /data/app.
除此之外,我还面临另一个问题。如果我从系统应用程序>用户应用程序切换回我的应用程序并重启。即使应用程序已驻留在/ data / app中,Android系统仍将我的应用程序识别为系统应用程序。
I use code below to check whether my app is system app:
我使用下面的代码检查我的应用程序是否是系统应用程序:
android.content.pm.ApplicationInfo.FLAG_SYSTEM
1 个解决方案