[H812][UsU][v29a]Ultimate custom settings/tweaks mega-post - G4 General

This is for the H812 only, however I am sure much can be used on any device. I decided to make one post of all my settings instead of individual posts in different threads as a way to avoid off topic etc. This is a wip and I will update as required.
*** Use anything I say at your own risk, I will not be held responsible for bricking or otherwise screwing up your device in any way. No whining about this doesn't work or that it doesn't make any sense etc I say again USE AT YOUR OWN RISK ***
Ok so first thing is to backup then backup and copy backup to multiple locations, backup again (lol)!!!
Backup then Unlock with UsU (SALT) by @steadfasterX here: https://forum.xda-developers.com/g4/general/unlock-unlock-lg-g4-device-usu-t3760451 Make sure to install TWRP and make backups.
Figure it out yourself by reading the OP several times and post as necessary in that thread.
Install the Nougat v29a mentioned in the above thread under FAQ #16.
Install Titan kernel (H811 stock Nougat) by @kessaras here: https://forum.xda-developers.com/g4/development/g4-t3667878
I use 1.7 with the following settings:
EDIT:I have since changed these settings although the following is still good.
Big cores at 1632 max 384 min.
Little cores at 1440 max 384 min
CPU gov intelliactive for both.
Disable CPU boost.
GPU using cpufreq gov.
FIOPS for both internal and external set to 1024kb.
Low memory killer set to light.
Misc settings, enable fsync with Westwood TCP.
Install Magisk with Dolby Atmos (LeEco Le Pro3), Enable Doze for GMS (huge savings for battery) and Unified Hosts Adblock modules.
NOTE: I use Adaway beta 4.09 now instead of unified hosts module. Google framework module for Google apps like Phone. Single user mod and force fast charge are also good!
For now that should be enough to get a bunch of users messed up, I have other tweaks like bloat removal, useful apps etc to add later if people want them.
Feel free to post questions about the above for further explanation/clearification.
Do not ask for help fixing things you break, that's what backups are for!
Cheers!
Edit: Great post for H812 consider thanking that user
https://forum.xda-developers.com/g4/general/unlock-unlock-lg-g4-device-usu-t3760451/page110

List of useful apps that I use:
Kernel Adiutor
https://play.google.com/store/apps/details?id=com.grarak.kerneladiutor
Magisk
https://forum.xda-developers.com/apps/magisk/beta-magisk-v13-0-0980cb6-t3618589/page577
Build prop editor
https://play.google.com/store/apps/details?id=com.jrummy.apps.build.prop.editor
BusyBox
https://play.google.com/store/apps/details?id=ru.meefik.busybox
Catlog
https://play.google.com/store/apps/details?id=com.nolanlawson.logcat
Devcheck
https://play.google.com/store/apps/details?id=flar2.devcheck
ES File Explorer
https://play.google.com/store/apps/details?id=com.estrongs.android.pop.pro
Official TWRP
https://play.google.com/store/apps/details?id=me.twrp.twrpapp
Quick Reboot
https://play.google.com/store/apps/details?id=com.antaresone.quickrebootpro
Titanium Backup
https://play.google.com/store/apps/details?id=com.keramidas.TitaniumBackup
Wifi analyzer
https://play.google.com/store/apps/details?id=info.wifianalyzer.pro

Build.prop edits that may help;
ro.build.fingerprint
lge/p1_rgs_ca/p1:6.0/MRA58K/1619418088183:user/release-keys
(Passes safety net check for me, use the entry from your original MM built.prop)
ro.product.model
LG-H812
(Helps apps show correct model)
ro.gps.agps_provider
1
(From original build.prop)
ro.ril.def.preferred.network
9
ro.telephony.default_network
9
telephony.lteOnCdmaDevice
1
telephony.lteOnGsmDevice
1
(Networking to use LTE 4g etc)
ro.factorytest
0
(Removes an error in log)
*** I soft bricked my device changing too many entries in build.prop so be cautious.

Here's a list of all the apps I have frozen in Titanium Backup.
com.android.cellbroadcastreceiver
com.android.LGSetupWizard
com.google.android.apps.books
com.google.android.apps.docs.editors.sheets
com.google.android.apps.docs.editors.slides
com.google.android.apps.magazines
com.google.android.play.games
com.google.android.talk
com.google.android.videos
com.google.android.webview
com.lge.appbox.client
com.lge.bnr
com.lge.bnr.launcher
com.lge.cloudhub
com.lge.concierge
com.lge.easyhome
com.lge.email
com.lge.exchange
com.lge.fmradio
com.lge.gcuv
com.lge.gestureanswering
com.lge.homeselector
com.lge.ia.task.smartsetting
com.lge.iftttmanager
com.lge.launcher2
com.lge.lgaccount
com.lge.lgdmsclient
com.lge.lgmapui
com.lge.mtalk.sf
com.lge.myplace
com.lge.myplace.engine
com.lge.qvoiceplus
com.lge.remote.setting
com.lge.sizechangable.favoritecontacts
com.lge.sizechangable.weather.platform
com.lge.sizechangable.weather.theme.optimus
com.lge.smartcover
com.lge.smartsharepush
com.lge.sync
com.lge.updatecenter
com.lge.wernicke
com.lge.wernicke.nlp
com.maluuba.android.qvoice
com.rsupport.rs.activity.lge
com.sika524.android.quickshortcut
com.ti.server

One of the easiest and most effective ways to increase the perceived speed and snappiness of your device!
Developer Options > Drawing
Window animation scale [Off or .5]
Transition animation scale [Off or .5]
Animator duration scale [1x]

