yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] dartjan:
@diplomatic

Well diplomatic , you made totally noob verry happy !

Working fine on my unbrand , cheap , chinese , Wish-phone loaded with false information about nearly everything.

A MTK6580 32 Bits was the only thing i believed is true.

From here one i try to find out what kind off hardware is really in the phone.

Thanks again for the hard work,

gr Jan

shell@P48 Pro:/data/local/tmp # ./mtk-su -v

armv7l machine

param1: 0x3000, param2: 0x18040, type: 6

Building symbol table

kallsyms_addresses pa 0x80999780

kallsyms_num_syms 48482, addr_count 48482

kallsyms_names pa 0x809c8d20, size 577339

kallsyms_markers pa 0x80a55c60

kallsyms_token_table pa 0x80a55f60

kallsyms_token_index pa 0x80a562e0

Patching credentials

Parsing current_is_single_threaded

c0279f78: MOVW R0, #0x78b8

c0279f7c: MOVT R0, #0xc0c5

Possible list_head tasks at offset 0x210

comm swapper/0 at offset 0x358

Found own task_struct at node 1

cred VA: 0xc6e4d580

init_task VA: 0xc0c578b8

Parsing avc_denied

c08d0e30: MOVW R3, #0xb7d0

c08d0e34: MOVT R3, #0xc0d6

selinux_enforcing VA: 0xc0d6b7d0

Setting selinux_enforcing

Selinux is already permissive

starting /system/bin/sh

UID: 0 cap: 3fffffffff selinux: permissive

shell@P48 Pro:/data/local/tmp #
[Miscellaneous Android Development] Tech0308:
Hi @diplomatic Tried your script for magisk v22. This is what I've got. The first 7 red lines are normal I think because they appear in the 21.4 script, it's just the 64-bit files, maybe because I've got a 32-bit OS on a MT6735? I tried to learn shell scripting to fix this but after an hour I'm not getting anywhere but I feel it's a simple change that's required.
[Miscellaneous Android Development] sj78:
Just to confirm, doing this will give me permanent root?
[Miscellaneous Android Development] HemanthJabalpuri:
Can you please try my script for v22 at https://xdaforums.com/t/amazing-temp-root-for-mediatek-armv8-2020-08-24.3922213/post-84578549

Thanks
[Miscellaneous Android Development] Tech0308:
Sorry still no luck...
[Miscellaneous Android Development] HemanthJabalpuri:
Can you please try again by downloading magisk-boot.zip again. I have updated it to use 32-bit magisk. Let me know if it works or not. Don't forget to share screenshot.

Thanks
[Miscellaneous Android Development] Tech0308:
Hmmm, I'm pretty sure the screenshot was from the updated version... The cmp -s errors have been resolved :unsure:
[Miscellaneous Android Development] HemanthJabalpuri:
No I updated it again. Please try it and share screenshot.
[Miscellaneous Android Development] Tech0308:
Sorry my bad, woke up at 4am and was going back to sleep XD.

It appears to have worked well.

Many many thanks
[Miscellaneous Android Development] HemanthJabalpuri:
mtk-su is only for 64bit MTK right?

But it seems like you have 32bit system! Strange!

Is Magisk works with other roots apps like try su in Terminal and see if Magisk prompt comes or not.

Thanks
[Miscellaneous Android Development] Tech0308:
Yes, it's a Huawei Y6 II Compact which has a MT6735. I think it's one of those phones with a 32-bit OS but 64-bit processor. The root's worked fine
[Miscellaneous Android Development] HemanthJabalpuri:
Can you please post screenshot of Magisk app screen

Thanks
[Miscellaneous Android Development] Tech0308:
Ta da
[Miscellaneous Android Development] HemanthJabalpuri:
@diplomatic

As with above screenshot, it seems like my script for v22+ is working! Now you can tweak it and add it somewhere in your posts.

