Unpack / Repack ROM

Xiaomi News, Gadgets, new Products and everything related to Xiaomi.

Moderator: dr4kendroid

User avatar
gendouhydeist
Active Member
Active Member
Posts: 21
Joined: 01 Dec 2016, 22:14
Thanks received: 2

Unpack / Repack ROM

Postby gendouhydeist » 26 Feb 2017, 20:09

Hi, I'd just like to know how can we unpack and repack the system.new.dat. There's a lot of guide in the internet right now but none of them work. Actually I've been doing this since SMIUI, removing bloated apps or apps I don't use.

If you can provide how to repack or If you can add a filter for apk's not to be installed in a ROM building process it would be awesome feature.

Thanks!

User avatar
dr4kendroid
Developer / Admin
Developer / Admin
Posts: 864
Joined: 21 Nov 2016, 09:20
Phone Model: Mi 5 , Mi 6
Thanks received: 265
Contact:

Re: Unpack / Repack ROM

Postby dr4kendroid » 26 Feb 2017, 22:57

gendouhydeist wrote:Hi, I'd just like to know how can we unpack and repack the system.new.dat. There's a lot of guide in the internet right now but none of them work. Actually I've been doing this since SMIUI, removing bloated apps or apps I don't use.

If you can provide how to repack or If you can add a filter for apk's not to be installed in a ROM building process it would be awesome feature.

Thanks!

What Apps do you want to remove?
Why dont you remove after flashing with root explorer ?
Image
Best Price Xiaomi Products - free shipping worldwide !!!
Just send us PM if you need any coupons ;)

User avatar
gendouhydeist
Active Member
Active Member
Posts: 21
Joined: 01 Dec 2016, 22:14
Thanks received: 2

Re: Unpack / Repack ROM

Postby gendouhydeist » 17 Mar 2017, 15:29

This was the bash script that I'm using long before.
Honestly deleting the system apps after installing the rom is not a good idea, it will spam an error crash due to missing files example is when you delete midrive.

Thats why I want to delete modify the rom first before installing the rom.

If you just make an expert advanced option which apps you don't want to install it will be a great addition to the rom builder.

Code: Select all

system=$(find -name system.new.dat)
transfer=$(find -name system.transfer.list)
context=$(find -name file_contexts)
newimg=$(find $dir -name system.new.dat)

./sdat2img.py $transfer $system system.img

sudo mount -t ext4 -wo loop system.img output/

sudo rm -rf output/app/AMAPNetworkLocation
sudo rm -rf output/app/AnalyticsCore
sudo rm -rf output/app/AntHalService
sudo rm -rf output/app/BugReport
sudo rm -rf output/app/CloudPrint2
sudo rm -rf output/app/CloudService
sudo rm -rf output/app/DocumentsUI
sudo rm -rf output/app/Email
sudo rm -rf output/app/fastdormancy
sudo rm -rf output/app/FileExplorer
sudo rm -rf output/app/GoogleCalendarSyncAdapter
sudo rm -rf output/app/KSICibaEngine
sudo rm -rf output/app/LatinImeGoogle
sudo rm -rf output/app/LiveWallpapersPicker
sudo rm -rf output/app/Metok
sudo rm -rf output/app/MiDrive
sudo rm -rf output/app/matcli
sudo rm -rf output/app/MiGalleryLockscreen
sudo rm -rf output/app/MiLinkService
sudo rm -rf output/app/MiuiVideo
sudo rm -rf output/app/NetworkAssistant2
sudo rm -rf output/app/PicoTts
sudo rm -rf output/app/PowerKeeper
sudo rm -rf output/app/PrintSpooler
sudo rm -rf output/app/QtiBackupAgent
sudo rm -rf output/app/QuickSearchBox
sudo rm -rf output/app/SmsExtra
sudo rm -rf output/app/TouchAssistant
sudo rm -rf output/app/TranslationService
sudo rm -rf output/app/RIDLClient
sudo rm -rf output/app/Whetstone
sudo rm -rf output/etc/WhetstonePermission
sudo rm -rf output/app/xdivert
sudo rm -rf output/lib/libweibosdkcore_sogou.so
sudo rm -rf output/lib/libwhetstone_sdk.so
sudo rm -rf output/lib/libwhetstone_jni.so
sudo rm -rf output/lib/libxiaomimediaplayer.so
sudo rm -rf output/lib/libxiaomiplayerwrapper.so
sudo rm -rf output/lib64/libBankCardRecognizer.so
sudo rm -rf output/lib64/libduokantext.so
sudo rm -rf output/lib64/libttspico.so
sudo rm -rf output/lib64/libweibosdkcore.so
sudo rm -rf output/lib64/libwhetstone_jni.so
sudo rm -rf output/lib64/libwhetstone_sdk.so
sudo rm -rf output/lib64/libxmpass_sdk_patcher.so
sudo rm -rf output/lib64/xmpass_libweibosdkcore.so
sudo rm -rf output/priv-app/Backup
sudo rm -rf output/priv-app/BackupRestoreConfirmation
sudo rm -rf output/priv-app/Browser
sudo rm -rf output/priv-app/CloudBackup
sudo rm -rf output/priv-app/FidoCryptoService
sudo rm -rf output/priv-app/GoogleFeedback
sudo rm -rf output/priv-app/MiDrop
sudo rm -rf output/priv-app/Mipub
sudo rm -rf output/priv-app/MiGameCenterSDKService
sudo rm -rf output/priv-app/MiuiRadio
sudo rm -rf output/priv-app/MiuiVoip
sudo rm -rf output/priv-app/Music
sudo rm -rf output/priv-app/MusicFX
sudo rm -rf output/priv-app/SmartcardService
sudo rm -rf output/priv-app/SpacesManagerService
sudo rm -rf output/priv-app/StatementService
sudo rm -rf output/priv-app/SpacesTrustAgent
sudo rm -rf output/priv-app/Tag
sudo rm -rf output/priv-app/TelephonyExtVodafonePack
sudo rm -rf output/priv-app/WallpaperCropper
sudo rm -rf output/priv-app/YellowPage
sudo rm -rf output/vendor/bin/RIDLClient.exe
sudo rm -rf output/vendor/etc/RIDL

read -p "Press [Enter] when ready..."

./make_ext4fs -T 0 -S $context -l 1322606592 -a system system_new.img output/
sudo umount output
mv -u system_new.img system.new.dat

User avatar
dr4kendroid
Developer / Admin
Developer / Admin
Posts: 864
Joined: 21 Nov 2016, 09:20
Phone Model: Mi 5 , Mi 6
Thanks received: 265
Contact:

Re: Unpack / Repack ROM

Postby dr4kendroid » 18 Mar 2017, 08:10

We would have to list all apps. Thats not possible and I think most people dont need it, sorry.
Whats the problem with your script ?
Image
Best Price Xiaomi Products - free shipping worldwide !!!
Just send us PM if you need any coupons ;)

User avatar
gendouhydeist
Active Member
Active Member
Posts: 21
Joined: 01 Dec 2016, 22:14
Thanks received: 2

Re: Unpack / Repack ROM

Postby gendouhydeist » 22 Mar 2017, 19:48

since they start to lock the bootloader's, I'm having a hard time to make my own rom because it automatically breaks upon installation and won't install.

Does usual unpacking repacking work's? or do I need a special parameter in order to install files on the right address and partition?


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 14 guests

Gearbest Gearbest The Latest Smartphones Now With Up To 68% OFF promotion