本文介绍了如何进行静默安装(从 ROOTED 的 android 设备内部)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试寻找某种方法,以实用的方式将更新安装到使用 Android 的设备上:

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

  • 没有用户输入的方式
  • 没有互联网或网络
  • 运行的是 Android 4.0

这就是为什么我希望默默地做这件事.最坏的情况是每次我想更新时都将它连接到 PC 上,但这正是我想要避免的.

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.

输入来自外部 SD 卡.

Input is from an external sdcard.

从我目前发现的情况来看,似乎有几种方法可以奏效:

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

所以我的问题如下:

我需要什么程序才能做到这一点,我该如何去做?

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

推荐答案

这是我为遇到同样问题的人所采用的方法和方法.

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

  • 首先我已经安装了 busybox(似乎我需要这个来安装,因为 pm 和 adb 调用都不起作用)
  • 安装终端模拟器(这样我就可以检查命令是否有效并在手机上使用 chmod)

  • 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)

运行终端并输入 su -s

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.

现在我可以从我的应用程序中使用 busybox 调用安装.

Now from my app I can call install using busybox.

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

就我而言,ToInstall 是我从设备中找到的文件.

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

注意:

这个安装很奇怪,我必须使用以下内容来删除

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

可能需要设置繁忙框路径的权限才能使其正常工作.我可以在 su 模式下从终端执行此操作.702 据说可以用,虽然我用 777 是因为不担心安全.

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

这篇关于如何进行静默安装(从 ROOTED 的 android 设备内部)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 03:21