yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] bibikalka:
Good piece of work!!! Clever!!! :D

Now, is there any particular significance to having mtk-su as the initial rooting method (other then you having a slight emotional attachement to it ;) ) ?

What I am thinking of are devices like Moto XT1028 or XT1528, which had a few temp root methods in the past, but making it into a fully usable (even if non-persistent) root was always cumbersome. Please see this for examples of devices that could do temp root:

https://xdaforums.com/moto-g/general/xt1028-4-4-4-temp-root-via-dirty-cow-t3514436

https://xdaforums.com/moto-e-2015/general/xt1528-verizon-pre-paid-temporary-root-t3530293

Btw, most Motorola's only allowed flashing critical partitions via fastboot, so even temp root would not get any rw access to /boot & /system which is perfect here as it'd fully protect from any potential screw ups.

Anyway, I think you might be really onto something here (for a few older devices), if you could quickly port your mtk-su machinery to rely on the older exploit like DirtyCow!

Update: Thinking about this some more, you should be totally able to also implement the DirtyCow into mtk-su and re-cycle lots of your other code! DirtyCow covered devices with Android 4.4-6.0.1, so it's only moderately ancient :D
[Miscellaneous Android Development] Harhar apa:
I thought it was a good idea to install init.d script support app as system app.. the problem is i can't now execute a root script for mtk su. What should I do. Should I change the HOMEDIR?

Q.: Does it change the HOMEDIR if I install it as system app?
[Miscellaneous Android Development] Coyhardt48:
Just wanted to pop in and say that this root solution (as well as the Magisk installation process) worked for me on my Coolpad Legacy S.

Thanks for the work!
[Miscellaneous Android Development] KUum:
[MENTION=8132642]diplomatic[/MENTION], firmware reference - update.dbankcdn.com/TDS/data/files/p3/s15/G3567/g1650/v343276/f1/full/update.zip. Check for possible rooting, please.
[Miscellaneous Android Development] diplomatic:
I explained the deal with Huawei phones in post 4. I'm not inclined to add support for these anti-exploit firmwares in the release version of the tool. You can PM me if you have a way to change my mind somehow...
[Miscellaneous Android Development] diplomatic:
Not sure why the home directory would be different, or what it would be. But you can uninstall the app from a temp root shell, and then install it as a regular app. If you copied the apk to the system partition, then remount system as r/w, and delete it from there...
[Miscellaneous Android Development] en11gma:
just wanted to say thanks.

profit!

everything working great on my tracfone A502DL running android 8.1

guide worked perfect.

now what can i do?

im so used to having bootloader unlockek and custom recovery installed im not sure what i can do.

can we (rooted devices) install a custom rom? if so can someone recommend one?

right now i think i am carrier locked.

can i use this phone with metropcs/tmobile?

thanks
[Miscellaneous Android Development] syntaxerror02:
how to root oppo a31 please help need step by step
[Miscellaneous Android Development] DB126:
Question is best asked in your device forum. Do your homework by reading through past posts. No one is going to spoon feed "step by step" instructions (lol)
[Miscellaneous Android Development] jasmin811:
Executing scripts from /storage/emulated/0/init.d (Nov 6, 2020 06:12:26)

suboot.sh

Temporary root by diplomatic@XDA

--------------------------------------------------

Temporary root by diplomatic@XDA

--------------------------------------------------

Failed critical init step 4

This firmware cannot be supported

My phone is LG K41S mt 6765

did i miss something here?
[Miscellaneous Android Development] diplomatic:
[MENTION=6635131]jasmin811[/MENTION], your phone/firmware is too new for this method, plain and simple. More info in OP.
[Miscellaneous Android Development] sushen520:
./mtk-su -v -c /system/bin/sh

armv7l machine

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

Building symbol table

kallsyms_addresses pa 0x409bbaa0

kallsyms_num_syms 69697, addr_count 69697

kallsyms_names pa 0x409ffbc0, size 854072

kallsyms_markers pa 0x40ad0400

kallsyms_token_table pa 0x40ad0850

kallsyms_token_index pa 0x40ad0c00

Patching credentials

Parsing current_is_single_threaded

