View Poll Results: Do you retain MIUI Home Launcher?

60 Vote(s)
47 Vote(s)

"Roll your own" SKINNY MIUI - Revised 09/04/16

1,464 posts
Thanks Meter: 1,625
By jajk, Senior Member on 7th February 2016, 01:35 AM
Post Reply Email Thread
Skinny MIUI is all about preserving the good; Working premium drivers for Camera, CPU control, Notification LEDs, Bluetooth, FM Radio etc. while resolving what is bad in the stock offering.
All deletions assume the user has absolutely no interest in being part of the Xiaomi ecosphere. Leave now if that is not you.
This guide applies to MIUI stable versions 7.1.1 thru to 7.2.5 only. Developer, Beta or Eng versions are not good candidates.

Boot.img mods: (this is not creating a custom kernel!!!)

The stock boot.img is unpacked, init.d support added and many entries that are not relevant to our hardware removed.
Disabling lines trying to load non-existent services from init.rc, init.mt6795.rc and ueventd.rc etc. stops a bit of churning on each and every boot and frees up a bit of RAM.
There are intentionally no other tweaks contained within the boot.img. All tweaks are done in init.d scripts accessible outside the boot.img.
Note: This boot image made from 7.1.4 will work back to ver 7.1.1 and forward to 7.2.50 / 6.3.31 and is superior to the stock boot images contained in those ROMs.
At this point you can flash the modified boot.img to your phone if you already have a stock MIUI 7.1.1 to 7.2.50 installation that you are going to keep.
If you are going to do a clean install, replace the boot.img in your ROM zip file with this modified one. (backup the original first)

The boot.img is found here: (Now links to folder with all versions available)
The Following 26 Users Say Thank You to jajk For This Useful Post: [ View ] Gift jajk Ad-Free
7th February 2016, 01:40 AM |#2  
OP Senior Member
Thanks Meter: 1,625
Full install:
I recommend you install my TWRP 3.02-2 version from here:

Before installing your chosen ROM:
Check that the updater script found: \META-INF\com\google\android\updater-script is not going to install Preloader, Uboot (lk), Recovery or logo partitions. If so, edit the updater-script to prevent this happening. This is to reduce the risk of a soft-brick or being locked out of your phone.
Do a factory reset in TWRP (wipe Data, Dalvik, Cache) before installing any ROM.

Install your chosen ROM. Trying to slim down the ROM before install is an arduous affair which tends to end in bootloops so we leave the original ROM alone in this respect..
Do the install without connecting to mobile or WiFi networks and just skip at screens prompting for network connectivity and creating accounts.
Reboot into TWRP once finished with the initial Setup to avoid Recovery from being deleted on first boot.
Install an updated SuperSU zip package from TWRP recovery - V2.46 to 2.71 work equally well.
Do not install a root package other than SuperSU - most online ones are malware!
Update the outdated and incomplete Busybox installation. I have created a TWRP flashable zip to upgrade to the latest version 1.25.0. This is the second edition which has better binaries and no longer creates symlinks to busybox commands.
Now install a root capable filemanager (Root Explorer or Total Commander recommended). Open it and gain root permissions. Open /etc/perfservscntbl.txt in a text editor and edit as follows:

This will lower the number of cores used and the frequency at which it runs when a screen touch is detected (referred to as Touch Boost) Changes are activated on reboot.

Now create a file named 01_tweaks in the /etc/init.d folder. Change the permission of the file to 0755
Tips on creating scripts:
  • The EOL(end-of-line) characters must be in Unix format - not Windows. Make sure you are using a text editor that saves in Unix format.
  • Note also that many script files need a blank line at the end to work correctly. Get in the habit of always doing this whether needed or not.
  • Any line starting with a # character and anything after a # character on a line is not processed and is referred to as "commented out"
  • Script files must start with the header #!/system/bin/sh as the first line.
  • Init.d scripts are processed in alpha-numeric filename order hence the common usage of 01_xxx, 02_xxx format for names.

Copy these lines into the 01_tweaks file: Note: Different values for 2.2GHz cpu and freq limited operation.