Thanks
[Miscellaneous Android Development] jury76:
Hi, I would really like some help rooting my LG Stylo4+ phone, please. The model number is LG-Q710PL (mcv7a, the CPU is the MediaTek MT6750, i got it from TextNow which is using the Sprint Network, i'm running 8.1.0(Oreo) and and unfortunately right now I have the June 1st 2020 security patch but i know for a fact that my device previously had the Febuary 1st patch because i have a screenshot of it so i was wondering how would i go about the downgrading route. if im missing any information, please let me know and i would be glad to share it.

edit: i forgot to note that my phone is also OEM Unlocked in the developers options
[Miscellaneous Android Development] Tech0308:
Happy to report the script worked for Magisk 22.1 as well

Many thanks
[Miscellaneous Android Development] letsbrick:
it give me errors when using init.d

maybe I did it wrong, maybe because I updated the software(april 8 2021)
[Miscellaneous Android Development] Ntauch:
hi there. My device with mtk6761 didn't work, log said Can't find kallsyms address or offsets.

After checking the proc/ and strangely there is no kallsyms file . Is that normal？

By the way my device is this http://www.mi.com/aiteacher-wifi
[Miscellaneous Android Development] o_deacon:
./mtk-su: not executable: 64-bit ELF file

LG K40 Android 9.0, Kernel 4.9.112, Software version X420MM10v
[Miscellaneous Android Development] jimster2:
@mxpro1996 , if you know enough programming, you can LD_PRELOAD a lib with mtk-su. The lib must intercept when mtk-su tries to read /proc/kallsyms and then it must take your kallsyms from zImage and feed them to mtk-su.

Look up "LD_PRELOAD intercept syscall"
[Miscellaneous Android Development] skudo101:
i have a problem with HD10 (2019)

maverick:/data/local/tmp $ ./mtk-su -v

armv8l machine

Failed critical init step 3

1|maverick:/data/local/tmp $
[Miscellaneous Android Development] BoyMantis18:
video tut sir please.. please.. please..
[Miscellaneous Android Development] geekborg:
Hi, you can add ZTE blade A610 Plus to the working models list.

I unlocked it via easy-mtk-su and i installed TWRP via the official TWRP app + a TWRP image i found on 4pda.ru

The dm-verity protection made it stuck at boot logo but i flashed the VerifiedbootsignerV8.zip on TWRP and it then be unlocked.
[Miscellaneous Android Development] diplomatic:
Cool... So basically, you flashed an unsigned image (TWRP) and bootloader was OK with it? If you haven't unlocked the BL, that turned out kinda lucky for you...

Oh, and I think that phone is the same as the Blade A611(?).
[Miscellaneous Android Development] geekborg:
Yes, TWRP booted without unlocking the bootloader (i just enabled OEM unlock in the dev options).

The OS won't boot until i flash VerifiedbootsignerV8.zip
[Miscellaneous Android Development] Startropic1:
This worked for me on a Vankyo MatrixPad Z10 (MT8163A chipset), and I actually unlocked the bootloader before this. My dilemma now is getting proper root from here and/or TWRP/Magisk.

Any suggestions OP?
[Miscellaneous Android Development] Arttech1up:
Rooted lg k-30 LM-X410PM

MT 6750VC

8 oreo

Just so u guys can add to list
[Miscellaneous Android Development] agudelo2543:
Vivo v15 mt6771

Failed critical init step 1

#help
[Miscellaneous Android Development] iulianhotshot:
I tried to run those commands but it doesn't work for MT6771 (Elephone U5).

The message is: "Failed critical init step 4. Firmware support not implemented".

Any suggestion, please?
[Miscellaneous Android Development] AlphaGB:
Works well on LG K10 Power (m320tv) Thanks for mtk su!
[Miscellaneous Android Development] vla-511411:
Hi @diplomatic,

TL;DR level Q:

Is the 'mtk-su' method of getting a bootloader-locked root now dead forever after a 2021MAY firmware updated ZTE pushed onto my ZTE Blade A7 Prime (w Mediatek MT6761 processor) ?

Long version:

Just a few days ago, I decided for the first time to root my ZTE Blade A7 Prime (Visible) phone. I searched up XDA-devels and came upon your post about the Magisk v21.4 installation using mtk-su and the magisk-boot.zip and that failed. Then I dug up more and came upon THIS thread about the mtk-su script to get the root prompt without having to unlock the bootloader. The 'mtk-su -v' fails with the following error:

" armv71 machine

Failed critical init step 1 "

I do note that on post # 1415 of this thread, you have stated that any firmware updates after 2020MAR *will* break this facility. I never had the option to turn OFF automatic "system updates" on my phone, so this should also be the case for many others.

So, the Q now is whether this 'mtk-su' method is dead for us? OR could you PLEASE REVIVE it somehow?
[Miscellaneous Android Development] Pippoloness:
Hi, i have get the access to the shell, but of i perform the command mtk-su, i get platform incompatible, i have a mtk6889, , model istituzionale i12pro

My phone is a I12Pro Mtk6889, with the command ./mtk-su i get message:

armv71

Failed critical init step 1

Incompatible platform

How can i risolve the problem, mybe i must try a different version of mtk-su? I'am using rel. 23.

Thanks
[Miscellaneous Android Development] Pippoloness:
Hi, i have get the access to the shell, but of i perform the command mtk-su, i get platform incompatible, i have a mtk6889, , model istituzionale i12pro

My phone is a I12Pro Mtk6889, with the command ./mtk-su i get message:

armv71

Failed critical init step 1

Incompatible platform

How can i risolve the problem, mybe i must try a different version of mtk-su? I'am using rel. 23.

Thanf
[Miscellaneous Android Development] ShouryaMahajan:
How to temp root helio g80
[Miscellaneous Android Development] diplomatic:
Yes, any FW update on or after March, 2020 will break mtk-su, or rather fix the loophole that it uses. There's nothing to be done about it unless you can downgrade. There are probably not going to be any more updates of this tool.

That phone's hardware and software are way too new for this tool. Look into unlocking the bootloader if you haven't already...

- D
[Miscellaneous Android Development] Pippoloness:
Come devo fare?

Grazie
[Miscellaneous Android Development] luridphantom:
strange, mtk-su r23 fails with
1|cp3648at:/data/local/tmp $ ./mtk-su -v
armv8l machine
Failed critical init step 4
This firmware cannot be supported

on an october 5, 2019 patch, android 9 pie. what's your phone config that you got to work?
[Miscellaneous Android Development] Pippoloness:
I have Android 10, i12Pro , Mtk6889, SeLinux Kernel 3.10.65 , Language: Italiano, OpenGL ES: 2.0 , ARMv7 rev. 5 (v7I) Cpu: 10 x 1,30 , Gpu: Mali-400 MP Arm (OpenGL ES 2.0) Thanks
[Miscellaneous Android Development] 0000.0000.00:
I have a TCL A1 model A501DL but when I try running mtk-su I get this error:

Failed critical init step 4
This firmware cannot be supported

The phone is on the february 5th, 2020 security patch and rom seems to have been built on february 10th so not sure why it didn't work, especially since it worked for someone else with the same model.
[Miscellaneous Android Development] Hutchpd:
My amazon Fire 7 tablet fails.

Tablet Codename: mustang

FireOS Version: 7.3.1.9

Android Version: 9

Chipset: MT8163

I see

> mustang:/data/local/tmp $ ./mtk-su

> Failed critical init step 3
[Miscellaneous Android Development] Pippoloness:
How can i risolve this problem?
[Miscellaneous Android Development] diplomatic:
Your device is not compatible with this tool. Also, those specs are a lie. It's far from an mt6889. Judging by the kernel version & GPU, the chip is more likely to be mt658x or mt657x. The OS is probably closer to Android 5 than Android 10.
[Miscellaneous Android Development] Pippoloness:
I detected the features with cpu-z, so what should i do? Thank you
[Miscellaneous Android Development] diplomatic:
Can you use a system info app to look up the phone's API Level, as well as the Platform or Hardware (aka the property ro.board.platform)? It might be something like mt65xx or mt67xx. This isn't directly related to mtk-su, but it would shed light on the mystery.

To install root, you need to unlock the bootloader and patch the boot image with Magisk. You need to get a copy of the firmware from somewhere or extract it from the phone with SP Flash Tool. Here is a guide on how to install Magisk.
[Miscellaneous Android Development] Pippoloness:
example app?
[Miscellaneous Android Development] diplomatic:
@Pippoloness, that's weird, I didn't know I spoke Italian. :)

