Android 中的进程终止是如何工作的?

发布于 2024-10-06 05:39:55 字数 188 浏览 1 评论 0原文

我使用高级任务杀手(许多其他任务杀手)来杀死我的Android手机中的进程,大多数情况下都有效,但有时我发现你在任务杀手中杀死进程并不意味着进程被真正杀死,它仍然有效在后台,是否有任何工具具有更多权限并且可以看到所有后台进程?(我认为高级任务杀手只能看到“用户”级进程)

如果您不介意,您能解释一下这些任务杀手小程序是如何工作的吗?实际上工作吗?

I used advanced task killer (many other task killer) to kill processes in my android phone, most of the cases do work, but sometimes I find you kill the process in task killer doesn't mean the process get really killed, it still works in background, Is there any tool that have more privilege and can see all background processes ?(I think advanced task killer can only see the "user" level processes)

If you don't mind, can you explain me how these task killer applets actually work ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情定在深秋 2024-10-13 05:39:55

这是一个新手的大胆猜测:

Android 位于 Linux 操作系统之上,如下所示 此处。如果您连接到 Android 虚拟设备 (avd) 并打开终端模拟器或通过 ADB,你会发现你可以访问各种linux命令。

C:\Users\james>adb -e shell
# cd /system/bin
# ls -a -l
...
lrwxr-xr-x root     shell             2010-06-30 15:32 insmod -> toolbox
-rwxr-xr-x root     shell       18172 2010-06-30 15:32 installd
lrwxr-xr-x root     shell             2010-06-30 15:32 ioctl -> toolbox
lrwxr-xr-x root     shell             2010-06-30 15:32 ionice -> toolbox
-rwxr-xr-x root     shell       10036 2010-06-30 15:33 keystore
-rwxr-xr-x root     shell        6520 2010-06-30 15:33 keystore_cli
lrwxr-xr-x root     shell             2010-06-30 15:32 kill -> toolbox

请注意,大多数命令只是一个小程序(工具箱)的链接。
我可以使用 ps 命令列出正在运行的程序,但如果我尝试使用 kill 命令杀死它们...它会说我没有权限。您也许可以创建一个使用底层 ps 和kill 命令的任务管理器来为您完成脏活。不过,您可能必须克服一些许可问题。

我希望您可以使用以下命令运行系统命令:

Runtime.getRuntime().exec("ls");

编辑:

我浏览了 this open源任务管理器,但我没有看到它如何杀死任务。也许更有经验的人可以解释一下。

Here is a wild guess from a novice:

Android sits on top of the linux operating system as shown here. If you connect to your android virtual device (avd) and open the terminal emulator or connect through the ADB, you will find that you have access to various linux commands.

C:\Users\james>adb -e shell
# cd /system/bin
# ls -a -l
...
lrwxr-xr-x root     shell             2010-06-30 15:32 insmod -> toolbox
-rwxr-xr-x root     shell       18172 2010-06-30 15:32 installd
lrwxr-xr-x root     shell             2010-06-30 15:32 ioctl -> toolbox
lrwxr-xr-x root     shell             2010-06-30 15:32 ionice -> toolbox
-rwxr-xr-x root     shell       10036 2010-06-30 15:33 keystore
-rwxr-xr-x root     shell        6520 2010-06-30 15:33 keystore_cli
lrwxr-xr-x root     shell             2010-06-30 15:32 kill -> toolbox

Notice that most of the commands are just links to one small program (toolbox).
I can list the running programs with the ps command but if I try to kill them with the kill command... it says i do not have permission. You might be able to create a task manager that uses the underlying ps and kill commands in order to do the dirty work for you. You may have to overcome some permission issues though.

I expect you could run the system commands with something like this:

Runtime.getRuntime().exec("ls");

Edit:

I skimmed through this open source task manager but I didn't see how it goes about killing tasks. Maybe someone more experienced can explain it.

ゃ懵逼小萝莉 2024-10-13 05:39:55

您可以在菜单按钮 -> 下更改设置设置->自动终止级别和安全级别。自动终止级别应设置为疯狂,安全级别应设置为低。我很确定它能得到一切。也许太多了,可能想将一些应用程序添加到忽略列表中。就像时钟应用程序一样,否则你的闹钟将无法工作。

至于内部如何运作,我不知道。

You can change the settings under Menu button -> Setting -> Auto Kill Level and Security Level. Auto Kill Level should be set to crazy and Security Level to Low. I'm pretty sure it gets everything. Maybe too much, might want to add some apps to the ignore list. Like the clock app, or else your alarm won't work.

As for how it works internally, I have no idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文