yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi 4i] Kiran Anto:
ENJOY RAZOR SHARP OPTIMIZATIONS

SOURCE​

THIS SUITS ONLY FOR CM BASED ROMS OR CM12.1... OR STOCK MIUI(NOT TESTED) .. NOT THE DEV VERSION.....

Code:

#include

/*

* Your warranty is now void.

*

* I am not responsible for bricked devices, dead SD cards,

* thermonuclear war, or you getting fired because the alarm app failed. Please

* do some research if you have any concerns about features included in this Kernel

* before flashing it! YOU are choosing to make these modifications, and if

* you point the finger at me for messing up your device, I will laugh at you.[/LEFT]

*/

Features :

Built on new new sources.. yep with bugs fixed.. latest sources.. better stability

Better battery management.. Respect HMP.. Better Conservative . tweaked little

TCP added,Custom IOSCHEDULERS ADDED

Custom governors include ALUCARD, ELEMENTALX, DARKNESS, IMPULSE, YANKACTIVE

Custom Hotplugs Include AUTOSMP

Dynamic Fsync.. thanks to Varun Chitre

KCAL drivers added.. Thanks to Savoca

Powersuspend..

disabled KSM

VIbrator Intensity Control thanks to varun Chitre

disabled crc Check upto 30% performance improvement

misc tweaks,Stability tweaks

Little tweaks with sampling rates and scaling..

-o2 optimisation

Thermal Throttle temp control from userspace .. Thanks @franciscofranco

default VFC pressure Decreased..

More Zram Devices

Compiled Using Latest Toolchain.. SABERMOD

Fix high load average from uninterruptible waits

Tweaked Ondemand (Powersave bias)

CHANGELOG

[*]First Stable Version RRv1.0

[*]Test Version

KERNEL PREFERED APP :-

Kernel Adiutor

HOW TO FLASH :-

First Download The Kernel Zip..to Internal Storage

Reboot to Recovery

Press Install Zip and then navigate and select the Downloaded Zip

Now Swipe to Flash the kernel

Reboot System and Enjoy The Sweetness....

Thanks to

@smoki3

@dh.harald

@k2wl for base Kernel CM source

Varun Chitre for various commits

Savoca for KCAL

If i missed out someone Please PM me

THANKS TO ALL MY TESTERS.. ONLY WITH THEIR HELP I COULD CREATE THIS EVEN WITHOUT THE DEVICE IN HAND

DOWNLOAD LINKS

Dropbox Link : https://db.tt/bqYIwVYb⁠⁠⁠⁠

Copy.com Link: https://copy.com/yx3hBUcrFMwngbrk

Google Drive Link : https://drive.google.com/file/d/0BwkKad92d-T6OW5BS3czb3BCREk/view?usp=docslist_api

XDA:DevDB Information

[64 bit][KERNEL][LP] RazorReborn v1.0 [SABER][KCAL][-o2], Kernel for the Xiaomi Mi 4i

Contributors

Kiran Anto

Source Code: https://github.com/kirananto/RAZORFERRARI

Kernel Special Features: KCAL,PowerSuspend,CustomGoverors- ALUCARD, ELEMENTALX, DARKNESS, IMPULSE, YANKACTIVE , Hotplugs, and Many More

Version Information

Status: Stable

Current Stable Version: build1.0

Stable Release Date: 2015-08-04

Created 2015-07-27

Last Updated 2015-08-09
[Xiaomi Mi 4i] mmxandy:
for MIUI ROM.. or CM12.1

whare is the download link..
[Xiaomi Mi 4i] vrtsvas:
Congratulations!!!! thanks you :)

Hi all,

I just saw the post, congratulation first of all to you that you were absolutely worthy for creating a Kernel.

QUESTIONS:

1. DO WE NEED TO ROOT MI4I ?

2. FOR WITH MIUI IS MADE FOR?

3. CAN YOU PLAY WITH THE FREQUENCIES AND ACHIEVE BETTER PERFORMANCE BATTERY LIFE AND AVAOID LAGGING?