Just use any device info app from Play store. You mentioned CPU-Z. That will probably work. Another example: https://play.google.com/store/apps/details?id=com.ytheekshana.deviceinfo
[Miscellaneous Android Development] Pippoloness:
The information are:

I have Android Q 10.0, Model: i12Pro (Mtk6889_project), Hardware: Mtk6889 (32 bit), SeLinux Kernel 3.10.65, Language: Italiano, OpenGL ES: 2.0, ARMv7 rev. 5 (v7I) Cpu: 10 x 1,30 , Gpu: Mali-400 MP Arm (OpenGL ES 2.0) , Level API: 23 october 5 2015

Level patch securety: 5 march 2017, bootloader: unknown , Productor: Welcome, Google Play Services: 21.24.18, Architecture: 10x Arm Cortex-A7 @ 1,30 Ghz) rev. r0p5, with command adb getprop ro.board.platform i get: sc8830 , with command adb shell getprop ro.build.version.release i getprop this: 6.0

Grazie
[Miscellaneous Android Development] diplomatic:
OK, thanks, that's very enlightening. Unfortunately, your phone is not exactly what it seems. The manufacturer and/or seller has lied to you about its features, as I suspected. The main specs have been wildly inflated in the firmware. For example, the real OS version is Android 6.0, not 10.0, according to the API level (23). (ro.build.version.release confirms this too.) The chip is actually a Unisoc/Spreadtrum sc8830 (from ro.board.platform), an older quad-core 32-bit chip with 3G. So it's not even a Mediatek at all, much less an mt6889. (Another distortion is the number of cores, which is really 4, not 10).