### Tweak Interactive CPU Governor
echo 806000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "90 403000:80 806000:85 1326000:90 1625000:95 1950000:99" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 32000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 10000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 15000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack

### Tweak IO Scheduler
echo deadline > /sys/block/mmcblk0/queue/scheduler ### choose between cfq, bfq or deadline
### Enable this line if using cfq or bfq scheduler only
# echo 0 > /sys/block/mmcblk0/queue/iosched/slice_idle
echo 256 > /sys/block/mmcblk0/queue/read_ahead_kb

### Enable zram swap
# echo 1073741824 > /sys/block/zram0/disksize ### 536870912 = 512MB 1073741824 = 1GB
# /system/bin/tiny_mkswap /dev/block/zram0
# /system/bin/tiny_swapon /dev/block/zram0

### Tweak Entropy to avoid regular depletion of available pool
echo 512 > /proc/sys/kernel/random/read_wakeup_threshold
echo 1024 > /proc/sys/kernel/random/write_wakeup_threshold

#Tweak for wifi router connection issues
#echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6

### FSTRIM: Enable once after installation is finalized and then monthly ##### needs an updated busybox installation to work
# busybox fstrim /data
# busybox fstrim /cache
# busybox fstrim /system
Options: Add / replace lines to do the following:

1. freq limit a 2GHz cpu to 1781MHz (recommended setting)

echo "90 403000:80 806000:85 1326000:90 1625000:95 1781000:99" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 1781000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1781000 > /proc/cpufreq/cpufreq_limited_max_freq_by_user

2. Full speed 2.2GHz cpu

echo "90 403000:80 806000:85 1326000:90 1664000:95 2158000:99" > /sys/devices/system/cpu/cpufreq/interactive/target_loads

3. freq limit a 2.2GHz cpu to 1885MHz (recommended setting)

echo "90 403000:80 806000:85 1326000:90 1664000:95 1885000:99" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 1885000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1885000 > /proc/cpufreq/cpufreq_limited_max_freq_by_user

4. Add a limit to the maximum number of cpu cores allowed to come online (for possible battery saving maybe...)

#Limit max cpu cores available (range 2 - 8)
echo 4 > /proc/hps/num_limit_low_batt
echo 4 > /proc/hps/num_limit_power_serv
echo 4 > /proc/hps/num_limit_thermal
echo 4 > /proc/hps/num_limit_ultra_power_saving

Edit /system/build.prop. Change the line: ro.sf.lcd_density from the default 480 to a value between 400 (everything smaller, more on screen) to 520 (everything larger, less on screen) to suit your taste and eyesight. You can test this out first by issuing the wm density command in a terminal app. e.g wm density 440 will immediately change the density to 440dpi, wm density reset will put it back to whatever the build.prop setting is. Adjust the text size in Settings in conjunction with this to get the best result.

At this point you have a functional set of tweaks that are all tested and proven to provide a battery and performance improvement. There are a lot of detrimental or placebo tweaks out there so be a little bit discerning in what else you add to these tweaks - sometimes less is more. Now is not the time to load up those tweaks!

Do a TWRP backup of System, Data, Boot and NVram partition now to save your efforts up to this point.
The Following 13 Users Say Thank You to jajk For This Useful Post: [ View ] Gift jajk Ad-Free
7th February 2016, 01:47 AM |#3  
OP Senior Member
Thanks Meter: 1,625
Now its time to get Skinny: You will need an app that can uninstall and freeze system apps. I use SD Maids App Control feature for this purpose.

Warning: If you intend to use app lock, you will unfortunately need to keep some fingerprint service files. See the post below and a few before it to understand the problem. Thanks to @DarthJabba9 for his work.
I believe that app lock also disables MIUI Optimization if enabled.

First phase is to get rid of the obvious bloat apps and Xiaomi in-house apps....these in the list below are safe to remove.
Tick off what you have removed and reboot each 10 or so deletions and backup, don't try to delete everything in one hit as you will end up stuck at boot.
WARNING: This removes some functionality that may be useful to some users. You either want the function or you don't - it is your finger pressing the buttons!
Some people may choose to keep the MIUI Home Launcher interface. In this case, keep MIUI Wallpaper as well.

