How to do a silent install (from inside an android device that's ROOTED) [closed]

淺唱寂寞╮ 提交于 2019-12-08 09:25:36

问题


I'm currently trying to find some way of pragmatically installing updates onto a device using an Android that:

  • has no means of user input
  • has no internet or network
  • Is running Android 4.0

This is why I am looking to do it silently. Worst case would be hooking it up to a PC every time I wish to update but this is exactly what I'm trying to avoid.

Input is from an external sdcard.

From what I've found so far there seems to a couple of ways that will, apparently, work:

  • Root set the chmod to 777 on the /data/app (and not care about security)
  • appbrain over the web (Useless to me)
  • Write / Rewrite the OS (Past my expertise)

So my question is as follows:

What programs do I need in order to do this and how do I go about doing it?


回答1:


This is how and what I used for people that have the same problem.

  • Firstly I have installed busybox (Seems I needed this to do install as both pm and adb calls didnt work)
  • Install Terminal Emulator (So I could check commands worked and using chmod on phone)

  • Run Terminal and type su -s

Now that the Terminal shows # instead of $ I can now give permission to what I need to do my install.

Now from my app I can call install using busybox.

Runtime.getRuntime().exec("/system/bin/busybox install " + ToInstall.getAbsolutePath() + " /system/app"); 

In my case the ToInstall is a file I have located from a device.

Note:

This installs weirdly I have to use the following to remove

rm /system/app/AppName

Also its looks weird but doesn't matter as I won't have a screen

Permission on busy box path may need to be set in order for this to work. I can do this from the terminal in su mode. 702 is said to work although I used 777 as not worried about security.

 chmod 702 system/bin/busybox 


来源:https://stackoverflow.com/questions/13924431/how-to-do-a-silent-install-from-inside-an-android-device-thats-rooted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!