-1

好吧,我在我的S6 EDGE上闪烁了一个 debloater 脚本,但我很好奇这些命令是如何工作的,所以我决定寻求一些帮助......

更新脚本

unmount("/system");
unmount("/data");
unmount("/preload");
ui_print(" ");

ui_print("Android 6.0 & 7.0 Debloat Script by Windforce0511");
ui_print("Script version: v1");
ui_print(" ");

ui_print("Mounting partitions: /system /data /cache");
run_program("/sbin/mount", "-t", "auto", "/system");
run_program("/sbin/mount", "-t", "auto", "/data");
run_program("/sbin/mount", "-t", "auto", "/cache");
ui_print("Partitions mounted");
ui_print(" ");

ui_print("Removing bloatware from /system/app");
run_program("/sbin/rm", "-rf", "system/app/AASAservice");
run_program("/sbin/rm", "-rf", "system/app/BluetoothMidiService");
run_program("/sbin/rm", "-rf", "system/app/CloudGateway2017");
run_program("/sbin/rm", "-rf", "system/app/GooglePrintRecommendationService");
run_program("/sbin/rm", "-rf", "system/app/FlipboardBriefing");
run_program("/sbin/rm", "-rf", "system/app/KnoxFolderContainer2");
run_program("/sbin/rm", "-rf", "system/app/KnoxRemoteContentsProvider");
run_program("/sbin/rm", "-rf", "system/app/Photos");
run_program("/sbin/rm", "-rf", "system/app/SBrowser_5.0");
run_program("/sbin/rm", "-rf", "system/app/ShareLink");
run_program("/sbin/rm", "-rf", "system/app/SPrintSpooler7");
run_program("/sbin/rm", "-rf", "system/app/Videos");
run_program("/sbin/rm", "-rf", "system/app/ANTPlusPlugins");
run_program("/sbin/rm", "-rf", "system/app/ANTPlusTest");
run_program("/sbin/rm", "-rf", "system/app/ANTRadioService");
run_program("/sbin/rm", "-rf", "system/app/AdvSoundDetector2015");
run_program("/sbin/rm", "-rf", "system/app/AllShareCastPlayer");
run_program("/sbin/rm", "-rf", "system/app/AllshareFileShare");
#run_program("/sbin/rm", "-rf", "system/app/EasyOneHand3");
run_program("/sbin/rm", "-rf", "system/app/FlipboardBriefingPanel");
run_program("/sbin/rm", "-rf", "system/app/Music2");
run_program("/sbin/rm", "-rf", "system/app/QuickConnect_40");
run_program("/sbin/rm", "-rf", "system/app/BBCAgent");
run_program("/sbin/rm", "-rf", "system/app/SBrowser_4_LATEST");
run_program("/sbin/rm", "-rf", "system/app/ColorBlind_M");
run_program("/sbin/rm", "-rf", "system/app/SecMemo3");
run_program("/sbin/rm", "-rf", "system/app/SimpleSharing");
ui_print("Done!");
ui_print(" ");