Please reply and i will install today providing you any testing you want

PS: in previous they mention about CM12 but i don't know if any good or if everything is working, but the kernel would work on this one as well?

CONGRATULATIONSSSSSSSS!!!!
[Xiaomi Mi 4i] Kiran Anto:
I GUESS THIS IS THE FIRST CUSTOM KERNEL FOR MI4i...

iT WORKS ON BOTH CM AND MIUI i guess...

ive just tested the kernel ... finished adding the features... now waiting for some testers... lol.....

i cant release a untested kernel guys....
[Xiaomi Mi 4i] jithuelad:
Great to see a Keralite who develop Kernel for Mi 4i. Greetings from Kochi. Not in a situation to test Kernel. All the best mate :)
[Xiaomi Mi 4i] Kiran Anto:
Thank u .. I don't own a device .. So I need testers......
[Xiaomi Mi 4i] lalitjoshi06:
thanx i will try this.

But where is the download link..................................................................................
[Xiaomi Mi 4i] chongns:
Sorry guys to spoil the party, but I think xda is prohibited the blind build. Please get a mi4i to continue your work or stop.

Thx
[Xiaomi Mi 4i] rob rich:
I own a Mi4i and i'm testing his work with close contact to him. So he isn't exactly "blind building" ;) and i think its my thing what i flash on my device. And since when its prohibited? I know that many devs a few years ago made one kernel for the device they own and then ported it to many other devices
[Xiaomi Mi 4i] chongns:
Many years I have not visit again the xda rules pages. So didn't know was the rules changed or something, but if I'm remembering it correctly, blind build is prohibited.

My concern had end at my previous post and I don't own xda.[emoji6]

So, it is your freedom to do so, happy flashing.
[Xiaomi Mi 4i] nowfalsalahudeen:
Happy to see another dev from Kerala...greetings from alleppey...gud job bro..keep it up
[Xiaomi Mi 4i] dh.harald:
HI,

Is This kernel based on mine, or you just starting from scratch based on original kernel?
[Xiaomi Mi 4i] smoki3:
Your zip doenst overwrite my kernel

---------- Post added at 02:34 PM ---------- Previous post was at 02:26 PM ----------

I created a pull request to your source

---------- Post added at 02:39 PM ---------- Previous post was at 02:34 PM ----------

but your govs and hotplugs doesnt work for me
[Xiaomi Mi 4i] Kiran Anto:
Yep its based on yours.. saw your cm based.. but uploaded source after some compilation fixes....

all ready.. but facing a strange problem..

random reboot... i guess... and after reboot going to black screen..

otherwise perfect
[Xiaomi Mi 4i] Kiran Anto:
[MENTION=2591365]dh.harald[/MENTION] [MENTION=3115338]smoki3[/MENTION] [MENTION=943196]k2wl[/MENTION]

I need help... regarding reboot...

can you help me... everything is perfect otherwise....

please contact me.. hangouts kirananto@gmail.com

or whatsapp +919495333724
[Xiaomi Mi 4i] dh.harald:
In the new kernel (eg 3.10), the last_kmsg moved to /sys/fs/pstore/console-ramoops

You can check, what could be the problem (after reboot)
[Xiaomi Mi 4i] zerocool420:
I think u must mention [MENTION=2591365]dh.harald[/MENTION] on the first page

For his work on kernel, as ur kernel is based on his.
[Xiaomi Mi 4i] smoki3:
Exactly the same problem as on k2wls kernel

Gesendet von meinem Mi 4i mit Tapatalk
[Xiaomi Mi 4i] Kiran Anto:
Ill include credits list when I release kernel.. Still in testing
[Xiaomi Mi 4i] rob rich:
[MENTION=3115338]smoki3[/MENTION] [MENTION=2591365]dh.harald[/MENTION] [MENTION=943196]k2wl[/MENTION]

If someone is interested, i have 2 logs

https://drive.google.com/file/d/0BwkKad92d-T6M2xNY21iNTQ2Ums/view?usp=docslist_api