Here are the settings I use for the stock Titan kernel (1.7 I been having issues with 1.8) including Kernel Adiutor profile:
Code:
version 1
profile
commands
path /sys/module/msm_performance/parameters/cpu_max_freq4
command echo '4:1440000' > /sys/module/msm_performance/parameters/cpu_max_freq
path /sys/module/msm_performance/parameters/cpu_max_freq5
command echo '5:1440000' > /sys/module/msm_performance/parameters/cpu_max_freq
path /sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq4
command #{"path":"\/sys\/devices\/system\/cpu\/cpu%d\/cpufreq\/scaling_max_freq","value":"1440000","min":4,"max":5,"bigCpus":[4,5],"LITTLECpus":[0,1,2,3],"corectlmin":2}
path /sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor0
command #{"path":"\/sys\/devices\/system\/cpu\/cpu%d\/cpufreq\/scaling_governor","value":"intelliactive","min":0,"max":3,"bigCpus":[4,5],"LITTLECpus":[0,1,2,3],"corectlmin":2}
path /sys/module/cpu_boost/parameters/input_boost_enabled
command echo '0' > /sys/module/cpu_boost/parameters/input_boost_enabled
path /sys/module/cpu_boost/parameters/boost_ms
command echo '0' > /sys/module/cpu_boost/parameters/boost_ms
path /sys/module/cpu_boost/parameters/input_boost_freq0
command echo '0:0' > /sys/module/cpu_boost/parameters/input_boost_freq
path /sys/module/cpu_boost/parameters/input_boost_freq4
command echo '4:0' > /sys/module/cpu_boost/parameters/input_boost_freq
path /sys/class/kgsl/kgsl-3d0/devfreq/governor
command echo 'cpufreq' > /sys/class/kgsl/kgsl-3d0/devfreq/governor
path /sys/block/mmcblk0/queue/scheduler
command echo 'fiops' > /sys/block/mmcblk0/queue/scheduler
path /sys/block/mmcblk0/queue/read_ahead_kb
command echo '1024' > /sys/block/mmcblk0/queue/read_ahead_kb
path /sys/block/mmcblk0/queue/iostats
command echo '0' > /sys/block/mmcblk0/queue/iostats
path /sys/block/mmcblk1/queue/scheduler
command echo 'deadline' > /sys/block/mmcblk1/queue/scheduler
path /sys/block/mmcblk1/queue/read_ahead_kb
command echo '2048' > /sys/block/mmcblk1/queue/read_ahead_kb
path /sys/block/mmcblk1/queue/iostats
command echo '0' > /sys/block/mmcblk1/queue/iostats
path /sys/module/lowmemorykiller/parameters/minfreechmod
command chmod 666 /sys/module/lowmemorykiller/parameters/minfree
path /sys/module/lowmemorykiller/parameters/minfreechown
command chown root /sys/module/lowmemorykiller/parameters/minfree
path /sys/module/lowmemorykiller/parameters/minfree
command echo '21780,29040,36300,43560,50820,65340' > /sys/module/lowmemorykiller/parameters/minfree
path /proc/sys/vm/swappiness
command echo '60' > /proc/sys/vm/swappiness
path /sys/module/msm_thermal/parameters/enabled
command echo 'N' > /sys/module/msm_thermal/parameters/enabled
path /sys/module/msm_thermal/core_control/enabled
command echo '1' > /sys/module/msm_thermal/core_control/enabled
path /sys/module/cpu_boost/parameters/input_boost_ms
command echo '0' > /sys/module/cpu_boost/parameters/input_boost_ms
Have fun!
EDIT: Added a Kernel Adiutor profile json zipped file as per suggestion.
https://drive.google.com/file/d/1mOdzGOI0f25NEQJLCS81nwqa-FCBq1sX/view?usp=drivesdk
Latest profile I am using with excellent results:
https://drive.google.com/file/d/13JFYnbjc7zxZed2Pgsp0KtdyiyOMICCO/view?usp=drivesdk