Must keep these - Do not delete:
Updater - disable autostarts, do not freeze
Theme Manager - disable autostarts
Security (com.miui.securitycenter) - leave as-is
Network Assistant app
MiuiSDK - disable autostarts
Webview (update via Playstore once install finished)
Xiaomi service framework - disable autostarts, freeze app

Definitely O.K to delete list:

Wallpaper Apps:
Android Live Wallpapers
Black Hole
Live Wallpaper Picker
Music Visualization Wallpapers
Phase Beam
Photo Screensavers
*Miui MiWallpaper * keep if also keeping MIUI Home Launcher.

Xiaomi/MTK Apps:
Back up Home screen layout (cloud backup)
Backup - delete if you don't use it (use TWRP instead)
Battery Warning - deleting this does not affect battery charging or display
Battery Saver - deleting this improves battery life
Blocklist (AntiSpam) - delete if you don't use it
File Explorer - delete (you should already have a root capable file browser)
Find device - use the generic Google version if you really must, not the Xiaomi one supplied.
gallery (com.mfashiongallery.emag daily wallpapers)
Home screen
com.securitycore.miui_t (Tencent virus scanner plugin to Security Center)
KLO Bug report
MI Account
Mi Cloud
Mi Credit
Mi Drop
Mi Home
MI Service Security Framework
Mi Voice
Mi Wallet
Notes - if you don't use it, delete it.
PowerKeeper (Battery Saver) - deleting this improves battery life
Report Bug
Security service plugin (not securitycenter app)
System Launcher (Miui Home) replace with an alternative Launcher, allow autostart in Security first then delete. ADW Launcher recommended for lightweight and simple functionality (set to 4x6 looks good).
Traffic Control
Voice Unlock
Weather provider
Whetstone delete app and delete folder /etc/WhetstonePermission ****Whetstone is linked with several other apps to make it hard to get rid of. It may cause some temporary FC issues - these will pass.
Xiaomi Assistant
Yellow Pages
com.xiaomi pass
Cheetah Mobile CleanMaster SDK + Cleaner - delete
NetworkLocation ( delete app, delete folder: /system/vendor/operator and delete corpses

Android/Google Apps:
Browser - suggest replace with Polarity Browser - minimal permissions required, Ad Blocking, lightweight and fast
Google Keyboard - replace with something lighter - Hackers Keyboard v1.38.2 recommended
Google Pinyin input
Google Feedback
Google partnersetup
HTML Viewer
Pico TTS
Print Spooler

Note: If you have apps reappear as if by magic, they are being reconstructed from cached information. SD Maid has an excellent "Corpse Finder" function that will delete the orphaned files and prevent this happening. Clear corpses after each reboot.

Second phase is to toggle off the autostarts (receivers) on the apps that do not need to start by default. This is not the same as freezing an app. Some apps will still start by themselves - do not worry too much about this.

Download Manager
Google Contacts Sync
Google One Time Init
MIUI SDK (don't freeze)
MTK NLP Service
One Time Init
Sim Toolkit
Themes (Theme Manager)
Xiaomi service framework (should also be frozen)

Third phase is to clean up left behind folders and files

/data/miui/app/customized/ remove any app folders that you have uninstalled
/data/miui/app/noncustomized/ remove any app folders that you have uninstalled
delete folder /data/miui/mms
delete folder /data/miui/gallery
delete contents of /data/miui/cust
delete folder /etc/jeejen
delete etc/voicecommand and etc/voiceextension folders if you have removed voice related apps
delete /system/tts folder if you have removed Pico TTS
delete folder /system/etc/radv
/etc/fake_cdrom_install.iso - delete file
/etc/IAmCdRom.iso - delete file
/system/addon.d delete folder
/system/app/jjcontainer/ - delete folder
/system/app/jjhome/ - delete folder
/system/app/jjknowledge/ - delete folder
/system/app/jjstore/ - delete folder

Libs you can remove:


/system/lib (if deleted MiraVision App)
libpatcher_game_jni (if voice recognition apps deleted) (if voice recognition apps deleted) (if deleted Whetstone App) (if deleted Whetstone App) (if xiaomi media player deleted) (if xiaomi media player deleted)

/system/lib64 (if deleted Google keyboard) (if deleted PacProcessor) (if deleted MiraVision App) (if deleted Whetstone App) (if deleted Whetstone App)

Establish network connectivity.
If Gapps is required but not installed, download open_gapps-arm64-5.0-pico version. You can install individual extra Google apps at any stage later on.
Go through all MIUI Settings and turn off everything you do not need running.
Install your favorite media player, web browser etc. to replace the deleted original apps.

Can replace Calendar and Messenger with Google Calendar and Google Messenger to remove some more Xiaomi dependencies. Contacts & Dialer are much harder to replace - True Phone is the only viable option.
To further limit Xiaomi unsolicited communications, rename (or delete) /system/xbin/tunman to tunmanbak. (This is a tunneling protocol driver that Xiaomi uses without your knowledge or permission).
The startup is disabled in the boot.img but it can still be started after boot unless renamed.

To skinny the Themes footprint:
Go to /system/media/theme/
Delete elder-default folder if no use.
Delete entire contents of miui_mod_icons folder
Delete items in /system/media/theme/default/ that are not going to be used.
Delete items in /system/media/lockscreen/ and /system/media/wallpaper/ that are not going to be used.

Now install your favorite app for monitoring CPU parameters and make sure that on idle, there is only one cpu core running and it sits predominantly on 403MHz. It will jump a little bit but that is normal with the inevitable background activities. Increase the timer_rate if you want more stability at idle rather than cranking up the load figures too far. Up to 50000 or down to 30000 is O.K (remember we are talking microseconds here so 50000 = 50mS)

Congratulations! You now you have a "Super Skinny" MIUI installation. Do a backup now!!!!

Now you will feel the AOSP shining through - and still you have working everything!
The Following 15 Users Say Thank You to jajk For This Useful Post: [ View ] Gift jajk Ad-Free
7th February 2016, 01:52 AM |#4  
OP Senior Member
Thanks Meter: 1,625
This post will list useful tools and items that need further investigation.
Apps for finding and disabling things:
Wakelock Detector-Root - monitor and records wakelock activity
GSAM - monitors what apps / services are consuming battery
Disable Service - disable services started on an app by app basis
SD Maid, Titanium Backup - Freeze / remove apps, toggle autostarts (receivers)

Modify your quick start grid size:

Modify MIUI Homescreen grid:!yJdkxbBa!WSIqrhwUQwD7qjzxOuo1Yw

Find a way to completely disable XMPush service with and without Xiaomi services framework installed.
Xiaomi Services Framework causes Sim connectivity issues if deleted - do not delete. There will always be one XMPush instance running.

Find out what is causing Audio On wakelock reported by GSAM
Quote: Originally Posted by DarthJabba9
With regard to the "Audio On" wakelock (aka AudioMix Wakelock) reported bt GSAM, I found this somewhere in this forum: "The nexus 6 had the same wakelock and most of us got rid of it by unchecking "use NuPlayer" in developer options". I have now unchecked that option, and will see over the next day or so whether it resolves the problem. This appears to be the fix

What triggers no sim / no service errors
Removing Xiaomi Services Framework is the culprit

Why do some files / folders not show up in root filemanagers?
MIUI locks the files / folders to prevent them being used or shown.

Why does zram not work anymore?
Rename tiny_mkswap, tiny_swapon, tiny_swapoff to teeny_mkswap, teeny_swapon, teeny_swapoff
Make sure owner is root shell and permissions are 0755 for all 3 files.
edit the init.d script to reflect the change in filenames. Now it will work again!
The Following 6 Users Say Thank You to jajk For This Useful Post: [ View ] Gift jajk Ad-Free
8th February 2016, 03:38 AM |#5  
OP Senior Member
Thanks Meter: 1,625
Example full Skinny ROM based on MR7.2.30 ID:
This is how my phone is set up, it has 100% functionality, zero FCs and zero battery drain on idle. The init.d settings are exactly as provided. Compare the directory listings to your own to see what is deleted.
The other major variation to this is for people who want to keep MIUI Launcher (and MIUI Wallpaper), everything else should remain the same. This cost you a bit more RAM usage and slightly more cpu activity (less battery) but is still impressive compared to stock.


WallpaperCropper ### Total Commander installed as system app ### True Phone replacement for Xiaomi Contacts & Dialer
org.adw.launcher ### ADW Launcher installed as system app

Other base apps in /data/app: ### replacement Google Messenger ### replacement Google Calendar ### stock IR remote controller app
pcr.browser.polarity ### Polarity Browser
com.grarak.kerneladiutor ### Kernel Adiutor * disable autostarts*
org.pocketworkstation.pckeyboard ### Hackerskeyboard-v1.38.2 replaces Google keyboard
jackpal.androidterm ### Android Terminal
The Following 4 Users Say Thank You to jajk For This Useful Post: [ View ] Gift jajk Ad-Free
8th February 2016, 06:13 AM |#6  
Thanks Meter: 7
Thanks a bunch for the info. This is exactly what I'm looking for (my slimming down attempts always resulted in bootloops, so I've been playing it pretty safe so far).
Is this something you repeat every time an update is being pushed to your RN2?
8th February 2016, 07:09 AM |#7  
OP Senior Member
Thanks Meter: 1,625
@elaurens By doing this you are forgoing the use of OTA Updates which will unravel everything you have achieved.
I had to go through quite a few bootloops before creating the "safe lists" - I suffer so you can all benefit.
If you are starting with 7.1.4 everything is perfect and needs no more updating

Keep your eye out for additions to these lists as I discover or remember them
The Following 3 Users Say Thank You to jajk For This Useful Post: [ View ] Gift jajk Ad-Free
8th February 2016, 08:26 AM |#8  
OP Senior Member
Thanks Meter: 1,625
I have tried this:
to enable ClearMotion and can vouch for it being safe - as in no malware and no breaking things. It adds the following to Build.prop and puts some hacked drivers in /system/lib.


Is this a worthwhile thing to do? There are no negatives in doing so as far as I can see but I don't really have anything that can give this a proper workout.
Can anyone see a difference in video playback? (Must have hardware acceleration selected) I won't recommend this if there is no perceivable gain.
8th February 2016, 10:32 AM |#9  
Senior Member
Flag Rijeka
Thanks Meter: 93
most of the stuff works fine, everything checks out, It's not really anything new, but i find it well written, and it's not just a "placebo build.prop tweaks edit" which is a +. its a smart thing to have it all in a single thread.
however there're some issues with init.d script. even if you get init working, sometimes it just simply wont apply any of the tweaks. interestingly enough, i forced it to create a new text file on every boot, and that works. not really sure whats causing this prob.
anyways, by some magic I eventually made it apply the script, not really sure if it was cause of the rom change, or just pure luck lol
8th February 2016, 11:02 AM |#10  
OP Senior Member
Thanks Meter: 1,625
@sikica133 and anyone else having init.d problems:
init.d problems are usually one of the following:
1. incorrect folder permissions.
2. incorrect file permissions
3. No line feed at the end of the file (blank line)
4. incomplete or missing Busybox install
5. missing header in the text
6. Loosing SU privileges

Check init.d folder has 0755 permissions
Check file has at least 0644 permissions
Check and/or insert a line feed at the end of the file
Install busybox on rails, run the cleanup and busybox install, uninstall busybox on rails after this (this gives you an up-to-date and more complete busybox installation)
First line of file must be exactly #!/system/bin/sh
Reinstall a fresh version of SuperSu through TWRP

I sometimes get caught out myself by editing a file on the PC and transferring it back without fixing permissions afterwards

I have the ultimate build.prop tweak that I will share with you all now, stand back, it is very powerful

persist.sys.use_qualcomm_performance_features_inst ead=1
8th February 2016, 11:17 AM |#11  
Senior Member
Flag Rijeka
Thanks Meter: 93
nah, i was testing it with a updater-script doing 0755 on all scripts. busybox should be fine cause other scripts did their job. dunno, could be some funny issue on my end. works now, i was just wtf, everything works, this doesnt. no idea what was going one tbh, but it works

could be incompatibility with bbox and the script itself? im running it without feedline atm, and it applies it all. same script i used before when it didnt do anything.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes