yashsingh1/xdaforums huggingface dataset:
[Redmi Note 2 Android Development] jajk:
While the skinny boot images strip away unneeded services, logging, debugging etc. from the lower O.S level, I have been playing with stripping out debugging and logging from the higher level O.S files with some good reduction in the background level of cpu load which is rather high in all MTK based devices. The problem seems to be that MTK provides engineering sample of code to the OEMs who are meant to refine it for their device then remove or turn off the unbelievable amount of logging and debugging. The bottom-dwelling OEMs just add their extra layers and bloat on top without lifting a finger to tidy up the MTK code - no fault of MTK - it is the fault of OEMs that have no software engineering capability or interest in supporting their product (or at least the devices with their brand stamped on them).

Now the tricky bit..... I can decompile files, change settings to turn off logging and debugging, then recompile. It is a big effort which is O.K to amuse myself on my own phone but I don't feel like offering it to everyone and for every ROM that pops up.

What I will do, is make public the information required to do this for yourself - Warning: effort on your part required.

As always, I am not into helping you setup for decompiling / recompiling etc. If you can't do it for yourself, this is not for you - go bother a CM/LOS/Flyme thread instead;)

To lessen the amount of debugging and logging activity caused by high level O.S files:

Decompile framework jar files. Target from largest to smallest to maximize the results for effort. Do these before moving onto apk files.

Decompile MIUI system apps like Settings.apk that are likely to also contain large amounts of debugging / logging code. Check that you can recompile without edits first to avoid wasted effort.

Search only in smali or smali_classes2 folders for files that have the following terms: (case does not matter)

logd:z

logv:z

dbg:z (includes instances of vdbg:z)

debug:z

We are only interested in lines which are

static fields

- do not edit any other instances!!!

We change any lines that have = true to = false and any line without a parameter to = false also.

Example:

# static fields

.field protected static final DBG:Z = true becomes .field protected static final DBG:Z = false

.field private static final VDBG:Z becomes .field private static final VDBG:Z = false

Do not alter lines under

# instance fields

or under any other label.

Recompile the files and copy to /system/framework

The phone will soft reboot when it detects a change in size of any framework file - ignore this and do a proper hard reboot. The boot will always be very slow because Dalvik Cache gets rebuilt.

If you are doing a lot of files, it is easier to copy them all across using TWRP recovery to avoid the painful reboots.

That's it!!! You can now compare the screenshot you took before doing any of this with the screenshot of cpu activity afterwards:laugh: Or maybe just compare it to mine....

Let's see how long this one takes to be plagiarized across the globe.....
[Redmi Note 2 Android Development] DarthJabba9:
Seems like a lot of work. I'll make do with whatever you feel like releasing ;)
[Redmi Note 2 Android Development] Adam Hui:
Since i'm a skinny follower & been using the tweaks in cm13. U can treat this as a propaganda :silly:

EDIT : oh my batt is in cold !
[Redmi Note 2 Android Development] jajk:
[MENTION=5850987]DarthJabba9[/MENTION] With Notepad++ "Find in Files" it is not too difficult. I have attached what I am going to release. Enjoy:)

[MENTION=4666525]Adam Hui[/MENTION] That looks like a pocket and hand warmer - great job re-tasking the RN2:good:
[Redmi Note 2 Android Development] Adam Hui:
in noticed that yours in a trickle charge.. :rolleyes:

Hope u would like give the magic in non stocks..
[Redmi Note 2 Android Development] jajk:
[MENTION=4666525]Adam Hui[/MENTION] I notice that yours still has kernel problems displaying incorrect battery temperature, charging incorrectly, graphics accelerator problems, no compass etc..etc..

When there is a viable non-stock ROM available, I will switch to supporting it 100%. Until then, I let the children play grown-ups in their own sandpit:laugh::laugh::laugh:
[Redmi Note 2 Android Development] Adam Hui:
huh such cruel words...:laugh:

I feel it accepteable since nfnh 's rn2 componetnts based such fortunately almost same like mine. I dont need a compass on a phone, charging speed seems normal for me though i missed miui fastcharge (not such slow as many 6.0 posts) & very rare graphical glitches treat as an blitz alarm for my sleepy eyes while reading my country's timeline :eek:
[Redmi Note 2 Android Development] jajk:
[MENTION=4666525]Adam Hui[/MENTION] Don't take it to heart - I am just stirring you up - maybe shock you out of persevering with the lost cause and the wannabes circling like vultures over the rotting corpse looking for scraps of respect for free.
[Redmi Note 2 Android Development] Adam Hui:
Dont worry. Nothing as it seems ;)
[Redmi Note 2 Android Development] Gyovany96:
[MENTION=5952980]jajk[/MENTION] Check this out !

Doze

on MIUI ROMs..?!
[Redmi Note 2 Android Development] DarthJabba9:
Looks very interesting - if it works.
[Redmi Note 2 Android Development] vaselor:
[MENTION=5952980]jajk[/MENTION] What's that app for measuring cpu activity? Thanks
[Redmi Note 2 Android Development] Iliyena:
First page loaded when starting Kernel Auditor ;)
[Redmi Note 2 Android Development] cukierkas:
Yes, that's a good finding, bet for those, who doesn't have such knowledge, as apk structure and editing to make workable - my suggestion is simply to use greenify :)

It does work brilliantly ;)

Išsiųsta iš mano Redmi Note 3
[Redmi Note 2 Android Development] jajk:
[MENTION=5216574]Gyovany96[/MENTION] Not present on a couple of ROMs I checked. Maybe only applicable to Android 6.0 or the very latest ROMs?

I have noticed Doze code creeping into MIUI ROMs recently but so is a lot of stuff that is not necessarily for our phone.
[Redmi Note 2 Android Development] Adam Hui:
Greenify was just automating switched on & off some skinny philosophy while it will stay resident in your ram against that, use quite batt routinely while phone sleep or switched idle. Look at its size, ram consumptions & ofcuz batt drain from itself.

I think it just like option to using kernel adiutor or while we just can edit build.prop & chip in init.d.script to handle all acts.
[Redmi Note 2 Android Development] Gyovany96:
[MENTION=2606021]cukierkas[/MENTION] Yep , I use Greenify too and also recommend it into my thread :D

[MENTION=5952980]jajk[/MENTION] Yeah , most probably is for 6.0+ as it is from an RN4 thread... I think that code is present into latest builds framework as Xiaomi kindda use an "universal" framework for most of their device , with very small modifications.

[MENTION=4666525]Adam Hui[/MENTION] Not really... Since I started use Greenify I get better battery and of course all the rubbish background running apps ( Facebook-150mb RAM etc. ) are gone wich give me more RAM obviously. Greenify doesn't use too much battery at all and it's RAM consumption is about 30mb wich for this light size it really does his job very good :)
[Redmi Note 2 Android Development] Adam Hui:
So does anyone know the aliened secret of greenify done which we can implement as native skinny collections ?

For ex FB as one quite heavy sample entertaintment or marketing apps (at least for me), i just disable notification, autostart, etc. etc & i had have tiny-winy size & ram disableService which not trigerred autostart & non stay resident, it works when u call then permanently push the changes, to cut most unbeatable spying missions.
[Redmi Note 2 Android Development] Gyovany96:
I disabled Facebook notifications , autostarts etc. too but sometimes it still magically appear in background to kill my phone.. That's when Greenify apears to "calm it down" !

Unfortunately I have no idea about Greenify tricks.. A simple observation would be that he just "Force Stop" apps :p
[Redmi Note 2 Android Development] jajk:
[MENTION=5216574]Gyovany96[/MENTION] I notice that Doze requires a lot of resident Google crap and needs active network connection plus sensors running so would eat the battery while pretending to save it. Looks more like Google embedding itself further into your life rather than any actual benefit - exactly the type of stuff Xiaomi have done in MIUI:mad:
[Redmi Note 2 Android Development] Gyovany96:
Well that s*cks !

At least we know from where Xiaomi "learned"...
[Redmi Note 2 Android Development] jajk:
[MENTION=5216574]Gyovany96[/MENTION] Xiaomi actually uses some Google code to achieve their obsession with pushing ads and stealing your data.

So who is the most evil? The company that develops and sells the tools or the companies that use the tools?

The answer to why Google changed it Corporate motto is in there somewhere;)
[Redmi Note 2 Android Development] Gyovany96:
That's a good question ! Unfortunately that data stealing it's inevitable , I think we all know that... One thing it's certain :

we are all victims

!
[Redmi Note 2 Android Development] RenatoNismo:
after searching here in thread and google, I don't find exactly how to install or flash boot.img....

yes, it's not for noobs, but with right tutorial like installing custom rom and recovery, everyone can do it....

without of it, I took risk and installed .img and it stucked at mi logo. tried to put in zip and same thing.

I'm with Skinny V2 reflashed, waiting to try out this to see how is battery life.

thanks.
[Redmi Note 2 Android Development] Gyovany96:
Never put Skinny Boot into any ROM.zip

! The ROM must boot once with the default boot.img and then you can flash the Skinny Boot , otherwise you'll get an bootloop !

I guess you installed it just like any other .zip , right ? You practically wiped your system doing that :p

To flash Skinny Boot you need to go into TWRP -> Install -> Install image -> select Skinny Boot then check 'boot' box and flash ! See attached pictures ;)
[Redmi Note 2 Android Development] RenatoNismo:
that's weird, when I flashed Skinny V2, I used it for a while for testing, then I went to recovery to flash Custom Boot,

without any knowledge about related flashing boot, I saw "install .img" and "boot box", these would fit what I needed, very obvious.

rebooted and the Mi was stuck for really longer. I thought I did something wrong.

SkinnyV2 8.3 Beta - xiaomi.eu

Skinny PRO 7216 v26

these downloads are latest.

I'm gonna try it again.
[Redmi Note 2 Android Development] Gyovany96:
It should work , that's exactly what I use too !

Important steps

before flashing

Skinny Boot : ( also into O.P. )

1. Edit build.prop :

- ro.mtk_perfservice_support=0

- persist.radio.multisim.config=ss (

only

if you're using just

1 SIM

)

2. Go to Developers Settings and disable Memory Optimize and MIUI Optimization !
[Redmi Note 2 Android Development] jajk:
Skinny_Pro_7223_Tweaked-v26.img uploaded

No changes apart from rebasing on 7223

A tip for those that do not have the (infamous) Atmel CTP (capacitive touch panel):

Look here to figure that out: /sys/class/devmap/devmap/devinfo then:

Delete /system/bin/init.atmel_ts.sh for a much faster boot time:)
[Redmi Note 2 Android Development] DarthJabba9:
Unfortunately, I have it :(. I also have the auo LCM. I don't know whether to cry or scream. :eek:
[Redmi Note 2 Android Development] رامز:
Done... Couldn't feel any difference in boot time but at least our ship has freed from another unneeded load ;)...BTW I've tried your recommendation about framework res but found all resources talking about apktool (windows) for recompiling it,unfortunately my PC runs Ubuntu so is there any android app that can edit framework ?
[Redmi Note 2 Android Development] luchaninoff:
Good evening, for Prime version is necessary to delete the line

### CPU freqs standard RN2: 403000, 806000, 1183000, 1326000, 1469000, 1625000, 1781000, 1950000

### GPU freqs standard RN2: 253500, 299000, 390000, 442000, 546000

or use without changes???
[Redmi Note 2 Android Development] asusm930:
Just leave them. They do nothing but show you what are the supported CPU speeds :D
[Redmi Note 2 Android Development] jajk:
[MENTION=5850987]DarthJabba9[/MENTION] I think the auo screen is the best of them and the atmel touch, the worst. So your choice whether to laugh or cry.

[MENTION=5535456]رامز[/MENTION] That script will hold up one core for 5 secs so is a useful energy saving and allow that one core to do something else during boot. Since Skinny defaults to 5 cores max, every available core comes in handy;)

I believe there are plenty of tools to use under linux. Some are on XDA - just search. Apktool (not apktool.apk) is java and works for any O.S that has java installed.

[MENTION=5684171]luchaninoff[/MENTION] Yes leave them. The # character is used to disable anything that comes after it on that line. It is used to add comments and titles as well as disable lines.
[Redmi Note 2 Android Development] DarthJabba9:
Well, at least something in my phone is almost acceptable :victory: - but, right now, I don't feel like laughing - and I am also not quite ready to change my phone yet. It is still alive, and all seems well with it so far.
[Redmi Note 2 Android Development] dsjiffry:
Hey jajk awesome thread I managed to set most of the settings but the build prop change doesn't seem to stop the system from overwriting the hotplug settings. (HTC helio X10 device). :eek:

So I changed the perfservscntbl.txt and reduced the touchboost and that works great. Also applied the other tweaks.

What I need is some good interactive governer parameters for my device since I assume the ones you have given work best when the other settings are also applied. I should mention that hispeed_freq is also locked at 1183 MHz the system keeps restting that too....... :crying:

I have the slower varient of the Helio X10 (max. Freq 1950MHz.)

Thanks in advance.:laugh:
[Redmi Note 2 Android Development] jajk:
[MENTION=5997739]dsjiffry[/MENTION] I assume you have root but do you have TWRP recovery and init.d support? What Android version are you running?
[Redmi Note 2 Android Development] dsjiffry:
Yeah I have TWRP and init.d

Running 6.0 marshmallow....... I was planning on entering the settings via Kernel Auditor.
[Redmi Note 2 Android Development] Adam Hui:
There's no perservcntbl.txt in any 6.0 rom, u need only disable perserv in build.prop

This is my init.d.script with satisfying batt adopted what per jajk's said in this thread.
[Redmi Note 2 Android Development] Adam Hui:
Just remove .txt

No need kerneladiutor or any kernel editor app, wasting the ram.
[Redmi Note 2 Android Development] jajk:
[MENTION=5997739]dsjiffry[/MENTION] Some settings may refuse to stick because the permissions on the files that get changed are wrong. I had to alter the permissions for Hotplug and LMK settings in the boot.img itself and alter the timing of when settings get applied so they don't get overwritten. Post your boot.img and I might be able to give you the functionality you need.

[MENTION=4666525]Adam Hui[/MENTION] The offer doesn't apply to RN2 6.0 boot.img because it is a mess in progress.
[Redmi Note 2 Android Development] Adam Hui:
Fortunately my result said synchronized with kernel adiutor said, at least cpu & gpu config (min, max, cored, hps boost, interactive gov tweaks), entropy & scheduler, etc. Batt seems to be nicer.

Or there's still always refusing words like just lucky, placebos or misinterpretted... :D
[Redmi Note 2 Android Development] dsjiffry:
Could you tell me the location of the boot.img file???
[Redmi Note 2 Android Development] jajk:
[MENTION=5997739]dsjiffry[/MENTION] Either in the ROM file that you installed or if that is not accessible, pick it out of a TWRP backup that includes the boot partition or do a TWRP backup of just the boot partition to get the boot.img.
[Redmi Note 2 Android Development] Adam Hui:
This is the latest changes & fixed kernel6.0 by [MENTION=6296775]Dinolek[/MENTION]

If u have focaltech touch, u just need to add this line in init.d.script to enable dt2w :

echo 1>/sys/android_touch/doubletap2wake
[Redmi Note 2 Android Development] jajk:
[MENTION=4666525]Adam Hui[/MENTION] and does that work on a HTC phone? I think not:rolleyes:
[Redmi Note 2 Android Development] Adam Hui:
Your scripts seems run universally on all mtk6795 devices, congrats engineer..:cowboy:

Even some except cores & hps capable to adopted to any mtk !!

EDIT : OT, hey i just tried to adopted it in RN 4G Dior, snapdragon 400, but resisted by closed source Qualcomm MPdecision feature which always turn back default all my cpu setting. Can u pls gimme any changes to skinny tune its interactive gov ? Like we done with 6795 maybe...
[Redmi Note 2 Android Development] jajk:
[MENTION=4666525]Adam Hui[/MENTION] I was referring to the RN2 boot.img you posted - it wont work on a HTC phone.

MPdecision works O.K as it is - unlike HPS for MTK.

Interactive Governor should be working more fully (including all boost settings) than it does for MTK.

You won't be able to limit the number of cpu cores but you can set min and max cpu freqs and all other values.

If you can't, it is because permissions are set to 0220 on the files that need to be written to. Nothing can fix this except unpacking the boot.img, editing the appropriate init file and repack. This is within your capabilities.

With the SnapDragon 400 SoC, you will need some boosting via hispeed_freq to get it off the mark without too much lag. I have same SoC in Moto G so am quite familiar with it.

Start with something like this:

#!/system/bin/sh

# Tweak Interactive Governor
echo 998000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq # factory default 1190400
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load # factory default 99
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/target_loads # factory default 90
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate # factory default 20000
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time # factory default 80000
echo 10000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay # factory default 20000
echo 80000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack # factory default 80000