Turn off dt2w and pocket detection. I use my phone at work and it keeps coming on and randomly running apps, pocket dialing and opening the camera app. Very annoying for me.
Use Shortcut Master: https://play.google.com/store/apps/details?id=org.vndnguyen.shortcutmaster.lite
Select 3 dot menu > search for knock. Find the hidden menu in the list. Select launch and it will open a menu to allow disabling of this feature. (It also disables dt2sleep.
Select 3 dot menu > search for pocket. Same procedure as above.
This has probably been posted already but I wanted to post here. (Credit to reddit user spring45 https://www.google.ca/amp/s/amp.red...to_disable_double_tap_to_wake/#ampf=undefined)

Mmmm....

grantdb said:
Here are the settings I use for the stock Titan kernel (1.8):
Have fun!
Click to expand...
Click to collapse
Hi, not everyone can interpret the code. How'bout you just state the settings you choose instead. Thanks for sharing.

fi5z.x9 said:
Hi, not everyone can interpret the code. How'bout you just state the settings you choose instead. Thanks for sharing.
Click to expand...
Click to collapse
Will try if I get time.

Well I personally would prefer kernel Adiutor profiles.. You can export that and a user can import it.. That way you could even share several ones easily..
Jm5c
Sent from my LG-H815 using XDA Labs

Hi. Come to this post from Titan kernel one. I saw that this is about stock firmware v29a plus Titan kernel 1.7 for H812.
My question is, Can I use the Kernel Adiutor profile in my H815?

kinuris said:
Hi. Come to this post from Titan kernel one. I saw that this is about stock firmware v29a plus Titan kernel 1.7 for H812.
My question is, Can I use the Kernel Adiutor profile in my H815?
Click to expand...
Click to collapse
I don't see why not. They have the same options. Make sure you create your own profile in case something doesn't work. No matter what you can always flash the kernel again.

Related

Stock GB Tweaks Thread

what are some tweaks everyone is using on their stock F/W's?
I have removed:
sony sync, setup and guides, some of the stock apps that i don't use
added:
bravia engine (might remove due to suspicious battery consumptions)
misc tweaks:
build.prop
changed vm heapsize to 48m
added windowsevent line
added scripts to change read_ahead to 3072 (works best with my sccard)
disabled a lot of start up apps
hitting around 1372 in quadrant and 36-37 in linpack
what are some other tweaks that can be added that others are using?
Fps uncap by z. Im also want to removed bravia, could you show me how to do it pls?
Sent from my X10i using XDA App
teddymild said:
Fps uncap by z. Im also want to removed bravia, could you show me how to do it pls?
Sent from my X10i using XDA App
Click to expand...
Click to collapse
i just restored system from a previous backup
Im hoping an easier
Way. Tks anyway.
Sent from my X10i using XDA App
- prevent lag after boot if you have lots of pictures and don't use the 3D gallery at all but QuickPic or another alternative: install Rescan Media Root from Market.
Another way would be to simply rename the gallery but then adding images to contacts doesn't work.
- free root explorer: Estrong File Explorer, the root mode didn't work in 2.1, but it does now!
- AppWidgetPicker still works in GB (display submenus for widget selection instead of a long list)
- turning off the button leds still works in GB:
#! /system/bin/busybox sh
DIR=$(cd /sys && find | grep brightness | cut -c 3- | cut -d : -f 1 | head -n 1)
LED=/sys/$DIR
LEDB=$LED:sled/brightness
echo 0 > $LEDB
exit
zorglub08 said:
- prevent lag after boot if you have lots of pictures and don't use the 3D gallery at all but QuickPic or another alternative: install "Rescan Media Root" from Market.
Another way would be to simply rename the gallery but then adding images to contacts doesn't work.
- free root explorer: Estrong File Explorer, the root mode didn't work in 2.1, but it does now!
- WidgetPicker still works in GB (display submenus for widget selection instead of a long list)
- turning off the button leds still works in GB:
#! /system/bin/busybox sh
DIR=$(cd /sys && find | grep brightness | cut -c 3- | cut -d : -f 1 | head -n 1)
LED=/sys/$DIR
LEDB=$LED:sled/brightness
echo 0 > $LEDB
exit
Click to expand...
Click to collapse
Can you share WidgetPicker with me? I can't seem to find it in the market.
@OP - i was just about to start a thread like this!!
For those of us that would like to keep the stock rom and apply tweaks ourselves we need people that know the tweaks to share them! Should we use autokiller/sysctl for example?
How about spare parts with compcache/[email protected]?
i look forward to hearing what is possible!
@op, i set VM to 64, but not sure if there is a noticeable difference!
Sorry, it's AppWidgetPicker, I added the link now.
svtfmook said:
what are some tweaks everyone is using on their stock F/W's?
I have removed:
sony sync, setup and guides, some of the stock apps that i don't use
added:
bravia engine (might remove due to suspicious battery consumptions)
misc tweaks:
build.prop
changed vm heapsize to 48m
added windowsevent line
added scripts to change read_ahead to 3072 (works best with my sccard)
disabled a lot of start up apps
hitting around 1372 in quadrant and 36-37 in linpack
what are some other tweaks that can be added that others are using?
Click to expand...
Click to collapse
Hi, what do u mean "windowsevent line" ?
as quoted here in step 13. < this is from a tweaks guide for 2.1
For the thread, if you are experiencing problems downloading from your browser:
d/l astro file manager from the market, go into preferences (more/preferences) and tick the "enable browser downloads" box. this is not my find, I read it earlier somewhere here on xda
I direct rooted my fw and flashed Bravia engine, so far so good.
Is there any way to flash FPS uncap for stock ROM without the need of a new ROM?
Edit : Already done.
some hacks on mine
build.prop
HTML:
ro.telephony.call_ring.delay=1000
ro.mot.eri.losalert.delay=1000
ro.min_pointer_dur=100
mot.proximity.delay=750
dalvik.vm.startheapsize=64m
dalvik.vm.heapsize=64m
windowsmgr.max_events_per_sec=260
ro.FOREGROUND_APP_MEM=5120
ro.VISIBLE_APP_MEM=6144
ro.SECONDARY_SERVER_MEM=8192
ro.BACKUP_APP_MEM=8192
ro.HOME_APP_MEM=8192
ro.HIDDEN_APP_MEM=21000
ro.CONTENT_PROVIDER_MEM=23000
ro.EMPTY_APP_MEM=25000
create a new file without extension on \system\etc\init.d\ folder and name it to S96sdcardspeedfix
HTML:
#!/system/bin/sh
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;
if [ -e /sys/devices/virtual/bdi/179:8/read_ahead_kb ]
then
/system/xbin/echo "2048" > /sys/devices/virtual/bdi/179:8/read_ahead_kb;
fi;
if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]
then
/system/xbin/echo "2048" > /sys/devices/virtual/bdi/default/read_ahead_kb;
fi;
create a new file without extension on \system\etc\init.d\ folder and name it to 99SuperCharger - use busybox 1.18.2 and script manager for this
HTML:
due limit of characters to post, download the file attached and delete .txt
check this to find out more about SuperCharger
enjoy some of the "hidden" hacks out there
there´s so much more....search
as an addition to rendiero's post, results will vary depending on your sdcard. try other settings like 1024m, 2048m, 3072m, 4096m
svtfmook said:
as an addition to rendiero's post, results will vary depending on your sdcard. try other settings like 1024m, 2048m, 3072m, 4096m
Click to expand...
Click to collapse
yap, you´re right i forgot to mention that thanks
Stating the obvious but remove apps that aren't needed!
SEMCSettings
Livewallpapers
etc etc.
here's a list of stock apps that i haev found to be ok when removed (results may vary, you may have something installed/using may depend on some of these)
device-monitor.apk - error reporting
OMAClientProvisioning.apk - part of sony sync
OmaDatasyncService.apk - part of sony sync
OmaV1AgentDownloadServices.apk - part of sony sync
PcCompanion.apk - pc companion installer
POBoxSknPink.apk - skin for japanese keyboard
POBoxSknWood.apk - skin for japanese keyboard
SecureClockJava.apk - not sure what it's for, but i have had no problem after removing it
SemcCrashMonitor.apk - more error reporting
Sync.apk - part of sony sync
SyncWizard.apk - part of sony sync
usersupport.apk - teaches you how to use your phone
SEMCsetupwizard.apk - initial setup, once you've done it, you don't need this anymore
LiveWallpapersPicker.apk - live wallpapers
MediaWidget.apk - media widget
MusicWidget.apk - music widget
Japaneseime.apk - japanese keyboard
koreanime - korean keyboard
removing the above will have no effect on timescape/facebook integration (that i have found, everything has been working fine for me)
@rendiero: for the 2 tweaks 99SuperCharger and S96sdcardspeedfix,can you write a step by step please?
Because i am little confuse with busybox and script manager.
On the tuto in the links for supercharger i write some value like 6,16, ...
For X10 the value are same or?
I have add same line on my build.prop now my phone stuck on Sony Ericsson logo.
I need to restore my backup
Are you on any moded Rom? Cause as I understood this thread is for stock one. That may cause some instability issues?
sent from tapatalk on my Domm's mod rom
@Renderio, thanks for those, i will stop and try these later! the build prop is easy enough but will test the other 2 as well
thanks dude - you rule! please (all) let us know if any 'other tweaks/performance apps' can be applied - OR if they clash with any already stated (tweak conflicts where 2 process are doing the same thing, for e.g setcpu & other cpu app both doing the same tasks - you get my meaning i hope!!)
Thanks
The last 2 may conflict with wolf's Rom.
To use those you need to know witch files you must delete/change on it.
sent from tapatalk on my Domm's mod rom

[I9001] [SCRIPT] Zram script for arco's ICS build

Hello everybody,
I thought that ICS was a little bit slow on my SGS+ so I tried to tweak it.
This is when I came across the option compcache in the settings -> performance menu.
Only I found this option isn't w orking yet in arco's alpha 3 build, or isn't working anymore.
Either way I found out that zram0 is present on the device, so I created a little script with which you can set-up Zram.
Just put it somewhere you can browse to with Terminal Emulator.
Also make sure it's permissions are set to rwx-r-x-r-x.
After you set the permissions right, just execute with: ./zram start
Or if you want to stop the swapping again just give in ./zram stop
This is the code for the script:
#!/system/bin/sh
#
# Zram manager
# koudumrulez{at}gmail.com (PsychoGame)
case "$1" in
start)
echo 3 > /proc/sys/vm/drop_caches
echo 30 > /proc/sys/vm/swappiness
# get the amount of memory in the machine
mem_total_kb=$(grep MemTotal /proc/meminfo | grep -E -o '[[:digit:]]+')
mem_total=$((0,25 * mem_total_kb * 1024))
# initialize the devices
echo $((mem_total)) > /sys/block/zram0/disksize
# Creating swap filesystem
mkswap /dev/block/zram0
# Switch the swap on
swapon /dev/block/zram0
;;
stop)
# Switching off swap
swapoff /dev/block/zram0
;;
*)
echo "Usage: $0 {start|stop}"
esac
exit 0
You can just call the file zram, and then copy it on you're device for example you're SD.
I only used this script on ALPHA3 build. Maybe it works on others as well, but that's at you're own responsibility.
Greetings Psycho Game
Here I'am again.
There's been a little error from my side.
If you put this file on you're SD-Card you can't set the permissions right.
What I did was putting the file in /system/bin, so the full path would be /system/bin/zram.
I did this with ES File Manager, but you're free to use whatever file manager you like.
After this make sure the permissions are set to rwx-r-x-r-x in the file manager, or in the terminal you can do a "chmod 755 /system/bin/zram" without quotes.
The zram is now useable through executing the command: "/system/bin/zram start or stop".
You can also choose to mount the zram automatically with booting.
In this case you have to make a file called userinit.sh in the folder "/data/local/"
This file needs the following content:
#!/system/bin/sh
/system/bin/zram start
I also set the permissions of this file to 755 with "chmod 755 /data/local/userinit.sh" but I'm not sure if this is neccesary. Anyway it works.
Hopefully somebody can use this script as well. If you do, please leave a comment. Also if you have questions feel free to ask. I will keep an eye on this post.
And the question if this will work on Alpha 4, yes it does.
Greetings,
Psycho Game
Hi Psycho,
thanks for your effort.
I also saw that zRam is indeed not working on the latest Alpha 6 (i use the Galxy W / i8150 Build).
I had a look at your script and some other sources and enabled zRam on my deivce for testing purposes.
My conclucsion so far is, that there seems so be some major problem of interference with an other memory management policy.
Independent from the Size and Swapiness configuration - there is something going wrong hier i think
I watched the systems memory stats through proc/meminfo and free. Once the system is out of fresh memory, it begins swapping. zRam swap then getfs filled up quickly. Now the system gets extremely slow, i also had two restarts (likely in cause of some kernel panics from acute memory problems).
Will be difficult to track down the problem, my guessings so far:
- Interference with LMK, as it only indirectly knows about zRam
- Some kind of io block size might have been set to a bad value for the zram device
- CPU-load through compression simply much to high (unlikely, but have not checked it yet)
.. and plenty other possibilites
ATM, its definitely only a huge decrease in performance for me. What was your experience?
From the technical specs, i guess zRam should behave much better, so i really guess theres going something wrong.
Guess i found a possible reason for the bad performance.
I will write more details when i have the time to.
Just tried the above script on CM9 (build 0814) for Galaxy Exhibit 4G (a sister phone of Galaxy W as I understand it). I ran the script in the Terminal. Initially the performance became very bad after a period of time (especially after opened many apps). It almost looked like zRam made it worse once it got used for some storage amount. However, after I changed mem_total_kb from MemTotal to MemFree, and removed 0,15 for mem_total, the horrible slow down seemed to disappeared (even after I opened 5 apps at the same time).
any further refinements of this script?