So there is not much more I can tell you about rooting it. You should do your own research. I came across a guide on the Hovatek forum, called "How to unlock Unisoc (SPD) bootloader using Identifier Token". I don't think I can post a link to it, but you can't miss it if you Google it. That might be a good place to start. Hope that helps. Good luck....
[Miscellaneous Android Development] Pippoloness:
the strange thing is that both on cpu-z and device-info, it shows me 4 processors, other times it shows me 10, it could be that it is blocked and therefore it should be foul? Thanks
[Miscellaneous Android Development] diplomatic:
@Pippoloness, yes, the real amount of cores is 4, as that is the spec of sc8830. (I'm guessing by 'foul' you mean fake?) I don't know how they altered that info, but it's definitely not 10. Here, I found this app that gives you the real details about a fake device: https://play.google.com/store/apps/details?id=mark.fakedevicetest . Unfortunately, these scam phones from China are all too common these days...
[Miscellaneous Android Development] Pippoloness:
sometimes he physically shows me 10, then 4, then 10 and so on
[Miscellaneous Android Development] yanni_boi:
I get the exact same issue. same device and fireos version.
[Miscellaneous Android Development] Paul_Neocube:
Yeah so of course I do not have arm or arm64 but I have armv7-A. This is the oldest and last phone out of three that I have attempted and once again I am unable to do much of anything to improve my devices. thanks nonetheless for your assistance in providing a better world for all of us Android lovers!
[Miscellaneous Android Development] Ajdjdus:
/data/user/0/juniojsv.mtk.easy.su/files/magisk-boot.sh[124]: ./mtk-su: not executable: 64-bit ELF file

exit: 1
[Miscellaneous Android Development] Pippoloness:
You have Android 9 , i have Android 6 , but your device is SC8830?
[Miscellaneous Android Development] ilya980:
Both adb root shell and Termux root shell work on LG K40 LM-X420AS AT&T. Have not tried the magisk yet. Has anyone tried this script https://xdaforums.com/t/amazing-temp-root-for-mediatek-armv8-2020-08-24.3922213/post-84578549 on this phone? Should I try earlier magisk version first?

Is it possible to flash this phone with the OEM LG firmware and remove AT&T with a .kdz file from a download mode?

Thanks.
[Miscellaneous Android Development] Duhjoker:
no.

on most LG phones this is possible as long as its the same model and you dont flash aboot which is the bootloader.

but with mtk devices the boot chain changes as it uses a preloader for the bootchain. but thats not the reason since you wouldnt change those out any way.

the problem lies in the fact that MTK software is written MTK hardware in mind. so imho i wouldnt try it.

but you can always pay a few extra bucks to get it unlocked for any carrier but honestly i thought all phones were for years now after a certain time and most afaik are carrier unlocked out of the box.

.
[Miscellaneous Android Development] ilya980:
I have a T-mobile TM-AC1900 wireless cellspot router. The router is made by ASUS, but re-branded to T-mobile. People figured out a way (downgrading, replacing a bootloader, patching, and re-flashing) to revert it to the stock ASUS firmware, after which the router turns back into ASUS RT-AC68U - a much better router with more capabilities. I am wondering if similar change is possible with this phone to revert it to a factory unlocked version with a stock LG firmware and remove all AT&T logos and bloatware. Will this phone accept a non-AT&T branded firmware image (not unsigned, but signed by LG) or will it only accept the AT&T-signed firmware?

In other words can I turn LG LM-X420AS into LG LM-X420QN? Would any of these firmwares work? https://lg-firmwares.com/lg-lmx420emw-firmwares/ Is this firmware publicly available? X420QN20d_00_NAO_US_OP_1107.kdz

Is there a debloater that can remove all AT&T, Amazon, Games, Google and all other crap from this phone?

For the SIM provider unlock, I see several places offer remote unlock, but I am uncomfortable with someone remotely logging into my PC. Is this unlock tool publicly available?

Thanks.
[Miscellaneous Android Development] ilya980:
My phone just updated from 06/01/19 to 09/01/19 security patch. There was nothing I could do. The update message popped up a few times making phone unusable. I clicked "remind me later" a few times, but after 5 or so snoozes the phone still updated. Is there a way to stop the firmware updates? Next time it updates I will lose elevated terminal.
[Miscellaneous Android Development] luridphantom:
settings > developer options > disable automatic updates
[Miscellaneous Android Development] ilya980:
Thank you! You saved me from a disaster!
[Miscellaneous Android Development] ilya980:
Is there any firmware (AT&T- branded or LG, or another) that can be flashed into this phone from the download mode? Is it possible to extract the OTA update pushed by AT&T and save it somewhere for recovery if needed? Where is the OTA update package saved? Are there any tools similar to Qualcomm's firehose that can be used to dump and flash partitions?

How do I put it into EDL mode?

Thanks.
[Miscellaneous Android Development] M.White:
The trick works for the

Huawei Y3 II (LUA-L21, C576B115, Android 5.1, EMUI 3.1 Lite)

also. Thanks for your efforts @diplomatic ! (Just tried it out of desperation from not having enough internal storage place while trying to revive and reuse this old/er phone ;) )
[Miscellaneous Android Development] Pachacouti:
Psst... I got root, and sussed it would be wise to check your bootloder in arm64-v8a, if your bootloader is a 'user' variant... notice most newer OS after pie are all user build bootloaders compared to eng in pie?