echo 1190000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq # factory default 1190400
echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # factory default 300000
[Redmi Note 2 Android Development] jajk:
RN2 out of action until battery replacement is sorted - first purchase never arrived so I have to start again:(

The LCD display was being severely bent due to the lack of chassis and swollen battery. I didn't want to end up with a bust touchscreen so out came the ballooning battery.

Luckily I have what turns out to be a superior Ulefone BT3 as a backup - it has a genuine Sony battery, Sharp LCD, Sony camera, CNC machined metal chassis, naked Android etc. etc.

Who would have thought that a (once crappy) Samsung fake manufacturer previously called Star would outclass Xiaomi by a huge margin in the quality stakes? (although equal in customer support at nil)

Don't panic - I will be resurrecting the RN2 to continue with its abused life - something yin yang in that;)
[Redmi Note 2 Android Development] Adam Hui:
Just super-wonder why u cant find any battery replacement for a bs phone in australia. In my country u'll find tons name brand replacement like names of guys in the market. Even some could have far away better endurance from the original xiaomi's, for ex: Transformer or Vizz.. haha... and all made by legend home made manufacturing country, yes chinese.. In other side i couldnt find any info of Ulefone seller here.. :eek:

Edit : how about umi z pro? any early analyzing info?
[Redmi Note 2 Android Development] Sleepy_Augie:
[MENTION=5952980]jajk[/MENTION] I got a second battery with a charger from ebay last year. It arrived about a month or two later (had forgotten that I ordered it at the time). Today was the first time I actually needed to use it. Neither my original or backup battery have puffed up yet, so I guess I've been lucky (or you're unlucky). What causes the battery to puff anyways? If I left my backup battery alone and never used it, would it eventually just puff up on its own and die?
[Redmi Note 2 Android Development] DarthJabba9:
[MENTION=5952980]jajk[/MENTION] Your battery looks really poorly! :eek:
[MENTION=4666525]Adam Hui[/MENTION] Umi Z Pro seems good on paper (but so did the RN2). Personally, I quite shy of MTK now. And when a phone comes with MM 6.0 long after the release of Nougat, I begin to get

very

suspicious. Promises of forthcoming OTA upgrades ring hollow. So, for my part, I would want to wait, see whether an official Nougat ROM is released, and whether full source code for the kernel is released, before taking the plunge.

However - my current thinking is never to buy MTK again, and only go for phones with Snapdragon. Life is too short ...
[Redmi Note 2 Android Development] jajk:
[MENTION=7150090]Sleepy_Augie[/MENTION] Battery puffs up because it is "gassing" due to poor quality chemistry and overcharging to get greater capacity. Notice Xiaomi set the charging voltage to 4.44V. Proper manufacturers set the charging level to 4.35V and have no problems. In reality, if you compare the volume of the battery to others, it is likely to be a 2700mAH battery if charged correctly not the claimed 3020mAH.

[MENTION=4666525]Adam Hui[/MENTION] I can find plenty of batteries on ebay to buy as I already did. I just picked the wrong shop that sold me thin air so now I have to re-order and wait for another month or two:rolleyes: There is nothing in any store that I can just walk in and buy - Australia is a closed shop with only monopolies or duopolies selling the the worlds unwanted leftovers for inflated prices - very restricted in the range of product available and that is why I defy them and buy straight from China:p

[MENTION=5850987]DarthJabba9[/MENTION] MTK reputation is sullied by phone manufacturers doing the wrong thing. Maybe they should exert more control over their clients like Qualcomm does (and end up in court as well)?
[Redmi Note 2 Android Development] DarthJabba9:
[MENTION=5952980]jajk[/MENTION] You are right - but the least that MTK could do is to insist that their clients comply with the GPL.
[Redmi Note 2 Android Development] Adam Hui:
U should just ask ur friends who take vacation in bali, u'll get it 10 pieces for the prices as it sent from china :silly:
[Redmi Note 2 Android Development] helmiazrin:
[MENTION=5952980]jajk[/MENTION]

How do I fix problem of apps not autostarting even they are allowed to autostart in Security settings? I'm using your latest 7223 boot image.
[Redmi Note 2 Android Development] jajk:
[MENTION=6394443]helmiazrin[/MENTION] An app won't autostart just because you give it permission to do so. It must have a broadcast receiver that is triggered by an event (such as boot completed). Check with SD Maid or MyAndroidTools to see if such a receiver (autostart) exists and is enabled for that app. If problem persists, be more specific about which app.

[MENTION=4666525]Adam Hui[/MENTION] They all end up in Kerobokan prison:laugh:

[MENTION=5850987]DarthJabba9[/MENTION] Dictating terms to customers is what landed Qualcomm in court....
[Redmi Note 2 Android Development] dsjiffry:
Hey jajk

the Boot.img file thing doesn't seem to work I can create the file but am unable to acess it via usb or any file manager..... Even the ones with root access........ The enitire twrp folder is read only I can't copy anything. It's ok. Thanks for the support anyway.

Anyhoo..... I wanted to know something about the perfservscntbl.txt file......when setting touchboost for how long does the processor boost the cpu??? Can I config that value???

What would you recommend I use 2 cores at 806MHz or 1 core at 1.4 GHz????

Also is there anyway to prevent the CPU max. Freq from being reset????
[Redmi Note 2 Android Development] dsjiffry:
[MENTION=5952980]jajk[/MENTION]

I attached my interactive governor settings..... Please take a look at them and let me know if there is anyway to optimise them even more.