https://drive.google.com/file/d/0BwkKad92d-T6bk84Z1VMeW1sMGs/view?usp=docslist_api
[Android Q&A, Help & Troubleshooting] mihai.apostu98:
How can Android system be hacked just by one MMS? I heard from news sites that there was found an exploit for 95% of Android phones (Android 2.3+) that can take control of the whole device just for one MMS and without letting you know. How can it be possible and how I can prevent it?

P.S.: I don't want to hack nobody's phone as I have no friends. Just curious.
[Android Q&A, Help & Troubleshooting] cmendonc2:
Heres some useful info:

http://www.cnet.com/news/researcher-finds-mother-of-all-android-vulnerabilities/
[Android Q&A, Help & Troubleshooting] bofis:
That's some info, but not really anything useful. Does this mean Google has a patch, will they be pushing that our or will there be ways to patch custom ROMs sooner even? These are all unanswered, though would be nice to know...
[Android Q&A, Help & Troubleshooting] mihai.apostu98:
"As soon as the malicious text is received, features built into Stagefright to reduce lag time for viewing videos process the video to prepare it for viewing. That processing apparently is enough for bad guys to get their hooks into the platform and take control." - cnet

I see it like this:

1. MMS with video arrives

2. Messaging app loads the video in Stagefright where it will processed for better playback.

3. Video is ready for playing.

As I figure out from Google's Android site about Stagefright, it is a service that take care of video/audio/other media related stuff offline and local.

How can hackers connect with Stagefright if Stagefright is an offline service? And anyway how can an media service recive code to execute as an remote command execution for whole system?

Sorry but I just don't get it at all.
[Android Q&A, Help & Troubleshooting] voxluna:
Here's further info. Google has apparently already sent the patches, 7 in all, to the various phone manufacturers.

Because of fragmentation, though, some of them may never send out these fixes. Since these have assumedly been committed to the source code online, they should theoretically be available for download at some point as well. However, you'd (likely) need to be rooted to apply them.

In the meantime, go into your SMS application (usually Hangouts these days) and turn off automatic MMS retrieval. Then, do not accept any photos or videos from anyone you don't know. I am not sure, but I worry it's also possible you might get it from someone do know who is already infected, so just operate with an abundance of caution overall, I guess. And keep an eye out for news here, because it will probably be one of the first places they become available.
[Android Q&A, Help & Troubleshooting] pomeroythomas:
People connect with Stagefright by sending you the malicious code contained within the MMS. Once that code gets (usually automatically) processed by the Stagefright service already locally present, it exploits security vulnerabilities to hand control of your device over to whomever is waiting on the other end. As for a media service being able to control the whole system, think of how Flash (a media service) and Microsoft had those zero-day UaE bugs that would allow someone to take over your PC. The logistics may be different, but the concept is the same.

If I remember correctly, there are ways to turn stagefright on/off by editing your build.prop file (easily found on XDA). I don't know if there is another subservice or what that could be running, and I haven't devved since Android 4 dropped, so don't get your hopes up.

Hope that helps.
[Android Q&A, Help & Troubleshooting] RealDogBoy:
I gather that Google has a patch. Has it been pushed out to Nexus devices?
[Android Q&A, Help & Troubleshooting] voxluna:
Excellent idea, +thanks. Et voilà, what appears to b-e in my KitKat:

media.stagefright.enable-player=false

media.stagefright.enable-meta=false

media.stagefright.enable-scan=false

media.stagefright.enable-http=false

media.stagefright.enable-rtsp=false

media.stagefright.enable-record=false​

Now, this can break all kinds of things if you don't know what you're doing. Use a build.prop editor from the Play Store.

I don't know that they all need to be false to plug this hole. But those are the relevant lines.*

UPDATE [10 Aug 2015]: This doesn't affect what the Zimperium scanner says is vulnerable, which may indicate the edit won't protect you. It's unclear at this point.... read the latest posts in this thread for possible info. You can turn off auto-retrieve in MMS, but SF exists at other levels of the operating system. I suppose it couldn't hurt to do the build.prop, but don't rely on it.
[Android Q&A, Help & Troubleshooting] pomeroythomas:
Thanks for the thanks!

You probably won't break much of anything; 90% of today's phones are powerful enough that you don't REALLY need Stagefright handling the media unless you're playing very intensive games on your device. The most you'll likely experience is not-quite-as-good benchmarking numbers.
[Android Q&A, Help & Troubleshooting] voxluna:
I had honestly never heard of StageFright, and I've been using Android since the very first device came out. But if it's possible to run all the usual media, just with a performance penalty, I'm going to change it right now (I did, and this happened).

Also, I just read an article claiming that fragmentation is not so much of an issue these days, because Google Play Services is mandatory. I wonder if it can proactively change something like this, on its own?
[Android Q&A, Help & Troubleshooting] pomeroythomas:
The only reason I even know about Stagefright is because my very first, 550MHz, resistive touchscreen Kyocera Zio shipped with Stagefright disabled by default. Haha.

I would assume it's possible (this is just an arbitrary code execution issue, I think), but having had that vulnerability built into pretty much every ROM for the last 5 years could be a problem in that I'm not 100% sure that Google Play Services has the access to shut down the Stagefright service (no root access, etc), so I'm pretty sure Google Play Services would be less of a fix than a piece of software that actively tries to mitigate the breach.

I could be wrong, though; I'm basically guessing as I haven't looked into the malicious code.

Xposed Android will no doubt have either a module for this or existing bugfix modules will be updated to include this vulnerability in the coming days, and due to the nature of Xposed modules taking over services the ROM is trying to run without actually messing with your ROM, I'm sure it'll be a universal fix.

Personally, I just shut off the Stagefright service using my build.prop and am patiently awaiting someone more skilled than I to create a fix.
[Android Q&A, Help & Troubleshooting] Morlok8k:
i could see this as a useful root method for lollipop, and other versions that don't have root methods yet.
[Android Q&A, Help & Troubleshooting] pomeroythomas:
Here's hoping!
[Android Q&A, Help & Troubleshooting] voxluna:
Come to think of it, if this exploit allows any kind of root, I suppose it'd be possible for Services itself to use that hole, and therefore be able to patch StageFright. A weird workaround, but entirely possible. Something tells me they won't use it, though, as technically feasable as it may be. I'm really hoping for that Xposed fix, just like GravityBox can patch FakeID. Which, indeed, Services eventually mitigated (for the most part).
[Android Q&A, Help & Troubleshooting] devzer0:
commits on android.googlesource.com

Has anyone tracked any commits in android.googlesource.com related to stagefright?
[Android Q&A, Help & Troubleshooting] iverson3-1:
Is this really a viable fix for this? I copied it from another website

If you turn off the following settings in your messaging app/apps on your device:

Auto-retrieve MMS. Check to automatically retrieve multimedia messages that you receive. If auto-retrieve is unchecked in your Messenger MMS settings, you must touch Download to view the message.

Roaming auto-retrieve. Check to automatically retrieve multimedia messages while roaming.

Then when you receive the text with this exploit it will not download to your phone unless you hit the download button. So looks like this can be turned off without a patch but patches are needed cause not everyone is smart enough to turn these off.
[Android Q&A, Help & Troubleshooting] voxluna:
That should be one way to disable the hack. It's unclear from what I've read if it only affects Hangouts, or all SMS clients. What I've done is disable any auto MMS retrieve in my own messaging app, which in my case is mySMS. I suppose it couldn't hurt to do it in Hangouts as well.

This should cover it, but I think you still run the risk of someone you know sending (probably without their knowledge) an infected video -- much like trojans that take over a PC, and use the internal contact list to send mail as though they were your friend, they could exploit your trust.

Patching the build.prop theoretically protects from this, which I've personally done, but it's not for the faint of heart. If you screw it up, you could render your phone a mess. I wish I knew more about app development, because I would write something that did all this stuff automagically.
[Android Q&A, Help & Troubleshooting] voxluna:
Aaaaaand that's what I just did. I'm in a boot loop after changing the build.prop file. This is going to be really fun with an encrypted data partition that holds the backup I just made.

Be warned. :eek:

UPDATE: I had to reflash the ROM, and the entire experience took about 2.5 hours because I couldn't get a KDZ to work. I decided that since it was going to be a full wipe, at least I would upgrade to Lollipop, but I'll have to set up the entire phone all over again. I suspect the problem was that I didn't pay attention to the permissions of that file when I edited and transferred it from another machine. Ugh. I just went back and put warnings on all my posts about the build.prop lines.... and it would be better to just wait for patches, IMO. This thread is progressing quickly now.
[Android Q&A, Help & Troubleshooting] devzer0:
i tried tracking the fix on android source repo. but the only recent commit against libstagefright is on July 7th.
[Android Q&A, Help & Troubleshooting] enban:
Hi all,

in my case, as I plainly don't use the MMS feature, I simpl deleted the MMS apn. Is this a possible workaround for this problem (at least, until it gets fixed somehow)?
[Android Q&A, Help & Troubleshooting] hunderteins:
I think that is the one.

To apply that on my old Streak 5 (Andro 2.3), I dumped /system/lib/libstagefright_amrnb_common.so with "arm-none-linux-gnueabi-objdump -x -S"

00001a78 <Copy>:
1a78: 4603 mov r3, r0
1a7a: 0052 lsls r2, r2, #1
1a7c: b510 push {r4, lr}
1a7e: 4608 mov r0, r1
1a80: 4619 mov r1, r3
1a82: f7ff ee36 blx 16f0 <add-0x4c>
1a86: bd10 pop {r4, pc}

compiled the original 2.3 Sources with that fix from the android repo applied and got

00001ad8 <Copy>:
1ad8: b510 push {r4, lr}
1ada: 1c03 adds r3, r0, #0
1adc: 0052 lsls r2, r2, #1
1ade: 1c08 adds r0, r1, #0
1ae0: 1c19 adds r1, r3, #0
1ae2: f7ff ee06 blx 16f0 <add-0x4c>
1ae6: bd10 pop {r4, pc}

That makes just eight binary changes to fix this issue on nearly every android device:

perl -pi -e 's/\x03\x46\x52\x00\x10\xb5\x08\x46\x19\x46/\x10\xb5\x03\x1c\x52\x00\x08\x1c\x19\x1c/' /system/lib/libstagefright_amrnb_common.so

Now I need an exploit to test that fix.

regards hunderteins
[Android Q&A, Help & Troubleshooting] enban:
In my case, nothing happened when I changed those lines... Maybe the problem lies elsewhere (permissions, typos, etc...)
[Android Q&A, Help & Troubleshooting] voxluna:
Good, well at least it does work. Yeah, I'm guessing permissions -- I can't imagine a typo on one of those 6 lines causing a full-on boot loop like it did. I thought it best to go back and add caveats, though, so casual users don't blow up their phone and scream. I mean, I think I'm rather advanced in both Linux and Android, yet I just did that myself. It's okay, because I've been drooling over a Lollipop upgrade for months now, and I love it.

But... I had to download 20 GB of stuff from the cloud to restore my internal SDcard, since my Nandroid backup was corrupt. Grrr. (Having lost 3 phones back to back, I do have Drive AutoSync back up all storage to 100GB of Google Drive space. In fact, if you include Nandroid backups and TiBu, I have three different ways to avoid disaster. So it's not major, but it's a LOT of work to restore this time.)
[Android Q&A, Help & Troubleshooting] Cerberus_tm:
[MENTION=1461816]voxluna[/MENTION] My condolences!

I edited my build prop yesterday without problems. I only did this line:

I did it using ROM Tools by Jrummy, simply from within Android. The app has a special build-prop editor, so perhaps that's why I had no problems. Or because I only set that line to false.

Someone on Tweakers.net (Dutch) said that it was probably related to reading meta-data from a video (and/or audio?) file, so perhaps I should set those other lines to "false" as well...

Note also that this can also happen through other channels than MMS, or so I read. If you browse to a website that serves you an infected video file, the same thing might happen (but at least that isn't a passive infection such as through merely receiving an MMS).

Has anyone noticed any performance or battery impact after turning off Stagefright? I must say I haven't, so far. Or is that only noticeable when you play videos/games? How about audio: I read somewhere that Stagefright also impacts audio?

[MENTION=5891722]devzer0[/MENTION] and [MENTION=2010230]hunderteins[/MENTION] good work! I hope we, the community, can come up with a patch outselves, with developers such as you! I wonder why Drake/Google hasn't created a patch for users that they can install themselves at the announcement, since they have it! Now we rooted users have been exposed for longer than we should.
[Android Q&A, Help & Troubleshooting] unqualified:
Just an FYI, if you are on a recent Cyanogenmod nightly (12 and 12.1), this has already been patched per a statement from CM on Google+.

source: https://plus.google.com/+CyanogenMod/posts/7iuX21Tz7n8
[Android Q&A, Help & Troubleshooting] voxluna:
Haha, thanks. :good:

Yeah, from what I've read, it has to do with a video file. Having said that, I would be suspicious of any media documents , and I've turned off auto-retrieve in every client I can find... stock, Hangouts, TextSecure, you name it. Now that the info is in the wild, someone is bound to go looking for ways to utilize it, even if the exact mechanism isn't revealed.

If true, the part about websites is particularly troubling, though... there isn't a similar way I can think of to mitigate that right offhand, short of turning it off in build.prop. Bleh.
[Android Q&A, Help & Troubleshooting] EEngineer:
Could there be a messaging app that is immune to this vulnerability?
[Android Q&A, Help & Troubleshooting] zelendel:
Most likely not as they all use the built in apis for messaging.
[Android Q&A, Help & Troubleshooting] voxluna:
This thing just keeps giving and giving! I found different parameters in my 5.0.2 Lollipop build.prop file, versus what I posted earlier from a 4.4.2 build. So if you've edited yours based on that list, here's what I found now that I upgraded:

media.stagefright.enable-player=false

media.stagefright.enable-http=false

media.stagefright.enable-aac=false

media.stagefright.enable-qcp=false

media.stagefright.enable-fma2dp=false

media.stagefright.enable-scan=false​

Moral of the story: Search out all the places where "stagefright" exists, and change 'em to FALSE. I used PropEditor and it was smooth sailing thru a reboot this time. That should plug it for now.

Of course, anyone without root is S.O.L. in this respect. The only thing to do is disable all your auto-retrieves and cross your fingers.
[Android Q&A, Help & Troubleshooting] vivanshah:
I'm hoping that this will be able to be blocked at the carrier level. For example, I know that the iphone "effective power" sms bug was blocked at the network level by tmobile. Perhaps there will be a way that they can automatically scan mms attachments and determine that they're compromised.
[Android Q&A, Help & Troubleshooting] RealDogBoy:
That's an encouraging thought. The only thing is, we don't currently know exactly what an exploit looks like. :confused:

In other good news Android Police reported today that Google announced that a patch will be pushed out for Nexus devices next week. Sorry but I can't post a link.
[Android Q&A, Help & Troubleshooting] josephmicah:
Clarification Please

I just rooted my Galaxy S4 few months ago running Kitkat 4.4. 4 on Stock TouchWiz minus some bloatware. This conversation is over my head. Are these edits disabling stage fright or just patching the security risk? If the former, what functionality might I expect to lose? Is changing those lines a fairly simple thing to figure out after downloading Build Prop Editor, like just pasting new lines over old lines in a file or or is there some more specialized knowledge needed here? Does any of this depend on having Xposed installed? Thanks in advance for any help. Please correct me if I'm not using this forum appropriately.