Very relevant ;)

Magisk cant flash on a user build bootloader, so neither will this... unless already rooted of course ;)

I did wonder why all these custom roms avoid including bootloaders to run them, wiping the origional OS completely...
[Miscellaneous Android Development] kww__:
deleted
[Miscellaneous Android Development] Pachacouti:
I get this too... I magisk my bootloader hopefully to get magisk, it loads a greyed out icon on desktop showing what you posted. I CANNOT su at this point, yet magisk is installed to a bootloader, as in magisk_patched.img... so what's the point in magisking a bootloader that wont let us su until we can get online?

I can however load the latest canary, and this problem goes away, but it then renders loading any earlier version obsolete, as well as rw created by systemrw_1.32...

All these devs competing for the same link, offering their own links instead... it's sad when rw actually works until magisk forces that damn update that renders outr modules useless, when they worked before... even in android 10!

Google and Apple block all...

Hand in hand...
[Miscellaneous Android Development] Pachacouti:
Read:

https://xdaforums.com/t/hahahack-dis-no-magisk-required.4337361/#post-85671257
[Miscellaneous Android Development] diplomatic:
Thanks, man, and great question! In theory you can set this up with any executable that spawns a root shell. There's nothing technically special about mtk-su. The advantage that does have is that it's fast. And it needs to run once every boot-up. From my understanding, the downside of Dirty Cow is it takes a long time. So I'm not sure it will be practical. In the suboot script, take a look at the SU_MINISCRIPT section. That's the script that needs to run under root/selinux permissive to launch Magisk. It's not that complicated. Doesn't matter where the initial root shell comes from. It could be a built-in su binary, for example.....
[Miscellaneous Android Development] bibikalka:
DirtyCow was not that slow, I recall it 'd usually take less than 1 min, which during boot and only boot would not be so material. So it's totally practical.

Could you glance at the existing dirtycow code out there and see how much commonality could be with mtk-su?

The issue always was that getting some root shell with limited permissions was easy, but converting that to selinux permissive was pretty cumbersome. It seems that's where your current expertise is highly applicable - getting to selinux permissive with a wide range of kernels and Android versions. Hd10 2017 has a dirty cow bug, so if you have that Rom handy, you can take a quick look.
[Miscellaneous Android Development] diplomatic:
[MENTION=6680544]bibikalka[/MENTION], ok, so I looked at some of the dirty cow source code, such as the one here. From what I can tell, that exploit could not be more different from mtk-su. There's just no way to adapt the high-level algorithms from mtk-su onto it. Dirty cow works by taking over some privileged processes and tricking them into doing your bidding. While mtk-su modifies kernel variables directly by accessing arbitrary memory. It has a lot more freedom. So selinux, for example, is turned off by writing to the kernel's selinux_enforcing variable. There is really not much trickery involved in that step.

If you can find some dirty cow binary that spawns a root shell, you may be able to automate it to run the Magisk launch script. I don't know if the permissions will be enough to allow all the stuff that magisk startup wants to do. It may be that you can only launch 'magisk --daemon', which would start the Magisk backend, but not mount the su binary. For that, you might have to do something else...
[Miscellaneous Android Development] mrmazak:
Just tried V15 on my new umidigi F1. , the processor is already listed on the working list. (mt6771 helio P60)

This is on Pie and system-as-root device. I noticed even after exiting the mtk-su root shell, the device stays in permissive. It stays untill device reboot.

planning to try your majisk script next.

Do you think the launcher can run direct from within termix. Termix has a short-cut widget that can run script when widget is clicked on home screen.