首页 > 程序 > 小米5miui9稳定版自改官包方法

作者:ghostry 发布时间:2018-02-16 浏览: 16958

转载注明出处: https://blog.ghostry.cn/program/864.html

正在用的小米5系统终于完蛋了,每2秒卡2秒。完全没法用。

所以花了点时间刷刷机。
个人比较倾向稳定版改版,因为需要稳定,要改版是因为miui全家桶很烦人,很臃肿。
系统环境:Ubuntu
首先下载twrp,我用的是ZCX-TWRP_MI5_Gemini-7.0data_20161226。工具我之前的文章里有装。

fastboot flash recovery ZCX-TWR-3.0.2-X-MI5-Gemini-7.0dec_16.12.26.img
fastboot boot ZCX-TWR-3.0.2-X-MI5-Gemini-7.0dec_16.12.26.img

第一句是刷recovery,第二句是临时启动这个。
然后,下载稳定版rom完整包,我用的miui_MI5_V9.2.2.0.NAACNEK_36bbdfed8d_7.0,下载后解包。
里边的system.new.dat是system分区镜像,但是有经过处理。直接是不能挂载的。
需要工具处理后才能挂载

./sdat2img.py system.transfer.list system.new.dat system.img
mount system.img tmp
cp -a tmp/* system/

挂载后复制出来。进行修改,比如删除data-app,在app和priv-app里删除不用的包,注意小米框架小米市场升级这三个如果删了开不了机,想开机需要处理,并且miui9和6不同,jar被分成了odex,想改的话还得多一些处理,懒得弄了,recovery-from-boot.p和rfs也删除。然后我又加入了re文件管理器。apk直接放app目录就行。
我删除了这些

cd /system/app
rm -rf AnalyticsCore AntHalService AppIndexProvider BasicDreams BookmarkProvider btmultisim Calculator CaptivePortalLogin EasterEgg Email embms FileExplorer GameCenter HTMLViewer HybridAccessory HybridPlatform klobugreport KSICibaEngine LiveWallpapersPicker mab MiDrive MiLinkService MiLivetalk MiuiContentCatcher MiuiDaemon MiuiVpnSdkManager MiWallpaper PaymentService PhotoTable PrintRecommendationService PrintSpooler SogouInput Stk SSCMService SystemAdSolution telresources TranslationService uimremoteclient UpnpService UPTsmService UserDictionaryProvider VoiceAssist WallpaperBackup WAPPushManager WfdService WMService XiaomiAccount XMPass
cd ../priv-app
rm -rf Backup BackupRestoreConfirmation Browser Calendar CalendarProvider CallLogBackup CellBroadcastReceiver CloudBackup CloudServiceSysbase CNEService com.qualcomm.location ContentExtension DocumentsUI dpmserviceapp MiDrop MiGameCenterSDKService MiVRFramework MiWebView OneTimeInitializer QuickSearchBox SharedStorageBackup SmartcardService TelephonyExtVodafonePack VirtualSim Weather WeatherProvider

我上面的删除带有很强烈的个人习惯,请勿照搬。
删除META-INF/com/android
修改META-INF/com/google/android/updater-script

ui_print("===========================");
ui_print("本刷机包由Ghostry提供");
ui_print("    blog.ghostry.cn   ");
ui_print("===========================");
getprop("ro.product.device") == "gemini" || abort("E3004: This package is for \"gemini\" devices; this is a \"" + getprop("ro.product.device") + "\".");
unmount("/system");
show_progress(1.000000, 0);
ui_print(" ");
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/cust", "/cust", "max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc");
delete_recursive("/cust");
package_extract_dir("cust", "/cust") || abort("Failed to extract dir from \"cust\" to \"/cust\".");
set_metadata_recursive("/cust", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
ui_print("Formatting system...");
ui_print(" ");
format("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "0", "/system");
set_progress(0.100000);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system");
set_progress(0.200000);
ui_print("Extracting system...");
ui_print(" ");
package_extract_dir("system", "/system");
set_progress(0.500000);
ui_print("Creating symlinks...");
ui_print(" ");
#SYM
symlink("app_process64", "/system/bin/app_process");
symlink("dalvikvm64", "/system/bin/dalvikvm");
symlink("/data/misc/audio/mbhc.bin", "/system/etc/firmware/wcd9320/wcd9320_mbhc.bin");
symlink("/data/misc/audio/wcd9320_anc.bin", "/system/etc/firmware/wcd9320/wcd9320_anc.bin");
symlink("/data/misc/audio/wcd9320_mad_audio.bin", "/system/etc/firmware/wcd9320/wcd9320_mad_audio.bin");
symlink("/data/miui/miuisdk.apk", "/system/framework/miuisdk.jar");
symlink("/data/miui/miuisystem.apk", "/system/framework/miuisystem.jar");
symlink("/data/tombstones/lpass", "/system/rfs/mdm/adsp/ramdumps");
symlink("/data/tombstones/lpass", "/system/rfs/msm/adsp/ramdumps");
symlink("/data/tombstones/modem", "/system/rfs/apq/gnss/ramdumps");
symlink("/data/tombstones/modem", "/system/rfs/mdm/mpss/ramdumps");
symlink("/data/tombstones/modem", "/system/rfs/msm/mpss/ramdumps");
symlink("/data/tombstones/sparrow", "/system/rfs/mdm/sparrow/ramdumps");
symlink("/dev/block/bootdevice/by-name/msadp", "/system/etc/firmware/msadp");
symlink("egl/libEGL_adreno.so", "/system/vendor/lib64/libEGL_adreno.so");
symlink("egl/libEGL_adreno.so", "/system/vendor/lib/libEGL_adreno.so");
symlink("/firmware", "/system/rfs/apq/gnss/readonly/firmware");
symlink("/firmware", "/system/rfs/mdm/adsp/readonly/firmware");
symlink("/firmware", "/system/rfs/mdm/mpss/readonly/firmware");
symlink("/firmware", "/system/rfs/mdm/sparrow/readonly/firmware");
symlink("/firmware", "/system/rfs/msm/adsp/readonly/firmware");
symlink("/firmware", "/system/rfs/msm/mpss/readonly/firmware");
symlink("grep", "/system/bin/egrep");
symlink("grep", "/system/bin/fgrep");
symlink("ip6tables", "/system/bin/ip6tables-restore");
symlink("ip6tables", "/system/bin/ip6tables-save");
symlink("iptables", "/system/bin/iptables-restore");
symlink("iptables", "/system/bin/iptables-save");
symlink("/persist/hlos_rfs/shared", "/system/rfs/apq/gnss/hlos");
symlink("/persist/hlos_rfs/shared", "/system/rfs/mdm/adsp/hlos");
symlink("/persist/hlos_rfs/shared", "/system/rfs/mdm/mpss/hlos");
symlink("/persist/hlos_rfs/shared", "/system/rfs/mdm/sparrow/hlos");
symlink("/persist/hlos_rfs/shared", "/system/rfs/msm/adsp/hlos");
symlink("/persist/hlos_rfs/shared", "/system/rfs/msm/mpss/hlos");
symlink("/persist/rfs/apq/gnss", "/system/rfs/apq/gnss/readwrite");
symlink("/persist/rfs/mdm/adsp", "/system/rfs/mdm/adsp/readwrite");
symlink("/persist/rfs/mdm/mpss", "/system/rfs/mdm/mpss/readwrite");
symlink("/persist/rfs/mdm/sparrow", "/system/rfs/mdm/sparrow/readwrite");
symlink("/persist/rfs/msm/adsp", "/system/rfs/msm/adsp/readwrite");
symlink("/persist/rfs/msm/mpss", "/system/rfs/msm/mpss/readwrite");
symlink("/persist/rfs/shared", "/system/rfs/apq/gnss/shared");
symlink("/persist/rfs/shared", "/system/rfs/mdm/adsp/shared");
symlink("/persist/rfs/shared", "/system/rfs/mdm/mpss/shared");
symlink("/persist/rfs/shared", "/system/rfs/mdm/sparrow/shared");
symlink("/persist/rfs/shared", "/system/rfs/msm/adsp/shared");
symlink("/persist/rfs/shared", "/system/rfs/msm/mpss/shared");
symlink("/persist/wlan_mac.bin", "/system/etc/firmware/wlan/qca_cld/wlan_mac.bin");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("/system/etc/wifi/WCNSS_qcom_cfg.ini", "/system/etc/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini");
symlink("/system/lib/libsystem.so", "/system/priv-app/MiuiVpnSdkManager/lib/arm/libsystem.so");
symlink("/system/lib/libsystem.so", "/system/app/MiuiVpnSdkManager/lib/arm/libsystem.so");
symlink("/system/lib/libgamemaster.so", "/system/app/MiuiVpnSdkManager/lib/arm/libgamemaster.so");
symlink("/system/lib64/libmtk_serialnum.so", "/system/app/Updater/lib/arm64/libmtk_serialnum.so");
symlink("/system/lib64/libmiui_didi_secure.so", "/system/priv-app/SecurityAdd/lib/arm64/libmiui_didi_secure.so");
symlink("/system/lib/libgifimage.so", "/system/app/HybridPlatform/lib/arm/libgifimage.so");
symlink("/system/lib/libimagepipeline.so", "/system/app/HybridPlatform/lib/arm/libimagepipeline.so");
symlink("/system/lib/libj2v8.so", "/system/app/HybridPlatform/lib/arm/libj2v8.so");
symlink("/system/lib/libfb.so", "/system/app/HybridPlatform/lib/arm/libfb.so");
symlink("/system/lib/libyoga.so", "/system/app/HybridPlatform/lib/arm/libyoga.so");
symlink("/system/lib64/libamaploc.so", "/system/app/MetokNLP/lib/arm64/libamaploc.so");
symlink("/system/lib64/libjni_metok.so", "/system/app/MetokNLP/lib/arm64/libjni_metok.so");
symlink("/system/lib64/libmiui_locSDK_2_5OEM.so", "/system/app/MetokNLP/lib/arm64/libmiui_locSDK_2_5OEM.so");
symlink("/system/lib64/libmiui_apssdk.so", "/system/app/MetokNLP/lib/arm64/libmiui_apssdk.so");
symlink("/system/lib64/liblocSDK_2_5OEMXXX.so", "/system/app/MetokNLP/lib/arm64/liblocSDK_2_5OEMXXX.so");
symlink("/system/lib64/libtencentloc.so", "/system/app/MetokNLP/lib/arm64/libtencentloc.so");
symlink("/system/lib64/libappfuse_jni.so", "/system/priv-app/MtpDocumentsProvider/lib/arm64/libappfuse_jni.so");
symlink("/system/lib64/libapssdk.so", "/system/app/AMAPNetworkLocation/lib/arm64/libapssdk.so");
symlink("/system/lib64/libdefcontainer_jni.so", "/system/priv-app/DefaultContainerService/lib/arm64/libdefcontainer_jni.so");
symlink("/system/lib64/libDexHelper.so", "/system/priv-app/MiuiGallery/lib/arm64/libDexHelper.so");
symlink("/system/lib64/libdiag_jni.so", "/system/app/Cit/lib/arm64/libdiag_jni.so");
symlink("/system/lib64/libdidi_secure.so", "/system/priv-app/YellowPage/lib/arm64/libdidi_secure.so");
symlink("/system/lib64/libgenius_blur.so", "/system/app/FileExplorer/lib/arm64/libgenius_blur.so");
symlink("/system/lib64/libhw_instanttrans.so", "/system/priv-app/MiuiScanner/lib/arm64/libhw_instanttrans.so");
symlink("/system/lib64/libhwocr_cntools_shared.so", "/system/priv-app/MiuiScanner/lib/arm64/libhwocr_cntools_shared.so");
symlink("/system/lib64/libjni_pacprocessor.so", "/system/app/PacProcessor/lib/arm64/libjni_pacprocessor.so");
symlink("/system/lib64/libklobugreport_jni.so", "/system/app/klobugreport/lib/arm64/libklobugreport_jni.so");
symlink("/system/lib64/libmiuiclassproxy.so", "/system/app/miui/lib/arm64/libmiuiclassproxy.so");
symlink("/system/lib64/libmiuidiffpatcher.so", "/system/app/miui/lib/arm64/libmiuidiffpatcher.so");
symlink("/system/lib64/libMiuiGalleryNSGIF.so", "/system/priv-app/MiuiGallery/lib/arm64/libMiuiGalleryNSGIF.so");
symlink("/system/lib64/libmiuiimageutilities.so", "/system/app/miui/lib/arm64/libmiuiimageutilities.so");
symlink("/system/lib64/libmiuinative.so", "/system/app/miui/lib/arm64/libmiuinative.so");
symlink("/system/lib64/libmiupdate.so", "/system/app/Calculator/lib/arm64/libmiupdate.so");
symlink("/system/lib64/libmivrnative.so", "/system/priv-app/MiVRFramework/lib/arm64/libmivrnative.so");
symlink("/system/lib64/libnexcralbody_mc_jb.so", "/system/priv-app/MiuiGallery/lib/arm64/libnexcralbody_mc_jb.so");
symlink("/system/lib64/libnexeditorsdk.so", "/system/priv-app/MiuiGallery/lib/arm64/libnexeditorsdk.so");
symlink("/system/lib64/libnexralbody_audio.so", "/system/priv-app/MiuiGallery/lib/arm64/libnexralbody_audio.so");
symlink("/system/lib64/libskin_beautifier.so", "/system/priv-app/MiuiGallery/lib/arm64/libskin_beautifier.so");
symlink("/system/lib64/libnfc_nci_jni.so", "/system/app/NfcNci/lib/arm64/libnfc_nci_jni.so");
symlink("/system/lib64/libMiuiScreenRecord.so", "/system/app/MiuiScreenRecorder/lib/arm64/libMiuiScreenRecord.so");
symlink("/system/lib64/libpatcher_jni.so", "/system/app/MiuiSuperMarket/lib/arm64/libpatcher_jni.so");
symlink("/system/lib64/libPinguoImageSDK.so", "/system/priv-app/MiuiGallery/lib/arm64/libPinguoImageSDK.so");
symlink("/system/lib64/libpowerkeeper_jni.so", "/system/app/PowerKeeper/lib/arm64/libpowerkeeper_jni.so");
symlink("/system/lib64/libprintspooler_jni.so", "/system/app/PrintSpooler/lib/arm64/libprintspooler_jni.so");
symlink("/system/lib64/libQuadrangleRecognizer.so", "/system/priv-app/MiuiScanner/lib/arm64/libQuadrangleRecognizer.so");
symlink("/system/lib64/libsgmain.so", "/system/priv-app/MiuiScanner/lib/arm64/libsgmain.so");
symlink("/system/lib64/libtasft_jni.so", "/system/app/Cit/lib/arm64/libtasft_jni.so");
symlink("/system/lib64/libtbdecode.so", "/system/priv-app/MiuiScanner/lib/arm64/libtbdecode.so");
symlink("/system/lib64/libttscompat.so", "/system/app/PicoTts/lib/arm64/libttscompat.so");
symlink("/system/lib64/libttspico.so", "/system/app/PicoTts/lib/arm64/libttspico.so");
symlink("/system/lib64/libttscompat.so", "/system/priv-app/PicoTts/lib/arm64/libttscompat.so");
symlink("/system/lib64/libttspico.so", "/system/priv-app/PicoTts/lib/arm64/libttspico.so");
symlink("/system/lib64/libuptsmaddon.so", "/system/app/TSMClient/lib/arm64/libuptsmaddon.so");
symlink("/system/lib64/libwenba.so", "/system/priv-app/MiuiScanner/lib/arm64/libwenba.so");
symlink("/system/lib64/libwrapnexpcmcalbody.so", "/system/priv-app/MiuiGallery/lib/arm64/libwrapnexpcmcalbody.so");
symlink("/system/lib64/libxmpass_sdk_patcher.so", "/system/app/XMPass/lib/arm64/libxmpass_sdk_patcher.so");
symlink("/system/lib64/xmpass_libweibosdkcore.so", "/system/app/XMPass/lib/arm64/xmpass_libweibosdkcore.so");
symlink("/system/lib64/libsim-activate-root-checker.so", "/system/app/XiaomiSimActivateService/lib/arm64/libsim-activate-root-checker.so");
symlink("/system/lib/libbluetooth_jni.so", "/system/app/Bluetooth/lib/arm/libbluetooth_jni.so");
symlink("/system/lib/libdce-1.1.9-mfr.so", "/system/priv-app/CleanMaster/lib/arm/libdce-1.1.9-mfr.so");
symlink("/system/lib/libdce-1.1.16-mfr.so", "/system/priv-app/CleanMaster/lib/arm/libdce-1.1.16-mfr.so");
symlink("/system/lib/libdce-1.1.14-mfr.so", "/system/priv-app/CleanMaster/lib/arm/libdce-1.1.14-mfr.so");
symlink("/system/lib/libdce-1.1.15-mfr.so", "/system/priv-app/CleanMaster/lib/arm/libdce-1.1.15-mfr.so");
symlink("/system/lib/libImageSearchAPI.so", "/system/priv-app/CleanMaster/lib/arm/libImageSearchAPI.so");
symlink("/system/lib/libDecRes_sdk.so", "/system/priv-app/MiuiVideo/lib/arm/libDecRes_sdk.so");
symlink("/system/lib/libDToken.so", "/system/app/mab/lib/arm/libDToken.so");
symlink("/system/lib/libentryexpro.so", "/system/app/mab/lib/arm/libentryexpro.so");
symlink("/system/lib/libkcmutilex.so", "/system/priv-app/CleanMaster/lib/arm/libkcmutilex.so");
symlink("/system/lib/libkcmutil.so", "/system/priv-app/CleanMaster/lib/arm/libkcmutil.so");
symlink("/system/lib/libminivenus.so", "/system/priv-app/MiuiVideo/lib/arm/libminivenus.so");
symlink("/system/lib/lib_miui_arch_indicate.so", "/system/priv-app/QuickSearchBox/lib/arm/lib_miui_arch_indicate.so");
symlink("/system/lib/libmresearch.so", "/system/priv-app/MiuiVideo/lib/arm/libmresearch.so");
symlink("/system/lib/libNative.so", "/system/app/mab/lib/arm/libNative.so");
symlink("/system/lib/libpl_droidsonroids_gif.so", "/system/priv-app/QuickSearchBox/lib/arm/libpl_droidsonroids_gif.so");
symlink("/system/lib/lib_qsb_miui_arch_indicate.so", "/system/priv-app/QuickSearchBox/lib/arm/lib_qsb_miui_arch_indicate.so");
symlink("/system/lib/lib_qsb_pl_droidsonroids_gif.so", "/system/priv-app/QuickSearchBox/lib/arm/lib_qsb_pl_droidsonroids_gif.so");
symlink("/system/lib/libsecurities_sdk.so", "/system/priv-app/MiuiVideo/lib/arm/libsecurities_sdk.so");
symlink("/system/lib/libsecuritysdk-3.1.27.so", "/system/app/mab/lib/arm/libsecuritysdk-3.1.27.so");
symlink("/system/lib/libShopSigned.so", "/system/app/mab/lib/arm/libShopSigned.so");
symlink("/system/lib/libsic_helper.so", "/system/priv-app/CleanMaster/lib/arm/libsic_helper.so");
symlink("/system/lib/libspaces_jni.so", "/system/priv-app/SpacesManagerService/lib/arm/libspaces_jni.so");
symlink("/system/lib64/libsim-activate-root-checker.so", "/system/app/XiaomiSimActivateService/lib/arm64/libsim-activate-root-checker.so");
symlink("/system/lib/libTmsdk-2.0.9-mfr.so", "/system/priv-app/CleanMaster/lib/arm/libTmsdk-2.0.9-mfr.so");
symlink("/system/lib/libTmsdk-2.0.10-mfr.so", "/system/priv-app/CleanMaster/lib/arm/libTmsdk-2.0.10-mfr.so");
symlink("/system/lib/libwebp.so", "/system/app/SogouInput/lib/arm/libwebp.so");
symlink("/system/lib/libweibosdkcore_sogou.so", "/system/app/SogouInput/lib/arm/libweibosdkcore_sogou.so");
symlink("/system/lib/modules/qca_cld/qca_cld_wlan.ko", "/system/lib/modules/wlan.ko");
symlink("/system/vendor/lib64/libimscamera_jni.so", "/system/vendor/app/ims/lib/arm64/libimscamera_jni.so");
symlink("/system/vendor/lib64/libimsmedia_jni.so", "/system/vendor/app/ims/lib/arm64/libimsmedia_jni.so");
symlink("toolbox", "/system/bin/dd");
symlink("toolbox", "/system/bin/getevent");
symlink("toolbox", "/system/bin/iftop");
symlink("toolbox", "/system/bin/ioctl");
symlink("toolbox", "/system/bin/log");
symlink("toolbox", "/system/bin/nandread");
symlink("toolbox", "/system/bin/newfs_msdos");
symlink("toolbox", "/system/bin/prlimit");
symlink("toolbox", "/system/bin/ps");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/start");
symlink("toolbox", "/system/bin/stop");
symlink("toolbox", "/system/bin/top");
symlink("toybox", "/system/bin/acpi");
symlink("toybox", "/system/bin/base64");
symlink("toybox", "/system/bin/basename");
symlink("toybox", "/system/bin/blockdev");
symlink("toybox", "/system/bin/bzcat");
symlink("toybox", "/system/bin/cal");
symlink("toybox", "/system/bin/cat");
symlink("toybox", "/system/bin/chcon");
symlink("toybox", "/system/bin/chgrp");
symlink("toybox", "/system/bin/chmod");
symlink("toybox", "/system/bin/chown");
symlink("toybox", "/system/bin/chroot");
symlink("toybox", "/system/bin/cksum");
symlink("toybox", "/system/bin/clear");
symlink("toybox", "/system/bin/cmp");
symlink("toybox", "/system/bin/comm");
symlink("toybox", "/system/bin/cp");
symlink("toybox", "/system/bin/cpio");
symlink("toybox", "/system/bin/cut");
symlink("toybox", "/system/bin/date");
symlink("toybox", "/system/bin/df");
symlink("toybox", "/system/bin/dirname");
symlink("toybox", "/system/bin/dmesg");
symlink("toybox", "/system/bin/dos2unix");
symlink("toybox", "/system/bin/du");
symlink("toybox", "/system/bin/echo");
symlink("toybox", "/system/bin/env");
symlink("toybox", "/system/bin/expand");
symlink("toybox", "/system/bin/expr");
symlink("toybox", "/system/bin/fallocate");
symlink("toybox", "/system/bin/false");
symlink("toybox", "/system/bin/find");
symlink("toybox", "/system/bin/flock");
symlink("toybox", "/system/bin/free");
symlink("toybox", "/system/bin/getenforce");
symlink("toybox", "/system/bin/getprop");
symlink("toybox", "/system/bin/groups");
symlink("toybox", "/system/bin/head");
symlink("toybox", "/system/bin/hostname");
symlink("toybox", "/system/bin/hwclock");
symlink("toybox", "/system/bin/id");
symlink("toybox", "/system/bin/ifconfig");
symlink("toybox", "/system/bin/inotifyd");
symlink("toybox", "/system/bin/insmod");
symlink("toybox", "/system/bin/ionice");
symlink("toybox", "/system/bin/iorenice");
symlink("toybox", "/system/bin/kill");
symlink("toybox", "/system/bin/killall");
symlink("toybox", "/system/bin/ln");
symlink("toybox", "/system/bin/load_policy");
symlink("toybox", "/system/bin/logname");
symlink("toybox", "/system/bin/losetup");
symlink("toybox", "/system/bin/ls");
symlink("toybox", "/system/bin/lsmod");
symlink("toybox", "/system/bin/lsof");
symlink("toybox", "/system/bin/lsusb");
symlink("toybox", "/system/bin/md5sum");
symlink("toybox", "/system/bin/mkdir");
symlink("toybox", "/system/bin/mknod");
symlink("toybox", "/system/bin/mkswap");
symlink("toybox", "/system/bin/mktemp");
symlink("toybox", "/system/bin/modinfo");
symlink("toybox", "/system/bin/more");
symlink("toybox", "/system/bin/mount");
symlink("toybox", "/system/bin/mountpoint");
symlink("toybox", "/system/bin/mv");
symlink("toybox", "/system/bin/netstat");
symlink("toybox", "/system/bin/nice");
symlink("toybox", "/system/bin/nl");
symlink("toybox", "/system/bin/nohup");
symlink("toybox", "/system/bin/od");
symlink("toybox", "/system/bin/paste");
symlink("toybox", "/system/bin/patch");
symlink("toybox", "/system/bin/pgrep");
symlink("toybox", "/system/bin/pidof");
symlink("toybox", "/system/bin/pkill");
symlink("toybox", "/system/bin/pmap");
symlink("toybox", "/system/bin/printenv");
symlink("toybox", "/system/bin/printf");
symlink("toybox", "/system/bin/pwd");
symlink("toybox", "/system/bin/readlink");
symlink("toybox", "/system/bin/realpath");
symlink("toybox", "/system/bin/renice");
symlink("toybox", "/system/bin/restorecon");
symlink("toybox", "/system/bin/rm");
symlink("toybox", "/system/bin/rmdir");
symlink("toybox", "/system/bin/rmmod");
symlink("toybox", "/system/bin/route");
symlink("toybox", "/system/bin/runcon");
symlink("toybox", "/system/bin/sed");
symlink("toybox", "/system/bin/seq");
symlink("toybox", "/system/bin/setenforce");
symlink("toybox", "/system/bin/setprop");
symlink("toybox", "/system/bin/setsid");
symlink("toybox", "/system/bin/sha1sum");
symlink("toybox", "/system/bin/sleep");
symlink("toybox", "/system/bin/sort");
symlink("toybox", "/system/bin/split");
symlink("toybox", "/system/bin/stat");
symlink("toybox", "/system/bin/strings");
symlink("toybox", "/system/bin/swapoff");
symlink("toybox", "/system/bin/swapon");
symlink("toybox", "/system/bin/sync");
symlink("toybox", "/system/bin/sysctl");
symlink("toybox", "/system/bin/tac");
symlink("toybox", "/system/bin/tail");
symlink("toybox", "/system/bin/tar");
symlink("toybox", "/system/bin/taskset");
symlink("toybox", "/system/bin/tee");
symlink("toybox", "/system/bin/time");
symlink("toybox", "/system/bin/timeout");
symlink("toybox", "/system/bin/touch");
symlink("toybox", "/system/bin/tr");
symlink("toybox", "/system/bin/true");
symlink("toybox", "/system/bin/truncate");
symlink("toybox", "/system/bin/tty");
symlink("toybox", "/system/bin/ulimit");
symlink("toybox", "/system/bin/umount");
symlink("toybox", "/system/bin/uname");
symlink("toybox", "/system/bin/uniq");
symlink("toybox", "/system/bin/unix2dos");
symlink("toybox", "/system/bin/uptime");
symlink("toybox", "/system/bin/usleep");
symlink("toybox", "/system/bin/vmstat");
symlink("toybox", "/system/bin/wc");
symlink("toybox", "/system/bin/which");
symlink("toybox", "/system/bin/whoami");
symlink("toybox", "/system/bin/xargs");
symlink("toybox", "/system/bin/xxd");
symlink("toybox", "/system/bin/yes");
symlink("../ui/MessageComplete.ogg", "/system/media/audio/notifications/MessageComplete.ogg");
symlink("../ui/MessageIncoming.ogg", "/system/media/audio/notifications/MessageIncoming.ogg");
set_progress(0.600000);
ui_print("Setting Permissions...");
ui_print(" ");
#PERM
set_metadata_recursive("/system", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/display_count", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:display_count_exec:s0");
set_metadata("/system/bin/PktRspTest", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:diag_exec:s0");
set_metadata("/system/bin/StoreKeybox", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sectest_exec:s0");
set_metadata("/system/bin/adsprpcd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:adsprpcd_exec:s0");
set_metadata("/system/bin/app_process32", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/app_process64", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/audiod", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:audiod_exec:s0");
set_metadata("/system/bin/blkid", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:blkid_exec:s0");
set_metadata("/system/bin/bootanimation", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:bootanim_exec:s0");
set_metadata("/system/bin/bugreport", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/clatd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:clatd_exec:s0");
set_metadata("/system/bin/cnd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:cnd_exec:s0");
set_metadata("/system/bin/debuggerd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
set_metadata("/system/bin/debuggerd64", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
set_metadata("/system/bin/dex2oat", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dex2oat_exec:s0");
set_metadata("/system/bin/diag_dci_sample", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:diag_exec:s0");
set_metadata("/system/bin/diag_klog", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:diag_exec:s0");
set_metadata("/system/bin/diag_mdlog", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:qlogd_exec:s0");
set_metadata("/system/bin/diag_socket_log", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:diag_exec:s0");
set_metadata("/system/bin/diag_uart_log", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:diag_exec:s0");
set_metadata("/system/bin/dnsmasq", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dnsmasq_exec:s0");
set_metadata("/system/bin/dpmd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dpmd_exec:s0");
set_metadata("/system/bin/drmserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:drmserver_exec:s0");
set_metadata("/system/bin/dumpstate", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dumpstate_exec:s0");
set_metadata("/system/bin/dumpsys", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/dun-server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dun-server_exec:s0");
set_metadata("/system/bin/e2fsck", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:fsck_exec:s0");
set_metadata("/system/bin/fidoca", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:fidoca_daemon_exec:s0");
set_metadata("/system/bin/fingerprintd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:fingerprintd_exec:s0");
set_metadata("/system/bin/fsck.f2fs", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:fsck_exec:s0");
set_metadata("/system/bin/fsck_msdos", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:fsck_exec:s0");
set_metadata("/system/bin/garden_app", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/bin/gatekeeperd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:gatekeeperd_exec:s0");
set_metadata("/system/bin/gpsone_daemon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/bin/gpu_monitor", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:gpumonitor_exec:s0");
set_metadata("/system/bin/hostapd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:hostapd_exec:s0");
set_metadata("/system/bin/hostapd_cli", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:hostapd_exec:s0");
set_metadata("/system/bin/hvdcp_opti", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:hvdcp_exec:s0");
set_metadata("/system/bin/ims_rtp_daemon", "uid", 1000, "gid", 1001, "mode", 0755, "capabilities", 0x400, "selabel", "u:object_r:ims_exec:s0");
set_metadata("/system/bin/imscmservice", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:imscm_exec:s0");
set_metadata("/system/bin/imsdatadaemon", "uid", 1000, "gid", 1000, "mode", 0755, "capabilities", 0x400, "selabel", "u:object_r:ims_exec:s0");
set_metadata("/system/bin/imsqmidaemon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ims_exec:s0");
set_metadata("/system/bin/install-recovery.sh", "uid", 0, "gid", 0, "mode", 0750, "capabilities", 0x0, "selabel", "u:object_r:install_recovery_exec:s0");
set_metadata("/system/bin/installd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:installd_exec:s0");
set_metadata("/system/bin/iptables", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/ip6tables", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/ipacm-diag", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ipacm-diag_exec:s0");
set_metadata("/system/bin/ipacm", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ipacm_exec:s0");
set_metadata("/system/bin/irsc_util", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:irsc_util_exec:s0");
set_metadata("/system/bin/iw", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/iwlist", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/iwpriv", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/keystore", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:keystore_exec:s0");
set_metadata("/system/bin/ks", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdm_helper_exec:s0");
set_metadata("/system/bin/lmkd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:lmkd_exec:s0");
set_metadata("/system/bin/loc_launcher", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/bin/logcat", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:logcat_exec:s0");
set_metadata("/system/bin/logd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:logd_exec:s0");
set_metadata("/system/bin/logwrapper", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/make_ext4fs", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/mdm_helper", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdm_helper_exec:s0");
set_metadata("/system/bin/mdm_helper_proxy", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdm_helper_exec:s0");
set_metadata("/system/bin/mdnsd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mdnsd_exec:s0");
set_metadata("/system/bin/mediaserver", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mediaserver_exec:s0");
set_metadata("/system/bin/mm-qcamera-daemon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mm-qcamerad_exec:s0");
set_metadata("/system/bin/mmi", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mmi_exec:s0");
set_metadata("/system/bin/msm_irqbalance", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:msm_irqbalanced_exec:s0");
set_metadata("/system/bin/mtpd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:mtp_exec:s0");
set_metadata("/system/bin/ndc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/netd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:netd_exec:s0");
set_metadata("/system/bin/netmgrd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:netmgrd_exec:s0");
set_metadata("/system/bin/patchoat", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:dex2oat_exec:s0");
set_metadata("/system/bin/ping", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/pm-proxy", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:per_mgr_exec:s0");
set_metadata("/system/bin/pm-service", "uid", 1000, "gid", 1000, "mode", 0755, "capabilities", 0x400, "selabel", "u:object_r:per_mgr_exec:s0");
set_metadata("/system/bin/port-bridge", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:port-bridge_exec:s0");
set_metadata("/system/bin/pppd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ppp_exec:s0");
set_metadata("/system/bin/qseecom_sample_client", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sectest_exec:s0");
set_metadata("/system/bin/qseecom_security_test", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sectest_exec:s0");
set_metadata("/system/bin/qseecomd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tee_exec:s0");
set_metadata("/system/bin/racoon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:racoon_exec:s0");
set_metadata("/system/bin/rild", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:rild_exec:s0");
set_metadata("/system/bin/rmt_storage", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:rmt_storage_exec:s0");
set_metadata("/system/bin/run-as", "uid", 0, "gid", 2000, "mode", 0750, "capabilities", 0xc0, "selabel", "u:object_r:runas_exec:s0");
set_metadata("/system/bin/sdcard", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sdcardd_exec:s0");
set_metadata("/system/bin/sensors.qcom", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sensors_exec:s0");
set_metadata("/system/bin/servicemanager", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:servicemanager_exec:s0");
set_metadata("/system/bin/sgdisk", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:sgdisk_exec:s0");
set_metadata("/system/bin/sh", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:shell_exec:s0");
set_metadata("/system/bin/ssr_diag", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ssr_diag_exec:s0");
set_metadata("/system/bin/ssr_setup", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:ssr_setup_exec:s0");
set_metadata("/system/bin/subsystem_ramdump", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:subsystem_ramdump_exec:s0");
set_metadata("/system/bin/surfaceflinger", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:surfaceflinger_exec:s0");
set_metadata("/system/bin/tbaseLoader", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tbaseLoader_exec:s0");
set_metadata("/system/bin/tc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/test_diag", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:diag_exec:s0");
set_metadata("/system/bin/tftp_server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:rfs_access_exec:s0");
set_metadata("/system/bin/time_daemon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:time_daemon_exec:s0");
set_metadata("/system/bin/toolbox", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:toolbox_exec:s0");
set_metadata("/system/bin/toybox", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:toolbox_exec:s0");
set_metadata("/system/bin/tune2fs", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:fsck_exec:s0");
set_metadata("/system/bin/tzdatacheck", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:tzdatacheck_exec:s0");
set_metadata("/system/bin/uncrypt", "uid", 0, "gid", 0, "mode", 0750, "capabilities", 0x0, "selabel", "u:object_r:uncrypt_exec:s0");
set_metadata("/system/bin/vdc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:vdc_exec:s0");
set_metadata("/system/bin/vold", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:vold_exec:s0");
set_metadata("/system/bin/wpa_supplicant", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wpa_exec:s0");
set_metadata("/system/bin/lowi-server", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/bin/qseer2fdaemon", "selabel", "u:object_r:r2f_daemon_exec:s0");
set_metadata("/system/bin/xtwifi-client", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/bin/xtwifi-inet-agent", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/etc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/bluetooth", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/bluetooth/bt_did.conf", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/bluetooth/bt_stack.conf", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/recovery-from-boot.p", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0);
set_metadata("/system/etc/event-log-tags", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/firmware", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/firmware/wlan", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/hostapd", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/hostapd/hostapd_default.conf", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/init.qcom.sdio.sh", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/permissions", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/ppp", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0555, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/security", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/security/cacerts", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/lib", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/bin/perfd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:perfd_exec:s0");
set_metadata("/system/vendor/bin/qti", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:qti_exec:s0");
set_metadata("/system/vendor/bin/slim_daemon", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/vendor/bin/thermal-engine", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:thermal-engine_exec:s0");
set_metadata("/system/vendor/etc", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/etc/audio_effects.conf", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/etc/msm_irqbalance.conf", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/firmware", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/egl", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/firmware", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib/hw", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/hw/flp.default.so", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib64/hw/flp.default.so", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib/mediadrm", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/mediadrm/libdrmclearkeyplugin.so", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib/qcdrm", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib/qcdrm/playready", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/qcdrm/playready/lib", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/lib/qcdrm/playready/lib/drm", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/qcdrm/playready/lib/drm/libdrmprplugin_customer.so", "uid", 0, "gid", 0, "mode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/qcdrm/playready/lib/mediadrm", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/rfsa", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/rfsa/adsp", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/vendor/lib/soundfx", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/xbin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/busybox", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/tcpdump", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/athdiag", "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/atrace", "selabel", "u:object_r:atrace_exec:s0");
set_metadata("/system/bin/audioserver", "selabel", "u:object_r:audioserver_exec:s0");
set_metadata("/system/bin/bootstat", "selabel", "u:object_r:bootstat_exec:s0");
set_metadata("/system/bin/btnvtool", "selabel", "u:object_r:btnvtool_exec:s0");
set_metadata("/system/bin/cameraserver", "selabel", "u:object_r:cameraserver_exec:s0");
set_metadata("/system/bin/cnss-daemon", "uid", 1000, "gid", 1000, "mode", 0755, "capabilities", 0x400, "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/cnss_diag", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/displayfeature", "selabel", "u:object_r:displayfeature_exec:s0");
set_metadata("/system/bin/DR_AP_Service", "selabel", "u:object_r:location_exec:s0");
set_metadata("/system/bin/energy-awareness", "selabel", "u:object_r:energyawareness_exec:s0");
set_metadata("/system/bin/exfatfsck", "selabel", "u:object_r:fsck_exec:s0");
set_metadata("/system/bin/fdpp", "selabel", "u:object_r:fdpp_exec:s0");
set_metadata("/system/bin/fmhal_service", "selabel", "u:object_r:fmhal_service_exec:s0");
set_metadata("/system/bin/fstman", "selabel", "u:object_r:fstman_exec:s0");
set_metadata("/system/bin/hal_proxy_daemon", "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/hs20-osu-client", "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/idmap", "selabel", "u:object_r:idmap_exec:s0");
set_metadata("/system/bin/iop", "selabel", "u:object_r:dumpstate_exec:s0");
set_metadata("/system/bin/iperf", "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/irtest", "selabel", "u:object_r:irsc_util_exec:s0");
set_metadata("/system/bin/iwconfig", "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/mcd", "selabel", "u:object_r:mcd_exec:s0");
set_metadata("/system/bin/mediacodec", "selabel", "u:object_r:mediacodec_exec:s0");
set_metadata("/system/bin/mediadrmserver", "selabel", "u:object_r:mediadrmserver_exec:s0");
set_metadata("/system/bin/mediaextractor", "selabel", "u:object_r:mediaextractor_exec:s0");
set_metadata("/system/bin/mlipayd", "selabel", "u:object_r:mlipay_daemon_exec:s0");
set_metadata("/system/bin/mmbn-daemon", "selabel", "u:object_r:mmbn-daemon_exec:s0");
set_metadata("/system/bin/mtd", "selabel", "u:object_r:mt_daemon_exec:s0");
set_metadata("/system/bin/namespaceInit", "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/nv_fem", "selabel", "u:object_r:nv_fem_exec:s0");
set_metadata("/system/bin/nv_mac", "selabel", "u:object_r:nv_mac_exec:s0");
set_metadata("/system/bin/pktlogconf", "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/profman", "selabel", "u:object_r:profman_exec:s0");
set_metadata("/system/bin/qcom-system-daemon", "selabel", "u:object_r:qcomsysd_exec:s0");
set_metadata("/system/bin/qfp-daemon", "selabel", "u:object_r:qfp-daemon_exec:s0");
set_metadata("/system/bin/qvop-daemon", "selabel", "u:object_r:qvop_exec:s0");
set_metadata("/system/bin/qseer2fdaemon", "selabel", "u:object_r:r2f_daemon_exec:s0");
set_metadata("/system/bin/resize2fs", "selabel", "u:object_r:resize_exec:s0");
set_metadata("/system/bin/secure_ui_sample_client", "selabel", "u:object_r:sectest_exec:s0");
set_metadata("/system/bin/seempd", "selabel", "u:object_r:seempd_exec:s0");
set_metadata("/system/bin/sigma_dut", "selabel", "u:object_r:wcnss_service_exec:s0");
set_metadata("/system/bin/smonsir", "selabel", "u:object_r:smonsir_exec:s0");
set_metadata("/system/bin/smprosrv", "selabel", "u:object_r:smprosrv_exec:s0");
set_metadata("/system/bin/ssServices", "selabel", "u:object_r:zygote_exec:s0");
set_metadata("/system/bin/usf_proximity", "selabel", "u:object_r:usf_exec:s0");
set_metadata("/system/bin/usf_tester", "selabel", "u:object_r:usf_exec:s0");
set_metadata("/system/bin/vsimd", "selabel", "u:object_r:vsim_daemon_exec:s0");
set_metadata("/system/bin/wcnss_filter", "uid", 1002, "gid", 1002, "mode", 0755, "capabilities", 0x1000000000, "selabel", "u:object_r:wcnss_filter_exec:s0");
set_metadata("/system/bin/wfdservice", "selabel", "u:object_r:wfdservice_exec:s0");
set_metadata("/system/vendor/bin/mm-pp-dpps", "selabel", "u:object_r:mm-pp-daemon_exec:s0");
set_metadata("/system/vendor/bin/pd-mapper", "selabel", "u:object_r:pd_mapper_exec:s0");
set_metadata("/system/vendor/bin/qpaydaemon", "selabel", "u:object_r:qpay_exec:s0");
set_metadata("/system/vendor/bin/qseeproxydaemon", "selabel", "u:object_r:qseeproxy_exec:s0");
set_metadata("/system/vendor/bin/qseeproxysampledaemon", "selabel", "u:object_r:qseeproxysample_exec:s0");
set_metadata("/system/xbin/mqsasd", "selabel", "u:object_r:mqsasd_exec:s0");
set_metadata("/system/xbin/shelld", "selabel", "u:object_r:shelld_exec:s0");
set_progress(0.700000);
ui_print(" ");
ui_print("Extracting boot image...");
ui_print(" ");
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
set_progress(0.800000);
ui_print("Patching firmware images...");
package_extract_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64");
package_extract_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlib");
package_extract_file("firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hyp");
package_extract_file("firmware-update/pmic.elf", "/dev/block/bootdevice/by-name/pmic");
package_extract_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tz");
package_extract_file("firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/aboot");
package_extract_file("firmware-update/lksecapp.mbn", "/dev/block/bootdevice/by-name/lksecapp");
package_extract_file("firmware-update/devcfg.mbn", "/dev/block/bootdevice/by-name/devcfg");
package_extract_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymaster");
package_extract_file("firmware-update/xbl.elf", "/dev/block/bootdevice/by-name/xbl");
package_extract_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpm");
package_extract_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64bak");
package_extract_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlibbak");
package_extract_file("firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hypbak");
package_extract_file("firmware-update/pmic.elf", "/dev/block/bootdevice/by-name/pmicbak");
package_extract_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tzbak");
package_extract_file("firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/abootbak");
package_extract_file("firmware-update/lksecapp.mbn", "/dev/block/bootdevice/by-name/lksecappbak");
package_extract_file("firmware-update/devcfg.mbn", "/dev/block/bootdevice/by-name/devcfgbak");
package_extract_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymasterbak");
package_extract_file("firmware-update/xbl.elf", "/dev/block/bootdevice/by-name/xblbak");
package_extract_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpmbak");
package_extract_file("firmware-update/splash.img", "/dev/block/bootdevice/by-name/splash");
package_extract_file("firmware-update/NON-HLOS.bin", "/dev/block/bootdevice/by-name/modem");
package_extract_file("firmware-update/logo.img", "/dev/block/bootdevice/by-name/logo");
package_extract_file("firmware-update/adspso.bin", "/dev/block/bootdevice/by-name/dsp");
package_extract_file("firmware-update/BTFM.bin", "/dev/block/bootdevice/by-name/bluetooth");
package_extract_file("META-INF/com/miui/miui_update", "/cache/miui_update");
set_metadata("/cache/miui_update", "uid", 0, "gid", 0, "mode", 0555, "capabilities", 0x0);
run_program("/cache/miui_update");
delete("/cache/miui_update");
set_progress(0.900000);
unmount("/system");
unmount("/cust");
ui_print("Patching boot.img...");
set_progress(1.700000);
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/system", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/", "/");
package_extract_dir("META-INF/com/miui", "/tmp/bootfix");
run_program("/sbin/busybox", "unzip", "/tmp/bootfix/bootfix", "META-INF/com/google/android/*", "-d", "/tmp/bootfix");
run_program("/sbin/busybox", "sh", "/tmp/bootfix/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/bootfix/bootfix");
ui_print("Installing geocoding...");
set_progress(1.900000);
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/system", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/", "/");
package_extract_dir("META-INF/com/miui", "/tmp/geocoding");
run_program("/sbin/busybox", "unzip", "/tmp/geocoding/geocoding", "META-INF/com/google/android/*", "-d", "/tmp/geocoding");
run_program("/sbin/busybox", "sh", "/tmp/geocoding/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/geocoding/geocoding");
ui_print("Installing busybox...");
set_progress(1.900000);
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/system", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/", "/");
package_extract_dir("META-INF/com/miui", "/tmp/busyboxupd");
run_program("/sbin/busybox", "unzip", "/tmp/busyboxupd/busyboxupd", "META-INF/com/google/android/*", "-d", "/tmp/busyboxupd");
run_program("/sbin/busybox", "sh", "/tmp/busyboxupd/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/busyboxupd/busyboxupd");
ui_print("Installation completed");
ui_print(" ");
set_progress(1.000000);

然后zip打包,system镜像就不要了,把system文件夹打包进来,根目录一共5个firmware-update,META-INF,system,boot.img,file_contexts.bin。刷机包就做好了,不过别急着刷。还需要SuperSU-v2.82-201705271822.zip卡刷包。
在twrp下用mtp把这些都复制到sd卡的twrp目录。
这个版本的twrp有个设置是删除miui多余的集成包,可以勾上,这样即使上面你没有删APP,twrp也会删掉一些。
然后,先刷自己打包的rom,如果版本跨度大建议清除data,刷好后再刷supersu。
重启,正常的话就能进系统了。如果不正常可能删多了。我自己测试有遇到卡logo,也有进去没桌面。少删点,除非你了解每个app的用途。

标签: ubuntu miui

上一篇: usb over ip 试用
下一篇: obook20plus修改刷机包和root,twrp资料整理

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: