How to make my application system

前端 未结 4 921
梦如初夏
梦如初夏 2020-12-01 15:36

I need create my app as system, because i need get permission android.permission.WRITE_SECURE_SETTINGS. After install to virtual device (Eclipse) my app appears

4条回答
  •  一向
    一向 (楼主)
    2020-12-01 16:02

    You cannot make your app by default as the system app. There are some other ways though through which you could make other normal apps as system apps on rooted phones.

    You can install an APK to /system/app with following steps.

    1. Push APK to SD card.

      $ adb push SecureSetting.apk /sdcard/

    2. Enter the console and get the shell

      $ adb shell

    3. Switch to superuser. If your device is not rooted, get it rooted first. (If you don't know how to do that, just Google.)

      $ su

    4. Remount the system partition with WRITE permission.

      $ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

    5. Cat your APK from /sdcard/ to /system/ , some guys get a fail with cp command due to cp is not supported. So use cat instead.

      $ cat /sdcard/SecureSetting.apk > /system/app/SecureSetting.apk

    6. Remout /system partition back to READ-ONLY, and exit

      $ mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
      $ exit

    Then reboot your device, the APK should have been installed on /system/app. As stated here.

提交回复
热议问题