gpt4 book ai didi

android - 脚本运行速度太快了!可能

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:00:17 25 4
gpt4 key购买 nike

我一直在尝试编写一个脚本来强化 android。我没有成功!

我正在通过模拟器运行一个 AVD,并且已经用我加载的 android shell 和 bash shell 试过了。正如您将在下面看到的那样,该脚本很简单,每个命令都可以独立运行,但在脚本中它运行速度太快或其他原因。

我知道顶部没有 shebang,但那是因为我插入一个时出错。

我的脚本是:

echo             ANDROID
echo HARDENING STARTED
device=/dev/block/mtdblock0
mount -o rw,remount $device /system
#removing files in the /system/xbin directory
rm /system/xbin/tcpdump
rm /system/xbin/su
#removing files in the /system/bin directory
rm /system/bin/bootanimation
rm /system/bin/dumpstate
rm /system/bin/ping
rm /system/bin/ping6
echo ANDROID
echo HARDENING COMPLETE

我已经删除了所有缩进,因为我认为这可能会导致错误并且目录和文件确实存在。我已经用了三天了,现在已经很瘦了。

我在开始时有一个 if 语句来选择其他手机上的设备,但我把它去掉以试图减少错误(这就是我声明设备而不是安装的原因)。

这里是错误:

             ANDROID
HARDENING STARTED
mount: no such file or directory exist
, no such file or directorytcpdump
, no such file or directorysu
, no such file or directoryootanimation
, no such file or directoryumpstate
, no such file or directorying
, no such file or directorying6

ANDROID
HARDENING COMPLETED

注意目录后的合并,这不是错字。

谢谢瑞安

最佳答案

您在 Windows 系统上编辑了此文件,它具有 DOS 样式的行尾 (<cr><lf>)。将其转换为使用 Unix 风格的行尾标记 ( <lf> ),它应该可以正常工作。任何体面的程序员编辑器都可以为您完成此操作,或者您也可以 do it using standard command line tools .

顺便说一句,shell 根本不关心缩进。这:

echo Hello
echo world.

等同于:

echo Hello
echo world.

关于android - 脚本运行速度太快了!可能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14359771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com