[DEPRECATED] || [GUIDE] || [XSP] || Create Your Own Boot-LED Sequence ||

PEOPLE ON ROMS DATED ON OR AFTER JANUARY 2016 PLEASE DO NOT USE THIS. LOOK AT THIS POST FOR MORE INFO
Hey guys.
So, most of us have been using the SP since many months / couple of years by now and majority of us like the beautiful LED bar at the bottom and could probably even be the reason you've bought one.
So this guide here is another guide focused on that aspect of our phone. The LED Illumination bar.
As the title suggest, this guide will definitely help you learn how the Boot LED animation occurs and I will be giving you some tips and hints on how to create your own LED Boot sequence.
Requirements:
1) An Xperia SP rooted, bootloader unlocked, must be running a recent 5.1.1 LP ROM
2) An init.sh replacer template made by @Tomoms using @nosedive 's anykernel template (Which will be found in the attachments to this post)
3) Patience and a working brain and some more patience with a dash of common sense
4) A good editor like notepad ++ (if on windows) or gedit is more than enough for Linux distributions. (Make sure to enable line numbers in your editor. Mostly the option will be in preferences )
Firstly, I shall explain the file we are going to modify. The init.sh file.
(Note that this is my interpretation of the code and is 99% correct, however if at all there are mistakes in what I explain, please do mention so that I can correct it and update this post.)
So where is this init.sh?
This file is inside sbin folder of root directory of our phone. (/sbin/init.sh)
This init.sh is a part of the ramdisk which is in turn a part of our kernel
So to modify this init.sh , we directly need to edit the ramdisk (thus manually pushing edited init.sh into /sbin/ won't work)
Good. Now you know where this file is. So we proceed to the next step.
What is this file anyway?
It is a script file ( *.sh files are script files . Google for more info) that automatically runs at every startup.
Now what you need to do is download the init.sh zip , extract it ( Taken from AdrianDC's repo , attached below as init_sh_original.zip) and open it up with an editor.
Here are some things you need to keep in mind as you start reading it.
The Left LED of our phone is LED3
The Middle LED is LED1 and
The Right LED is LED2
Also
Code:
LED1_R_BRIGHTNESS_FILE
LED2_G_CURRENT_FILE
LED3_B_BRIGHTNESS_FILE
Here the letter in between both the underscores R/G/B stands for Red/Green/Blue colors
BRIGHTNESS_FILE is where we set the maximum brightness value ( value ranges from 0 - 255 so max we generally set is 255)
and CURRENT_FILE is the file where in we set the brightness of the LED at that time.
Now that you know this, let's get to the first important (relative to this guide) lines of the script.
At lines 6-24 ,
Code:
# leds paths
LED1_R_BRIGHTNESS_FILE="/sys/class/leds/LED1_R/brightness"
LED2_R_BRIGHTNESS_FILE="/sys/class/leds/LED2_R/brightness"
LED3_R_BRIGHTNESS_FILE="/sys/class/leds/LED3_R/brightness"
LED1_R_CURRENT_FILE="/sys/class/leds/LED1_R/led_current"
LED2_R_CURRENT_FILE="/sys/class/leds/LED2_R/led_current"
LED3_R_CURRENT_FILE="/sys/class/leds/LED3_R/led_current"
LED1_G_BRIGHTNESS_FILE="/sys/class/leds/LED1_G/brightness"
LED2_G_BRIGHTNESS_FILE="/sys/class/leds/LED2_G/brightness"
LED3_G_BRIGHTNESS_FILE="/sys/class/leds/LED3_G/brightness"
LED1_G_CURRENT_FILE="/sys/class/leds/LED1_G/led_current"
LED2_G_CURRENT_FILE="/sys/class/leds/LED2_G/led_current"
LED3_G_CURRENT_FILE="/sys/class/leds/LED3_G/led_current"
LED1_B_BRIGHTNESS_FILE="/sys/class/leds/LED1_B/brightness"
LED2_B_BRIGHTNESS_FILE="/sys/class/leds/LED2_B/brightness"
LED3_B_BRIGHTNESS_FILE="/sys/class/leds/LED3_B/brightness"
LED1_B_CURRENT_FILE="/sys/class/leds/LED1_B/led_current"
LED2_B_CURRENT_FILE="/sys/class/leds/LED2_B/led_current"
LED3_B_CURRENT_FILE="/sys/class/leds/LED3_B/led_current"
So basically, what these lines of codes say is nothing but the file locations for BRIGHTNESS and CURRENT of each LED with it's respective primary color.
Next on
Lines 55 - 126
Here, if the system detects a normal boot and not recovery, then these lines are executed in the script.
So we don't boot into recovery. But just do a normal reboot.
What happens here is
Firstly, see these lines
Code:
# LEDs activated
echo '255' > $LED1_G_BRIGHTNESS_FILE
echo '255' > $LED2_G_BRIGHTNESS_FILE
echo '255' > $LED3_G_BRIGHTNESS_FILE
echo '255' > $LED1_R_BRIGHTNESS_FILE
echo '255' > $LED2_R_BRIGHTNESS_FILE
echo '255' > $LED3_R_BRIGHTNESS_FILE
These basically set the maximum value of the LED's brightness we are going to use to 255
The command echo is one that gives / print if you may say and here > redirects the echo command onto the path given
Example: echo 'a' > abc.txt would make the file abc.txt have a added in it.
So here echo '255' > $LED1_G_BRIGHTNESS_FILE gives a value of 255 into the brightness file of LED1_G and so on.
So once all the LED's we are going to use are activated, it goes to the next path.
The one we're interested in.
The Animation/Sequence of LED's
See lines 65-125
Code:
# LEDs starting animation
echo '16' > $LED1_G_CURRENT_FILE
echo '16' > $LED2_G_CURRENT_FILE
echo '16' > $LED3_G_CURRENT_FILE
busybox sleep 0.05
echo '32' > $LED1_G_CURRENT_FILE
echo '32' > $LED2_G_CURRENT_FILE
echo '32' > $LED3_G_CURRENT_FILE
busybox sleep 0.05
echo '64' > $LED1_G_CURRENT_FILE
echo '64' > $LED2_G_CURRENT_FILE
echo '64' > $LED3_G_CURRENT_FILE
busybox sleep 0.05
echo '92' > $LED1_G_CURRENT_FILE
echo '92' > $LED2_G_CURRENT_FILE
echo '92' > $LED3_G_CURRENT_FILE
busybox sleep 1
echo '64' > $LED1_G_CURRENT_FILE
echo '64' > $LED2_G_CURRENT_FILE
echo '64' > $LED3_G_CURRENT_FILE
busybox sleep 0.05
echo '32' > $LED1_G_CURRENT_FILE
echo '32' > $LED2_G_CURRENT_FILE
echo '32' > $LED3_G_CURRENT_FILE
busybox sleep 0.05
echo '0' > $LED1_G_BRIGHTNESS_FILE
echo '0' > $LED2_G_BRIGHTNESS_FILE
echo '0' > $LED3_G_BRIGHTNESS_FILE
echo '0' > $LED1_G_CURRENT_FILE
echo '0' > $LED2_G_CURRENT_FILE
echo '0' > $LED3_G_CURRENT_FILE
echo '16' > $LED1_R_CURRENT_FILE
echo '16' > $LED2_R_CURRENT_FILE
echo '16' > $LED3_R_CURRENT_FILE
busybox sleep 0.05
echo '32' > $LED1_R_CURRENT_FILE
echo '32' > $LED2_R_CURRENT_FILE
echo '32' > $LED3_R_CURRENT_FILE
busybox sleep 0.05
echo '64' > $LED1_R_CURRENT_FILE
echo '64' > $LED2_R_CURRENT_FILE
echo '64' > $LED3_R_CURRENT_FILE
busybox sleep 0.05
echo '92' > $LED1_R_CURRENT_FILE
echo '92' > $LED2_R_CURRENT_FILE
echo '92' > $LED3_R_CURRENT_FILE
busybox sleep 1
echo '64' > $LED1_R_CURRENT_FILE
echo '64' > $LED2_R_CURRENT_FILE
echo '64' > $LED3_R_CURRENT_FILE
busybox sleep 0.05
echo '32' > $LED1_R_CURRENT_FILE
echo '32' > $LED2_R_CURRENT_FILE
echo '32' > $LED3_R_CURRENT_FILE
busybox sleep 0.05
echo '0' > $LED1_R_BRIGHTNESS_FILE
echo '0' > $LED2_R_BRIGHTNESS_FILE
echo '0' > $LED3_R_BRIGHTNESS_FILE
echo '0' > $LED1_R_CURRENT_FILE
echo '0' > $LED2_R_CURRENT_FILE
echo '0' > $LED3_R_CURRENT_FILE
Here we specify which LED gets which brightness and we give the delay in between a few brightness settings
Same as before
echo '64' > $LED3_G_CURRENT_FILE does nothing but give a value 64 to the current file of LED3_G
So what this does is give a definite value with which that respective LED glows
The next command here is
Code:
busybox sleep 0.05
Here busybox, is the same as the busybox we all know. And sleep is a command we give to busybox and the value we give after it is the time in seconds
So the above command is nothing but telling it to sleep for 0.05 seconds. This is same as giving a delay of 0.05 seconds.
Now that the required stuff is cleared out, let's see what's going on in there.
Firstly, all the LED's are given a definite brightness in Green , and the brightness is increased upto a value and then slowly, symmetrically decreased back until zero. Then even the brightness file of Green LED's are given zero because they aren't needed anymore.
So this gives a breathing effect into all of the LED's in a green color.
Same goes for the next part except, Green is replaced with Red, even at the end of this the LED's are given 0 to both Brightness and current files.
Okay that's done for this part of the code.
Next from lines 128 to 135 we see a breakage in our code, why is that?
Code:
# android ramdisk
load_image=/sbin/ramdisk.cpio
# boot decision
if [ -s /dev/keycheck ] || [ ! -z "$RECOVERY_BOOT" ]; then
busybox echo 'RECOVERY BOOT' >>boot.txt
# LEDs for recovery
busybox echo '100' > /sys/class/timed_output/vibrator/enable
These lines of code are to check whether we've chosen to boot into system or chosen to boot into recovery.
So incase the keycheck is toggled and the correct button combination is pressed, then it'll execute lines 131-171
Else
It'll go and execute 174 to end. These last two sequences(recovery / boot into android system), you will be able to interpret since I've told the basics above.
Now that you know the required stuff on how init.sh works and how the LED's are programmed into a sequence, the only thing left out is for you to unleash your creativity and change the LED positions, delay, brightness values, give combination of colors to a single LED at the same time to create a new color (other than RGB) and what not.
Hopefully you will be able to make your own custom Boot Sequence now.
It might not be easy and will take multiple tries for it to be quite perfect, but in case you do something wrong, all you need to do is just flash the old kernel and things will be back to normal
You attached a initsh_replacer.zip in the attachments, what am I supposed to do with it?
Simple.
To save the trouble of having to rebuild a kernel on a PC I've asked tomoms to slightly edit his tangerine kernel zip ( Made from nosedive's anykernel template) to suit for just and only replacing init.sh.
So what you've to do once you've made a custom init.sh is to extract that zip, go to the folder tools and delete the init.sh in there and replace that with the one you've made and compress both the META-INF and tools folder back into a zip file and flash it and enjoy your own custom boot sequence
If there are any queries or some part about this guide you didn't understand, please do reply to this thread. Also if you've made any custom boot sequence, please do share it here for everyone else to enjoy
Cheers and have fun
great guide really ....it's real simple ....and we needed this since a long time ....i'm so excited to do my own boot led's
p.s: if u read this thread and u didn't see the attachments because it's not there ...i told @Raienryu and he will add them soon ...so have patience
great work :good:
So after making it could you give me your work as a flashable zip?
flash- said:
great guide really ....it's real simple ....and we needed this since a long time ....i'm so excited to do my own boot led's
p.s: if u read this thread and u didn't see the attachments because it's not there ...i told @Raienryu and he will add them soon ...so have patience
great work :good:
Click to expand...
Click to collapse
Thanks for notifying me. I had created a duplicate thread by mistake and attachments got uploaded to the duplicate instead of here.
Now added them
anisingh62 said:
So after making it could you give me your work as a flashable zip?
Click to expand...
Click to collapse
The initsh_replacer.zip already has a modified boot LED but note that I made it at around 3 AM and isn't so great. But if you'd like to test it out, flash that.
In case you don't like it, extract the init_sh_original.zip , you'll find an init.sh in there.
replace this init.sh with the one in initsh_replacer.zip and flash it to get back original Animation.
@Raienryu Brilliant. Well organised, simple and so informative post, many thanks bro :highfive:
I Just have a question here please, we find that some apps like Gmail, Taptalk, etc.. can control these LEDs and also can change its colors. So, I wonder if we could have these LEDs to work with dialer just like the stock do (LEDs will turn on once a call being answered while the screen is on, and turn off if the screen off or call ended)? does this need mod to the dialer itself and is it hard to be implemented?.
OsGhaly said:
@Raienryu Brilliant. Well organised, simple and so informative post, many thanks bro :highfive:
I Just have a question here please, we find that some apps like Gmail, Taptalk, etc.. can control these LEDs and also can change its colors. So, I wonder if we could have these LEDs to work with dialer just like the stock do (LEDs will turn on once a call being answered while the screen is on, and turn off if the screen off or call ended)? does this need mod to the dialer itself and is it hard to be implemented?.
Click to expand...
Click to collapse
i think it does need some work ...and we were hoping adriandc port that to lp or cm13 if he have time(if he have time he will work on it)
okay my first attempt is going now ....if it was beautiful i'll upload it
edit: okay i made my first one and it was so much funny...i'll keep trying to reach doomkernel level
flash- said:
okay my first attempt is going now ....if it was beautiful i'll upload it
edit: okay i made my first one and it was so much funny...i'll keep trying to reach doomkernel level
Click to expand...
Click to collapse
In case you would want to see how DoomLoRD actually made it in his kernel, I've uploaded in attachments his original script for rainbow animation of his kernel.
The coding is a bit different from what we have now but the basic idea is the same.
Have a look at it
Most probably, he must've used a code/script to automatically generate symmetric gradual increase and decrease of the brightness of those colors. (Even I've done the same for the init.sh file in the replacer zip. Wrote 20 lines or so in C to get around 70 lines =D ) No way he would have sat down and written 6645 Lines
OsGhaly said:
@Raienryu Brilliant. Well organised, simple and so informative post, many thanks bro :highfive:
I Just have a question here please, we find that some apps like Gmail, Taptalk, etc.. can control these LEDs and also can change its colors. So, I wonder if we could have these LEDs to work with dialer just like the stock do (LEDs will turn on once a call being answered while the screen is on, and turn off if the screen off or call ended)? does this need mod to the dialer itself and is it hard to be implemented?.
Click to expand...
Click to collapse
Which file governs in the incall --'pre-call' actually-- LED working in the stock rom?? Has anyone tried finding it and copying it back?
LWWSaint said:
Which file governs in the incall --'pre-call' actually-- LED working in the stock rom?? Has anyone tried finding it and copying it back?
Click to expand...
Click to collapse
I think @Adrian DC could answer you
OsGhaly said:
I think @Adrian DC could answer you
Click to expand...
Click to collapse
Some idiot People are already eating away at his head about CM13 camera i dont wanna burden him, nd thus die..
Small notice guys
Now that CM has removed busybox in the latest builds of CM13, this flashable zip will not work. We don't even have an init.sh anymore. The sources have been changed.
Look at this commit for more info.
So please do not use this on any CM13/based ROMs dated on and after Jan 2016.
Most probably there will be no simple easy way to change boot LEDs like this anykernel template.
But if there is a way I find, I will update the OP.

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

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.
STAGE 1:
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)
https://drive.google.com/folderview?id=0BwdRTuyj12_yRk9Kcm1pZkxuZzg&usp=sharing
STAGE 2:
Full install:
I recommend you install my TWRP 3.02-2 version from here:
https://drive.google.com/open?id=0BwdRTuyj12_yWWp0SUpGV1pzT1k
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.
https://drive.google.com/open?id=0BwdRTuyj12_yd0s1QmNLRzdveFk
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:
Code:
CMD_SET_CPU_FREQ, SCN_APP_TOUCH, 403000
CMD_SET_CPU_CORE, SCN_APP_TOUCH, 1
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.
Code:
#!/system/bin/sh
### 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.
STAGE 3:
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.
http://forum.xda-developers.com/showpost.php?p=67242356&postcount=583
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
FwkPlugin
Network Assistant app
MiuiSDK - disable autostarts
AuthManager
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
Bubbles
com.android.wallpaper.holospiral
Live Wallpaper Picker
Music Visualization Wallpapers
Phase Beam
Photo Screensavers
*Miui MiWallpaper * keep if also keeping MIUI Home Launcher.
Xiaomi/MTK Apps:
Analytics
Assistant
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
com.miui.mipub
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.
FingerprintService
FPCSensorTestTool
FTPreCheck
FWUpgrade
gallery (com.mfashiongallery.emag daily wallpapers)
Games
Home screen
JeejenMIUIContainer
com.securitycore.miui_t (Tencent virus scanner plugin to Security Center)
KLO Bug report
LocationEM2
Metok
MI Account
Mi Cloud
Mi Credit
Mi Drop
Mi Home
MI Service Security Framework
Mi VIP
Mi Voice
Mi Wallet
Miravision
MTKAndroidSuiteDaemon
MtkFloatMenu
MTKLogger
Music
MusicFx
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)
SystemAd
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
Uniplay
UpgradeSys
VCalendar
Video
Voice Unlock
VoiceAssist
Weather
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.jeejen.knowledge
com.jeejen.store
com.ximalaya.ting.android
com.xiaomi pass
com.xiaomi.o2o
com.xiaomi.jr
Cheetah Mobile CleanMaster SDK + Cleaner - delete
NetworkLocation (com.baidu.map.location) 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
Documents
Google Keyboard - replace with something lighter - Hackers Keyboard v1.38.2 recommended
Google Pinyin input
Google Feedback
Google partnersetup
HTML Viewer
Email
Mail
Pico TTS
Print Spooler
com.android.browser.provider
PacProcessor
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.
Atci_service
Backup
Blocklist
com.mediatek.batterywarning
Download Manager
Google Contacts Sync
Google One Time Init
MIUI SDK (don't freeze)
MTK NLP Service
Notes
One Time Init
Sim Toolkit
Themes (Theme Manager)
Updater
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:
/vendor/lib
libfingerprint_tac.so
libfpcalgorithm.so
/vendor/lib64
libcom_fingerprints_productiontestmanager.so
libcom_fingerprints_sensor.so
libfingerprint_tac.so
/system/lib
libcaFingerPrintShared.so
libcom_fingerprints_service.so
libfamily_jni.so
libjeejenAisound.so
libjeejenmsc.so
libMiraVision_jni.so (if deleted MiraVision App)
libpatcher_game_jni
libvoicerecognition.so (if voice recognition apps deleted)
libvoicerecognition_jni.so (if voice recognition apps deleted)
libweibosdkcore.so
libwhetstone_jni.so (if deleted Whetstone App)
libwhetstone_sdk.so (if deleted Whetstone App)
libxiaomimediaplayer.so (if xiaomi media player deleted)
libxiaomimediaplayerwrapper.so (if xiaomi media player deleted)
/system/lib64
libairtunes_jni.so
libairtunes.so
libBankCardRecognizer.so
libcaFingerPrintShared.so
libcom_fingerprints_service.so
libduokantext.so
libjni_latinimegoogle.so (if deleted Google keyboard)
libjni_pacprocessor.so (if deleted PacProcessor)
libMiraVision_jni.so (if deleted MiraVision App)
libpatcher_game_jni.so
libttspico.so
libweibosdkcore.so
libwhetstone_jni.so (if deleted Whetstone App)
libwhetstone_sdk.so (if deleted Whetstone App)
libxmpass_sdk_patcher.so
xmpass_libweibosdkcore.so
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!
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:
https://drive.google.com/file/d/0BwdRTuyj12_yYlphU3A0UWprcXc/view?usp=sharing
Modify MIUI Homescreen grid:
https://mega.nz/#F!yJdkxbBa!WSIqrhwUQwD7qjzxOuo1Yw
Issues:
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!
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.
/system/app
ApplicationsProvider
AtciService
AutoDialer
BSPTelephonyDevTool
Bluetooth
CaptivePortalLogin
CertInstaller
DeskClock
DownloadProviderUi
DrmProvider
EngineerMode
EngineerModeSim
FM
GoogleCalendarSyncAdapter
GoogleContactsSyncAdapter
KeyChain
MTKThermalManager
MiuiCompass
NetworkAssistant2
NlpService
Omacp
PackageInstaller
Provision
SuperSU
SystemHelper
ThemeManager
Updater
UserDictionaryProvider
WebViewGoogle
XiaomiServiceFramework
YGPS
cit
mcRegistry
miui
miuisystem
/system/priv-app
AuthManager
BackupRestoreConfirmation
BarcodeScanner
CDS_INFO
CalendarProvider
ContactsProvider
DefaultContainerService
DownloadProvider
ExternalStorageProvider
FusedLocation
GoogleBackupTransport
GoogleLoginService
GoogleOneTimeInitializer
GoogleServicesFramework
InCallUI
InputDevices
ManagedProvisioning
MediaProvider
MiuiCamera
MiuiGallery
MiuiKeyguard
MiuiSystemUI
MmsService
OneTimeInitializer
Phonesky
PrebuiltGmsCore
ProxyHandler
SecurityCenter
Settings
SettingsProvider
SharedStorageBackup
Shell
Stk1
TeleService
Telecom
TelephonyProvider
VpnDialogs
WallpaperCropper
com.ghisler.android.TotalCommander ### Total Commander installed as system app
com.hb.dialer.free ### True Phone replacement for Xiaomi Contacts & Dialer
org.adw.launcher ### ADW Launcher installed as system app
Other base apps in /data/app:
com.google.android.apps.messaging ### replacement Google Messenger
com.google.android.calendar ### replacement Google Calendar
com.duokan.phone.remotecontroller ### 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
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?
@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
I have tried this:
http://forum.xda-developers.com/red...d-enable-clearmotion-miui-based-roms-t3278552
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.
persist.sys.display.clearMotion=1
persist.clearMotion.fblevel.nrm=255
persist.clearMotion.fblevel.bdr=255
ro.mtk_clearmotion_support=1
ro.mtk_slow_motion_support=1
ro.mtk_16x_slowmotion_support=1
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.
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
@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:silly:
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_instead=1
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.
MIUI 7.1.4 and I assume all other versions has a very old and incomplete version of busybox installed (I think it was v1.20?).
It does not have fstrim command (plus a few others) included which is why I recommend updating.
I tried init.d and 01_tweaks script (whith correct permissions).
The system is more time in 806 Mhz., deep sleep not works properly.
I use Stable 7.1.1 .
Deleting script, deep sleep works fine.
Need I install or update busybox for resolve my issue?
@Xabadou This script is the starting point. If you do not "skinny down" MIUI, there are so many things running in the background that you will find it difficult to sit on idle frequency.
How far into skinnying down have you gone?
Also, if you have a 2.2GHz cpu, the 2nd line below frequencies in bold must be modified to valid frequency for that cpu.
If you are not going to skinny down to a great extent, then it helps to bump some of the load settings up a touch.
These are the original lines:
echo 80 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 90 403000:70 806000:81 1183000:84 1326000:87 1469000:90 1625000:93 1781000:96 1950000:99 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
# for 2.2GHz cpu: echo 90 403000:70 806000:81 1183000:84 1326000:87 1482000:90 1664000:93 1885000:96 2158000:99 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
Modify to:
echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 95 403000:75 806000:81 1183000:84 1326000:87 1469000:90 1625000:93 1781000:96 1950000:99 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
This is enough to get it to sit on 403MHz idle in most cases. If you go higher, you will start compromising smoothness. There are no problems at all with entering deep sleep.
If you are still having problems, you have an app running that is badly behaved - identify it and deal with it.
Refer back post #10, I mention why you should upgrade busybox.
I am running my phone beyond Super Skinny and loving it. Super stable and battery friendly while still being a performance beast. You should notice even at the point of trimming down to Skinny, this phone really starts to liven up.
jajk said:
I am running my phone beyond Super Skinny and loving it. Super stable and battery friendly while still being a performance beast. You should notice even at the point of trimming down to Skinny, this phone really starts to liven up.
Click to expand...
Click to collapse
Do you have a list of the apks (and directories) that you deleted in order to get the skinny ROM? Such a list would be useful for writing a script to automate the task.
P.S.: you might have noticed that I am a script fanatic - I generally find that it is less error-prone to automate such tasks with a script - and you only need to get the script right once.
I use stable 7.1.1 by xiaomi.eu whith your modded kernel and a lot of apps frozen (App Quarantine).
Modified kernel works very good.
Just now I have updated busybox.
I have 2.0 ghz version.
I will try again the script.
Clear Motion mod works fine in MIUI roms but you must use MX Player for play videos.
---------- Post added at 01:20 PM ---------- Previous post was at 01:11 PM ----------
persist.sys.use_qualcomm_performance_features_inst ead=1
Works qualcomm tweaks whith mediatek processors?
@DarthJabba9 The lists ares already mentioned - 1 to get to skinny, 1 to get to super skinny but if you do this in a script on a live system you will likely end up in a bootloop because there are too many odex and cache entries orphaned for Android to handle in one hit. If you intend to apply a script to the ROM files before installation, that is a different story. It takes a bit of effort to figure out how and where MIUI is loading a lot of its components from but is doable.
Why I have not offered a complete ready to go package? It is too easy for users to do it themselves and add their preferences along the way. For those that have actually followed through with the process, I can guarantee that they will instantly loose interest in any other custom ROM.
@Xabadou Thanks for the clarification on ClearMotion. I run VLC set to hardware acceleration and can't see the split screen test mode. Video looks fine regardless, so really hard to tell if anything has changed.
Do the apps that you quarantine stay not running? I had problems with quite a few apps running regardless of being frozen or not so had to uninstall.
You, along with everyone else are not running a modified kernel - the kernel remains intact since we do not decompile and recompile or compile it from source.
The "persist.sys.use_qualcomm_performance_features_instead=1" tweak is a sarcastic dig at the many tweak offerings that do absolutely nothing:silly:
You asked the question showing you were not ready to accept this at face value:good:
If there is no evidence of a tweak doing something positive, don't blindly use it!!!
This is a customized boot image that provides init.d support and has unnecessary entries removed. No tweaks are embedded.
It is built on 7.1.4 and can be used on stock 7.1.1 to 7.1.4.
https://drive.google.com/file/d/0BwdRTuyj12_yR3phb0Zxd05UQjQ/view?usp=sharing
credits to @DarthJabba9 for the alternate init.d support method adopted in this image. It circumvents using busybox run-parts method that appears to have some bugs.
jajk said:
@DarthJabba9 The lists ares already mentioned - 1 to get to skinny, 1 to get to super skinny but if you do this in a script on a live system you will likely end up in a bootloop because there are too many odex and cache entries orphaned for Android to handle in one hit. If you intend to apply a script to the ROM files before installation, that is a different story. It takes a bit of effort to figure out how and where MIUI is loading a lot of its components from but is doable.
Why I have not offered a complete ready to go package? It is too easy for users to do it themselves and add their preferences along the way.
Click to expand...
Click to collapse
Fair enough ...
jajk said:
I will share my custom Super Skinny MIUI boot.img based on MIUI7.1.4 since it is now stable ... It is unpacked and repacked using AndroidMasterChef (downloaded from Needrom). I do not have problems unpacking and repacking again. If you try to unpack and have problems, use the same tool.
Click to expand...
Click to collapse
Thanks for the image. It cannot be unpacked with standard linux tools, but it unpacks ok with AndroidMasterChef.

How to downclock the CPU of J320F to save power ?

Hello everyone , i have installed the RR ROM on J320F ! and i would like to limit CPU frequency to save power .
I tried several apps but none of them worked .. the system keeps changing the settings back.
Is there a way to do that ?
Thank a lot
With the latest version you can choose the low power mode to set the maximum at 1350MHz ... it's a first try so I'm not sure of all.
djeman said:
With the latest version you can choose the low power mode to set the maximum at 1350MHz ... it's a first try so I'm not sure of all.
Click to expand...
Click to collapse
Thanks for your reply Djeman.
Yeah i know that..But i would like to reduce it more.. 900 Mhz for example?! can I ?!
is there a way to change the whole cpu government?!
Change all nope, it's only interactive for now.
And all settings for the interactive mode are here => https://github.com/djeman/android_d...cm-14.1/rootdir/etc/init.j3xnlte_base.rc#L138
"hispeed_freq" is the value set in low power mode => https://github.com/djeman/android_v...en-source/libs/power/power_interactive.c#L218
You can set 900MHz, it's one of the 4 values defined for the cpu => https://github.com/djeman/android_d...s/base/core/res/res/xml/power_profile.xml#L20
I'm talking about the max frequency I don't know why but i can't set it to a values other than 1500 or 1350Mhz.. i can change the hi_freq to whatever i want but the the max frequency no ! so the cpu most of the time goes above that limit (hi_freq).
Because the max frequency do not changes, it's always 1500.
We have a scaling on 5 values and cpu hotplug to disable cores.
The value you can set is the scaling max frequency.
Available frequencies are here:
Code:
j3xnlte:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
1500000 1350000 1200000 900000 768000
You can set the maximum here:
Code:
j3xnlte:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1500000
In low power I set it with the driver at 1350 (hispeed_freq value):
Code:
j3xnlte:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1350000
Really sorry Djeman !! .. but i could not change it !!
Every time i change it with rootbrowser it change back to the original value
I tried TRWP Terminal but /sys partition seems to be Read-only i don't know !
same thing with adb shell !
I need to enhance my power driver ^^
With a new power mode between low and balanced profil and better profiles.
I found some examples in others projects => https://git.sphere.ly/dtc/device_motorola_msm8226-common/blob/m-dtc/power/power.h
But to enhance it I need to understand all parameters :x
You will find everything here if you want :
https://forum.xda-developers.com/galaxy-s2/general/ref-kernel-governors-modules-o-t1369817
You are right , it's a heavy task to tweak governor ! Especially if you cannot find any documentation online .
I had headache trying to modify system files.
There's some running services that restore defaults values everytime i edit them.
I'm giving up ??
Solved
Heyy @djeman , i have finally succeeded in setting up the frequency limit .
there is another file that should be modified simultaneously with "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" .. this one :
/sys/power/cpufreq_max_limit
But apparently,you should first set the min frequency then the maximum otherwise the cpu will be locked in a single frequency.
I don't really know how and why ... but this works for me!
Here is my settings :
Code:
echo "768000" > /sys/power/cpufreq_min_limit
echo "768000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "900000" > /sys/power/cpufreq_max_limit
echo "900000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "900000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
The CPU freq now is oscillating between 768 and 900 MHz cos the hispeed_freq and max are the same.
it is on 768 and on Demand ( 85 % loaded indicated here /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads ) they scale up to 900Mhz.
I don't need 1500 Mhz .. I'm not running 3D games here or whatever
Hope these informations will be useful for someone
Yep all the discussion will be useful, you speak with the main dev
In one of the next update I will add a low power mode with your settings and a new mode between low and normal with my little downclock at 1350.
For now I'm analizing how works the fast dormancy, I think it's a good feature to reduce battery draining.
Fast Dormancy ! it's the fisrt time that i hear about this !
it seems effecient.
Good luck with that ?
Setcpu app not work
may be must custom in kernel
minhngt said:
Setcpu app not work
may be must custom in kernel
Click to expand...
Click to collapse
No , these apps will not work .Actually you don't need them.
If you want to Overclock the CPU than you can't .The current kernel doesn't support that yet.
But If you want to downclock the cpu you can create an init.d file that contains the script posted above with your preferred interactive governor settings.
Can you shown me the way to do it?
Tks so much^^
the easiest way( maybe ) :
1- Install ES File Explorer
2- Open ES explorer menu and scroll down and activate "root explorer" option (of course you must have rooted the system first).
3- Browse to /etc/init.d folder and create a new file with any name you choose (without extension)
4- copy and past these lines there :
Code:
echo "768000" > /sys/power/cpufreq_min_limit
echo "768000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "900000" > /sys/power/cpufreq_max_limit
echo "900000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "900000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
5- Replace the max frequency 900000 Hz with whatever you want from these (768000,900000,1200000,1350000,1500000) and save the file.
6- Select the file, click 'properties' , click 'change permissions' and check the execute properties.
7- that's all .. Enter the developer options and activate "show cpu infos" to make sure that the frequency has been changed.

Categories

Resources