c0290fe4: MOVW R0, #0x10b8

c0290fe8: MOVT R0, #0xc0d0

Possible list_head tasks at offset 0x210

comm swapper/0 at offset 0x358

Found own task_struct at node 1

cred VA: 0xd1416c80

init_task VA: 0xc0d010b8

Parsing avc_denied

c0900428: MOVW R3, #0xe058

c090042c: MOVT R3, #0xc0de

selinux_enforcing VA: 0xc0dee058

Setting selinux_enforcing

Selinux is already permissive

starting /system/bin/sh

UID: 0 cap: 3fffffffff selinux: permissive

exec: Out of memory
[Miscellaneous Android Development] bastienbaranoff:
Yes will try to develop myself an opensourced app for mtk-su if i can cause I don't like closed minded persons and closed source et la personne ayant le droit d'utiliser le logiciel peut sans l'autorisation de l'auteur observer, étudier ou tester le fonctionnement ou la sécurité de ce logiciel afin etc...
[Miscellaneous Android Development] CXZa:
Merde! I really like how the language changes in that sentence... :D
[Miscellaneous Android Development] bastienbaranoff:
Cause I don't have the pretention to translate a french law text
[Miscellaneous Android Development] CXZa:
Thus, I hereby withdraw my amusement because of the further evidence.. :p
[Miscellaneous Android Development] bastienbaranoff:
Mdr :silly:
[Miscellaneous Android Development] :
so I have os 7 sadly for my tablet. if I factory reset the tablet and disable wifi, will I get an older version that then can be rooted by this method?
[Miscellaneous Android Development] DB126:
Nope. You'll need to use other strategies to manage unwanted 'bloat' (Amazon Toolbox is a good starting point) or invest in another device.
[Miscellaneous Android Development] bjpafa:
Riru core/disapeared from 21.1 Magisk. Installation via Git is a joke 10.0.0.1 Oxige

I have problems with activation of web view implementation, modules from browsers disappeared. Thaf was kown. Sistemless via Magisk freezes.

Installed from Git... I have seldom assist to such a sydtemwide problem.

So i am thinking format system etc,

Two more consistent tries and FtheSystem...

Congrats and suggestions ???
[Miscellaneous Android Development] Koushiroue:
130|shell@1601:/data/local/tmp $ ./mtk-su
0000000000000000 is not a valid address
UID: 2000 cap: 0000000000 selinux: permissive
shell@1601:/data/local/tmp $

im using vivo v5 , put the mtk-su in the tmp folder, give it chmod 755, and attemped to run it while my phone is on. and i got the output above. any ideas?

$ adb shell
shell@1601:/ $ cd /data/local/tmp
shell@1601:/data/local/tmp $ ls
mtk-su
shell@1601:/data/local/tmp $ ./mtk-su
0000000000000001 is not a valid address
UID: 2000 cap: 0000000000 selinux: permissive
shell@1601:/data/local/tmp $ ./mtk-su -v
armv8l machine
param1: 0x1000, param2: 0x8040, type: 7-4
Building symbol table
kallsyms_addresses pa 0x40c97900
kallsyms_num_syms 60749, addr_count 60749
kallsyms_names pa 0x40d0e500, size 719903
kallsyms_markers pa 0x40dbe200
kallsyms_token_table pa 0x40dbea00
kallsyms_token_index pa 0x40dbee00
Patching credentials
Parsing current_is_single_threaded
ffffffc00030d9a0+50: ADRP x0, 0xffffffc00107e000
ffffffc00030d9a0+54: ADD Rd, x0, 0x950
Possible list_head tasks at offset 0x368
comm swapper/0 at offset 0x5f8
Found own task_struct at node 1
cred VA: 0000000000000000
0000000000000000 is not a valid address
Parsing avc_denied
ffffffc0002b2464+20: ADRP x0, 0xffffffc00126c000
ffffffc0002b2464+24: LDR [x0, 0x26c]
selinux_enforcing VA: 0xffffffc00126c26c
Setting selinux_enforcing
Selinux is already permissive
starting /system/bin/sh
UID: 2000 cap: 0000000000 selinux: permissive
shell@1601:/data/local/tmp $