ui_print("Removing bloatware from /system/priv-app");
run_program("/sbin/rm", "-rf", "system/priv-app/AutoPreconfig");
run_program("/sbin/rm", "-rf", "system/priv-app/AccessControl_N");
run_program("/sbin/rm", "-rf", "system/priv-app/AutomationTest_FB");
run_program("/sbin/rm", "-rf", "system/priv-app/CallLogBackup");
run_program("/sbin/rm", "-rf", "system/priv-app/AssistantMenu_N");
run_program("/sbin/rm", "-rf", "system/priv-app/AxelSpringer");
run_program("/sbin/rm", "-rf", "system/priv-app/BeaconManager");
run_program("/sbin/rm", "-rf", "system/priv-app/ColorBlind_N");
run_program("/sbin/rm", "-rf", "system/priv-app/EasySetup");
#run_program("/sbin/rm", "-rf", "system/priv-app/GalaxyApps_3xh");
run_program("/sbin/rm", "-rf", "system/priv-app/GalaxyAppsWidget_Phone");
run_program("/sbin/rm", "-rf", "system/priv-app/GameHome");
run_program("/sbin/rm", "-rf", "system/priv-app/GameTools");
run_program("/sbin/rm", "-rf", "system/priv-app/OneDrive_Samsung_v2");
run_program("/sbin/rm", "-rf", "system/priv-app/PreloadInstaller");
#run_program("/sbin/rm", "-rf", "system/priv-app/SamsungAccount_Dream");
run_program("/sbin/rm", "-rf", "system/priv-app/SamsungCloud");
run_program("/sbin/rm", "-rf", "system/priv-app/SamsungMagnifier3");
run_program("/sbin/rm", "-rf", "system/priv-app/SamsungPass_1.1");
run_program("/sbin/rm", "-rf", "system/priv-app/SecEmail_N");
run_program("/sbin/rm", "-rf", "system/priv-app/SecureFolderStub");
run_program("/sbin/rm", "-rf", "system/priv-app/SFinder_v6");
run_program("/sbin/rm", "-rf", "system/priv-app/SNS_v2_N");
run_program("/sbin/rm", "-rf", "system/priv-app/SVoice");
run_program("/sbin/rm", "-rf", "system/priv-app/SvoicePLM");
run_program("/sbin/rm", "-rf", "system/priv-app/VoiceNote_5.0");
run_program("/sbin/rm", "-rf", "system/priv-app/VoiceNote_4.0");
run_program("/sbin/rm", "-rf", "system/priv-app/Fmm");
run_program("/sbin/rm", "-rf", "system/priv-app/FotaAgent");
run_program("/sbin/rm", "-rf", "system/priv-app/GalaxyBeta");
run_program("/sbin/rm", "-rf", "system/priv-app/GearManager");
run_program("/sbin/rm", "-rf", "system/priv-app/GoogleFeedback");
run_program("/sbin/rm", "-rf", "system/priv-app/HwModuleTest");
run_program("/sbin/rm", "-rf", "system/priv-app/ImsLogger+");
run_program("/sbin/rm", "-rf", "system/priv-app/KLMSAgent");
run_program("/sbin/rm", "-rf", "system/priv-app/LiveBroadcast");
run_program("/sbin/rm", "-rf", "system/priv-app/MyPlaces_Hero");
run_program("/sbin/rm", "-rf", "system/priv-app/PhoneErrService");
run_program("/sbin/rm", "-rf", "system/priv-app/PowerPoint_SamsungStub");
run_program("/sbin/rm", "-rf", "system/priv-app/RNB");
run_program("/sbin/rm", "-rf", "system/priv-app/RNBShell");
run_program("/sbin/rm", "-rf", "system/priv-app/sCloudBackupAppMOSUpgrade");
run_program("/sbin/rm", "-rf", "system/priv-app/SCloudService");
run_program("/sbin/rm", "-rf", "system/priv-app/SKSMAgent");
run_program("/sbin/rm", "-rf", "system/priv-app/SNS_v2");
run_program("/sbin/rm", "-rf", "system/priv-app/SOAgent");
run_program("/sbin/rm", "-rf", "system/priv-app/SPDClient");
run_program("/sbin/rm", "-rf", "system/priv-app/SPPPushClient_Prod");
run_program("/sbin/rm", "-rf", "system/priv-app/SVoiceLang_EnglishPack_GB_1.0");
run_program("/sbin/rm", "-rf", "system/priv-app/SVoiceLang_EnglishPack_US_1.0");
run_program("/sbin/rm", "-rf", "system/priv-app/SVoiceLang_FrenchPack_1.0");
ui_print("Done!");
ui_print(" ");

ui_print("Cleaning Cache and Dalvik-cache");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");

ui_print("Unmounting partitions: /system /data /cache");
unmount("/data");
unmount("/cache");
unmount("/system");
ui_print(" ");

ui_print("Enjoy smoothness and much better battery life! :)");
ui_print(" ");
ui_print(" ");

ui_print("You can easily edit script and add character ' # ' to exclude certain APP from deleting.");
ui_print(" ");

ui_print("############################################");

以下是我不明白的事情:

  1. sbin/rm
  2. sbin/安装
  3. 汽车

我检查了手机上的 sbin 目录,但没有 rm 或 mount 文件。所以请任何人详细解释一下,因为我是 Bash 脚本的新手。

4

2 回答 2

2

你不明白的东西可以分为两个命令组,

  1. rm 组
    /sbin/rm -fr静默删除目录和文件
  2. mount group
    /sbin/mount -t auto在自动配置的参数下挂载分区,主要与 mtabfstab

您可以对上面引用的术语进行更多研究

如果你看不到rmandmount文件/sbin,我能想到两种解释

  1. 只有具有有效 root 权限的应用程序才能执行此操作,并且您在扫描时正在查看不具有 root 权限的应用程序/sbin
    生根设备是通过su在特殊目录下放置一个特殊的二进制文件。
    应用程序必须显式调用exec("su")以启动具有 root 权限的进程,
    以便它可以删除系统文件、挂载或卸载分区等。
  2. 您正在chroot环境中查看,真正的 /sbin 在环境之外。
    这不太可能在您的手机上发生,
    它是一种/为进程(及其子进程)重新定位目录的方法。
于 2019-09-20T08:06:58.103 回答
1

好吧,我已经想通了。

使用的脚本语言称为Edify。虽然与 bash 类似,但格式不同,但都调用 Linux 程序来执行任务。如果需要,您可以阅读rmmount的手册(手册)页面。对于任何正在寻找并在其中归档的人rmmount停止sbin寻找它,您将找不到它,即使作为root user


通常,这些天,在 TWRP 中。恢复将挂载一个busybox实现,该实现提供对安装在sbin目录中的基本Linux之类的程序的访问。您必须重新启动以恢复才能访问这些内容。

于 2019-09-20T13:36:53.657 回答