running it with -v verbose got this output

Edit : seeing some vivo phones also got this output as well means mine is also have a modified kernel, hurmmm
[Miscellaneous Android Development] LupusCoding:
I have a fire 7 9th gen with build number 0002517057924 :(

Is there any change to get mtk-su working on this build? How can I help with it?
[Miscellaneous Android Development] DragonFire1024:
I'll be acquiring a Samsung Galaxy note 3 (SM-A315G). The security patch is October 2020 however I don't get an error that says the firmware is not possible to be adapted, rather it just fails straight up at line one. Doesn't give any real information on why. Don't have the device in front of me at the moment.
[Miscellaneous Android Development] bobkaas:
It has been a while but do you remember how you gained permanent root on your aconia 1 10?
[Miscellaneous Android Development] YAn Sophearith:
My Oppo a5s not root yet
[Miscellaneous Android Development] guadalupeleopard105d1:
Is there any chance of getting root for red pepper ghost phone?

hpp-gs1

If I am not wrong it has a helio p22 mediatek chip.
[Miscellaneous Android Development] macgealai:
Hello all. I have a Tinno/Wiko Ride (U307AS), rocking the MT6739 chipset. I have seen this device work for a few of you, verifying with @diplomatic. I just cannot seem to get it going. I used to do a lot of Samsung and Motorola unlocking back in the day using tools like Odin, but now I am running KDE Neon instead of Windows.

In the terminal, with ADB, mtk-su gives me this:

wytdeer@NuDawn:~$ adb devices

List of devices attached

QW7S8TEYMJSWKZMN device

wytdeer@NuDawn:~$ adb push /home/wytdeer/Documents/rootwiko/mtk-su_r23/arm64/mtk-su /data/local/tmp/

/home/wytdeer/Documents...(65144 bytes in 0.037s)

wytdeer@NuDawn:~$ adb shell

U307AS:/ $ cd data/local/tmp/

U307AS:/data/local/tmp $ chmod 755 mtk-su

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

Failed critical init step 1

./mtk-su

Failed critical init step 1

Same result or less thru terminal emulator on device.

attached is the CPU-Z verification page to give thorough device info. Help would be ****ing tits, from anyone
[Miscellaneous Android Development] fr4nk1yn:
It's an old one, however I'm trying a usage that would need root. Can confirm this, and the "Magisk method" works with the Verizon ellipsis 10 hd.
[Miscellaneous Android Development] Rfoletto:
Iae
[Miscellaneous Android Development] 染ACE:
活体 y13il Lack(setns)
[Miscellaneous Android Development] texsd123:
i succeeded in rooting my philips e518, and used dd command to get full magisk support. HOW AMAZING!
[Miscellaneous Android Development] Ratul2002:
Everytime I try to run the file, it says

Failed critical init step 1

i also tried mtk easy su, all the versions and all versions of magisk, but still the same issue... Previously it worked and I rooted my phone easily, but after installing an ota update I can't root it again.

Device: Oppo A5S, oreo

Developer options, oem unlock, usb debugging and disable permission monitoring are enabled
[Miscellaneous Android Development] diplomatic:
After you've started using mtk-su, the first thing you should have done is disabled all FW updates and avoided applying any optional OS updates from that day forward. Your firmware has been patched against this tool for months. I have had the following warning posted here for a long time. Unfortunately, most people who install mtk-easy-su never bother to check this thread for information and find out where mtk-su actually comes from (and who made it).

The good news is that rumor has it your phone lets you downgrade the firmware. If you manage to do that, then mtk-su will work again...

- D
[Miscellaneous Android Development] diplomatic:
Wow, that phone is very recent to be compatible. I like the old school style. 😵 It sounds like it doesn't come with much security on it...
[Miscellaneous Android Development] Raggamuffin17:
I have a cubot note 7 chip MT6738, guess this will work?

What root is it?? Can I get twrp working and magsik? Thanku
[Miscellaneous Android Development] XxxketaminekidxxX423:
First of all thank you for you work on developing such an awesome tool...

However, I am encountering this error. And I followed instructions to a T

"

Can't acquire root privileges (Dec 22, 2020 3:21:45 AM)

Executing scripts from /storage/emulated/0/init.d (Dec 22, 2020 3:21:45 AM)

magisk-boot.sh

/data/user/0/com.ryosoftware.initd/files/script-1044225735855930085[139]: ./mtk-su: inaccessible or not found. "

Any help or directions you could give would be greatly appreciated.

Thank you once again
[Miscellaneous Android Development] diplomatic:
@XxxketaminekidxxX423, have you copied mtk-su to the init.d/bin subdirectory?
[Miscellaneous Android Development] TomJ2:
"Failed critical init step 4 - This firmware cannot be supported"

LG K40 Android 9.0, Kernal 4.9.117, SW version X420AS10
[Miscellaneous Android Development] McAAA:
Temporary root by diplomatic@XDA

Home URL:

https://xdaforums.com/android/development/amazing-temp-root-mediatek-armv8-t3922213

--------------------------------------------------

armv8l machine

Temporary root by diplomatic@XDA

Home URL:

https://xdaforums.com/android/development/amazing-temp-root-mediatek-armv8-t3922213

--------------------------------------------------

Failed critical init step 1

Returned 1
[Miscellaneous Android Development] dedetok:
It is work on Evercoss Genpro X Pro S50 MT6735 android 7.0 (NO ROOT) firmware source http://evercoss.com/img/software/EVERCOSS_S50_7_0_021_P1_180314_OE_CPB.zip

EVERCOSS_S50:/ $ cd /data/local/tmp

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

armv7l machine

param1: 0x1000, param2: 0x8040, type: 4

Building symbol table

kallsyms_addresses pa 0x40bc2460

kallsyms_num_syms 54191, addr_count 54191

kallsyms_names pa 0x40bf7330, size 646794

kallsyms_markers pa 0x40c951c0

kallsyms_token_table pa 0x40c95510

kallsyms_token_index pa 0x40c95890

Patching credentials

Parsing current_is_single_threaded

c0362760: MOVW R0, #0x8d50

c0362764: MOVT R0, #0xc102

Possible list_head tasks at offset 0x290

comm swapper/0 at offset 0x400

Found own task_struct at node 1

cred VA: 0xc667e500

init_task VA: 0xc1028d50

Parsing avc_denied

c0aeca70: MOVW R12, #0x1278

c0aeca74: MOVT R12, #0xc113

selinux_enforcing VA: 0xc1131278

Setting selinux_enforcing

Selinux is already permissive

starting /system/bin/sh

UID: 0 cap: 3fffffffff selinux: permissive

EVERCOSS_S50:/data/local/tmp #

EVERCOSS_S50:/system/etc # id

uid=0(root) gid=0(root) groups=0(root) context=u:r:shell:s0

I need to remove bloatware com.android.sc , but fail.

EVERCOSS_S50:/data/local/tmp # pm list package com.android.sc

package:com.android.screenrecord

package:com.android.sc -> bloatware Android/Trojan.Syringe.AD (System Application)

EVERCOSS_S50:/data/local/tmp # pm uninstall com.android.sc

Failure [DELETE_FAILED_INTERNAL_ERROR]

success when using -k --user 0

EVERCOSS_S50:/data/local/tmp # pm uninstall -k --user 0 com.android.sc

Success

It still exists when I query list package

EVERCOSS_S50:/data/local/tmp # pm list package com.android.sc

package:com.android.screenrecord

package:com.android.sc -> bloatware Android/Trojan.Syringe.AD (System Application)

After I reboot the device, com.android.sc will installed its self.

Any suggestion?

Thank you

Sincerey, Dedetok
[Miscellaneous Android Development] Supermatt01:
If you have a locked bootloader, it likely won't allow you to edit system files. Trying to freeze the app may be more successful if you use TB.

What do you mean by DD command to get full Magisk support? I have a hated OPPO phone that in getting really cost wanting to replace anyway. I might be game for some hacking attempts. (The warranty is already expired and they still won't help me unlock the bootloader.)
[Miscellaneous Android Development] diplomatic:
Try "pm disable..." or "pm hide...". You can't rightly uninstall system packages because the system partition is read-only. Disabling has practically the same effect as uninstalling.
[Miscellaneous Android Development] DragonFire1024:
adb shell pm uninstall --user 0 com.package.name

That's pretty much the same as disabling the packages. If it doesn't work add -k just before the package name and try again. on some devices you will not be able to reenable these packages unless you do a factory reset. On some devices you can navigate to where the application is in the system and tap on it and reinstall it that way.
[Miscellaneous Android Development] CXZa:
Now that we have root access we can also remove/edit the app entry in /data/system/users/0/package-restrictions.xml file and then reboot...
[Miscellaneous Android Development] dedetok:
in /data/system/users/0/package-restrictions.xml file, at line 286 I found

<pkg name="com.android.sc" ceDataInode="418206" />

I remove it and restart. After ./mtk-su -v,

# pm uninstall -k --user 0 com.android.sc

Success

EVERCOSS_S50:/data/local/tmp # pm list package com.android.sc

package:com.android.screenrecord

package:com.android.sc

But com.android.sc still exist. What does <pkg name="com.android.sc" ceDataInode="418206" /> mean?

Thank you

dedetok
[Miscellaneous Android Development] Patulong69:
Temporary root by diplomatic@XDA

Home URL:

https://xdaforums.com/android/development/amazing-temp-root-mediatek-armv8-t3922213

--------------------------------------------------

Temporary root by diplomatic@XDA

Home URL:

https://xdaforums.com/android/development/amazing-temp-root-mediatek-armv8-t3922213

--------------------------------------------------

Failed critical init step 1

exit: 1
[Miscellaneous Android Development] VD171:
Working perfectly on:

- Lenovo C2 Vibe (k10a40) (MT6735P).

- LG K10 Novo (M250DS) (MT6750).

NOT working on:

- Motorola Moto E6s (XT2053-2) (MT6762).

Thank you very much
[Miscellaneous Android Development] NULLER09:
SElinux_enforcing not found, what's happen?
[Miscellaneous Android Development] Yassen Elkadi:
Is there a solution to this problem
[Miscellaneous Android Development] CXZa:
Wrong forum to ask such...
[Miscellaneous Android Development] Imperial X12:
Plz root opportunity A5s v.A44
[Miscellaneous Android Development] Tech0308:
Thanks! Rooted with magisk MT6735 (Huawei Y6ii Compact(LYO-L01))
[Miscellaneous Android Development] jhayza09:
Thanks
[Miscellaneous Android Development] HemanthJabalpuri:
@diplomatic

I am doing some small experiments with MEmu emulator by rooting with Magisk. For this I am referencing your Magisk solution and this

I am getting 'Bad /sbin mount?' error.

I am confused with below code.

# Create tmpfs /sbin overlay
# This may crash on system-as-root with no /root directory
./magisk -c >&2

touch /sbin/.init-stamp

if [ ! -f /sbin/magiskinit ] || [ ! -f /sbin/magisk ]; then
echo "Bad /sbin mount?" >&2
setenforce 1
exit 1
fi

Since magisk -c only displays version right?

How /sbin/magiskinit or /sbin/magisk will be created with magisk -c?

Also, only thing that I found different with emulator.sh is

$BINDIR/magisk --daemon

instead of

magisk --post-fs-data
sleep 1	# hack to prevent race with later service calls
magisk --service
magisk --boot-complete

What is the difference between these two?

emulator.sh is working fine to set Magisk for granting su permission to apps.

Thanks
[Miscellaneous Android Development] diplomatic:
OK, that's a good question. The line "./magisk -c >&2" actually calls magiskinit using its magisk applet, not the magisk executable. This is a little undocumented feature I found in Magisk's code that came in very handy for this solution. You can see it at work here: running magiskinit renamed to magisk calls the magisk_proxy_main() function, which calls MagiskProxy::start(). That does most of the work of setting up the directory tree and extracting magisk, etc, and finally calling the real magisk with the -c parameter. So I don't see a reason you have to replicate all those steps manually in the script if the native magisk code does them for you automatically...

Well, the official position is that starting Magisk at runtime this way only the supports the core mode. Magisk modules are never started with 'magisk --daemon'. My 3 calls make at least some effort of running module boot-up scripts. Even though a lot of modules do not work this late in the game, many of them function just fine....

- D
[Miscellaneous Android Development] HemanthJabalpuri:
@diplomatic

Thanks for answering. I am waiting for your answer.

But what about my Bad /sbin mount? error in my case? When I use your script to setup Magisk in MEmu emulator, I am getting this error. But emulator.sh from Magisk repo https://github.com/topjohnwu/Magisk/blob/v21.2/scripts/emulator.sh is working fine for granting Superuser permission to apps.

Thanks again.
[Miscellaneous Android Development] diplomatic:
@HemanthJabalpuri, have you made the link magisk to the file magiskinit? Have you noticed the part that runs before the SU_MINISCRIPT block?

cp $SRCDIR/bin/magiskinit ./
chmod 700 magiskinit

ln -fs magiskinit magiskpolicy
ln -fs magiskinit magisk

If you have, what are the contents of /sbin after running ./magisk?

- D
[Miscellaneous Android Development] HemanthJabalpuri:
@diplomatic

Before asking you about magisk -c doubt, I made a mistake in your script.

I replaced symlinking line with magiskinit -x magisk magisk. I thought it will work same as symlink. But it is not the case.

Now it is working fine with symlinking.

Thanks for the great work.

Edit:-

My final script to Root MEmu with Magisk is attached below.
[Miscellaneous Android Development] Sensonic:
Accidentally formatted my MTK phone's bootloader :(

Anybody who could help me?

The computer (WIN 10) recognizes Mediatek phone but every time I'm trying to flash the original bootloader to the phone SP Flash Tool says:

ERROR: STATUS_DA_HASH_MISMATCH

(0xC0070004)

How to overcome that issue and to be able to flash bootloader to the phone?

Older SP Flash Tool?

Miracle Box?

Any other?
[Miscellaneous Android Development] Tech0308:
Got a device with the same problem, would love to know if anyone's had any success
[Miscellaneous Android Development] diplomatic:
If the vendor offers a special version of SP Flash Tool with the firmware, then you need to use that instead of the generic one. Have you guys tried that? I assume you're talking about the Cubot phone? I checked the FW updates for Cubot Max 2 and there was indeed an SPFT package available on their site alongside the FW package....

- D
[Miscellaneous Android Development] Sensonic:
I already succeeded to get the phone recognized in Miracle Box. Unfortunately I have an old cracked version so it crashed. I ordered an online version but haven't yet got an order confirmation about it. They are not the quickest guys to answer ;)
[Miscellaneous Android Development] Doomwake:
onn gen 2 tablet MT8168 , Failed critical init step 1 , Aug patch, anybody got an idea what else to try? Magisk debug also failed and I have the bootloader unlocked.thanks
[Miscellaneous Android Development] HemanthJabalpuri:
@diplomatic

With the latest Magisk canary(i.e., for future versions), `magisk` is not embedded in `magiskinit`. See this. We have to take care of this in magisk-boot.sh.

Any ideas?

Thanks
[Miscellaneous Android Development] diplomatic:
I guess we'll have to ask users to copy the magisk file in addition to magiskinit and update the script. The magisk_proxy_main() stuff is still there in magiskinit code. Or just cut off the version support at 21.4. Whichever's easier. ;)

- D
[Miscellaneous Android Development] HemanthJabalpuri:
@diplomatic

By seeing https://github.com/topjohnwu/Magisk...d294337/native/jni/init/rootdir.cpp#L361-L405 it seems like we need to copy xz compressed magisk binary to /sbin and then execute magiskinit with $0 as magisk(?)

I am not good at programming, so I may be wrong.

Thanks
[Miscellaneous Android Development] bigrammy:
+1 What diplomatic says (y)

Just to add to that you need to select Firmware Upgrade under the Download tab in SPFlashTool and make sure all the packages listed have a tick in the box and that should hopefully be enough.

WARNING: Format All Download option will do exactly that and will wipe the nvram too so don't use that option unless you have a full backup to restore this and other device specific areas. It really is a last resort!!