yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] Senral:
OUKITEL K12

mtk-su_r17 -> not work

adb.exe -d push E:\oukitel\K12\mtk-su_r17\arm64\mtk-su /data/local/tmp/
1248 KB/s (38720 bytes in 0.030s)
K12:/ $ cd /data/local/tmp
cd /data/local/tmp
K12:/data/local/tmp $ chmod 755 mtk-su
chmod 755 mtk-su
K12:/data/local/tmp $ ./mtk-su -v
./mtk-su -v
param1: 0x1000, param2: 0x8040, type: 14
Building symbol table
Can't find kallsyms addresses or offsets
Unable to get kernel symbol table
setns failed:: Permission denied
New UID/GID: 2000/2000
starting /system/bin/sh
K12:/data/local/tmp $
K12:/data/local/tmp $ ./mtk-su -s
./mtk-su -s
Can't find kallsyms addresses or offsets
Unable to get kernel symbol table
K12:/data/local/tmp $
[Miscellaneous Android Development] stizzie:
##report on latest r17 and updated suboot.sh

I'm on 8.1 (MT6771)

Managed to get this but no promt pop up when apps request root ?

The previous suboot + r16 worked OK.
[Miscellaneous Android Development] KevMetal:
I am pretty certain your phone will bootloop if you don't follow the guide and use Su since boot.img is checked and if modified by magisk secure boot prevents booting ...even if you flash permissiver or and whatnot it still fails on Lg K series. Therefore without trying this method but having tried several other methods including magisk on K8 before screen broke I can tell you it won't work "as is" without tweaking.
[Miscellaneous Android Development] mrmazak:
What do you get after reboot, and run it again ?
[Miscellaneous Android Development] stizzie:
Same thing, but it look like how it should be right ? I don't know why promt not popping up, must be something with the new su boot

Oh another thing, it is normal for the magisk manager to freeze after the script ? That is what i expierienced, right after I run the script, magisk manager will either stuck at this

Or not opening at all
[Miscellaneous Android Development] mrmazak:
Try to un-install magisk manager and reinstall. I am using same soc as you right now . Umidigi F1(Mt6771) on pie. It works

I also just tried it on other phone . Blu vivo xl4(mt6762) running on 8.1, it also works.

---------- Post added at 07:04 AM ---------- Previous post was at 07:01 AM ----------

Sorry, yes this was mentioned.

"Kallsyms" problem is different that the current fix For pie in general.
[Miscellaneous Android Development] stizzie:
Yeah we are on same soc but I'm on 8.1 ( Oreo ), i couldn't wait for the update for Pie so i downgraded to Oreo, the update for Pie come right after, irony !

What would happen on your device after the script ? Do you manage to open the magisk manager app , and also how long your root stays ?

In my case , magisk app will not open, and also i only get root prompt on that session, say i put my phone down to go somewhere and when i come back, root was gone ( no reboot )
[Miscellaneous Android Development] mrmazak:
Yes MM is running, and su pop-up for permission working too.

Root stays till reboot.

Have been running it since 4 days now.

So start fresh.

Stop the init.s app from running at boot, remove magisk manager. Reboot twice.

Set the folder for init d again. Install magisk manager.

Your screenshot had an error at begining. Said mtk-su not found. Is that happen each time?
[Miscellaneous Android Development] stizzie:
Huhmm weird on my case, ok i will update to pie and try the latest post

No, mtk-su not found error is plainly me forget to put mtk-su in
[Miscellaneous Android Development] stizzie:
[MENTION=5312578]mrmazak[/MENTION]

#update on Pie

Same thing as above

Script success, last execution:

/data/data/com.ryosoftware.initd/files/bin

New UID/GID: 0/0
CapInh:	0000000000000000
CapPrm:	0000003fffffffff
CapEff:	0000003fffffffff
CapBnd:	0000003fffffffff
CapAmb:	0000000000000000

Magisk won't open after script, no prompt when app ask for root.

#### edit. Nevermind i have it working, keep Magisk manager running instead of closing it before running scipt
[Miscellaneous Android Development] diplomatic:
The new suboot script has no substantial changes, just minor bug fixes. The old one would have done the same thing. The major differences are in mtk-su.

You can try to clear out the /data/adb directory and start over. In an mtk-su root shell, before starting Magisk, do:

rm -rf /data/adb/*

You might also try leaving suboot.sh on permissive and see if that clears it up. Edit the script and comment out line 102:

#setenforce 1

Push the script and reboot/run manually.

What phone is this, btw?
[Miscellaneous Android Development] diplomatic:
Great! But the init.d should work on startup before you open MM....
[Miscellaneous Android Development] stizzie:
you are the creator , great work man :good:

i don't really know much about the Mediatek scheme, but since i now own a device with MTK soc this kind of work is really intriguing.

about MM i'm not sure since i don't have a whole idea around how your script work but in my specific device:

- If i close MM , then run the script , MM will be unable to start, last excution of init.d seems perfectly as it should be, but no promt.

- if MM open, everthing work fine.

It is Nokia 5.1 Plus, also know as Nokia X5 ( TA-1105 varriant)
[Miscellaneous Android Development] diplomatic:
[MENTION=5181058]stizzie[/MENTION], OK good to know about Nokia 5.1 Plus. One important thing that may not be obvious is that you don't want to run the script multiple times in one boot session. I just noticed your log didn't say launching a new daemon, etc. That means you "ran script now" a second time. If something has gone wrong and you want to rerun it, you have to reboot your phone. Can you simply try "Run scripts at boot time", then reboot, don't tap on "Run scripts now"? See if MM opens then.
[Miscellaneous Android Development] stizzie:
OK everything work perfect now.

Log

Executing scripts from /storage/emulated/0/init.d (14 thg 7, 2019 22:37:36)

suboot.sh

/data/data/com.ryosoftware.initd/files/bin

New UID/GID: 0/0
CapInh:	0000003fffffffff
CapPrm:	0000003fffffffff
CapEff:	0000003fffffffff
CapBnd:	0000000000000000
CapAmb:	0000000000000000
source type magisk does not exist
Error in: allow magisk (null) (null) (null)
client: launching new main daemon process

Mm opens, root stays till reboot, perfect !

You mind if i share this to the X5 forum ? many people ask for root solution there since it is bootloader locked.

All credits to you of course
[Miscellaneous Android Development] diplomatic:
Nice! Glad to hear it worked, [MENTION=5181058]stizzie[/MENTION]. Yeah, spread the word, man. Just link them to this thread.

BTW, was that the actual Cap* output or did you type it wrong? Should be

CapInh:	0000000000000000

...

CapBnd:	0000003fffffffff
[Miscellaneous Android Development] stizzie:
i copy paste the whole thing from init.d. it is what the script generated.
[Miscellaneous Android Development] diplomatic:
[MENTION=5181058]stizzie[/MENTION], so.... you're using mtk-su R16? Because those caps are the old behavior.
[Miscellaneous Android Development] abdoh01:
i dont think you get the point

this isnt modifying the boot img at all cause the bootloader is still locked

and also the method https://xdaforums.com/android/development/amazing-temp-root-mediatek-armv8-t3922213/post79626434 uses magisk not the regular su it ues mtk-su
[Miscellaneous Android Development] KevMetal:
you are trying to install magisk eventually are you not ..or at least trying to modify things in system using root ? i am trying to tell you if you modified anything on the Lg K series it bootloops ..regardless of it is boot or system ....

i clearly stated i am not certain if the temp root will run or not and i can't test it in regards to the mtk-su and clearly stated i would like to but my screen is broken .... i casually commented on the fact that another fully functional root exists for your device using tweaked custom root method ..

i was answering you in regards to a full magisk installation through using gottlaz method because you said rice.zip was not needed

mtk-su temp root is another question ..why don't you run it and answer the question ...but anyway my original statement is true ..your device has root method ..
[Miscellaneous Android Development] diplomatic:
? LOL... that conversation....

Yes, we're all eager to know whether mtk-su works on that LG.
[Miscellaneous Android Development] abdoh01:
actually i already using root magsik on the device but with unlocked bootloader

so i am aware of gottlaz method

but if this method worked it will allow to receive ota updates without losing root

and i also cant try it cause i am working in different project so that why i am asking
[Miscellaneous Android Development] KevMetal:
well i dont see the reason for this root method if your bootloader is unlocked and you can use magisk ... or have bootable twrp

you can then simply use fastboot to flash a patched boot.img of magisk ...

flash back or restore stock boot - take OTA- flash back patched boot.img

but in any case it's silly preferring a partial / tethered root over full root if full root exists unless the partial root could get you full root in an easier way than the original process or the full root needed so many steps or using test point shorting or stuff like that ..

as for not being able to test this method ...how hard is fastboot boot recovery.img

backup to sd ...flash stock ...test root ...flash stock ..restore ...that's like 20min tops..

whick version of magisk are you using ? on the K8 the versions of magisk I tried all triggred something in the Lg resulting in bootloop but magisk has released many new versions since then ..even with or without flashing dm-verity .zip or permissiver etc ..only method that worked for me was

-unlocking bootloader

-booting *not flashing twrp

-flashing supersu using rce.zip before and after

*k8 is on marshmallow

*flashing magisk or twrp with or without dmverity&permisser zips bootlooped when i tried it 1-2 years ago..

anyway OT Apologies

when i find a cheap replacement screen I will test this mtk-su just for fun to see if some way of getting temp root to get full root from within system would allow for an easier root method for K8 .. not having to go through the process of porting themselves a recovery depending on their version of K - series before attempting gottlaz method . ...

imho :good:
[Miscellaneous Android Development] vddrnnr:
Substratum

Hi all,

Do you know if substratum works?

Best regards,

voidRunner

---------- Post added at 11:01 AM ---------- Previous post was at 10:41 AM ----------

Hi all,

You can't use the latest version of Magisk Manager you

need to use the 7.0.0 version if not Magisk manager won't open after running the suboot.sh script.

Best regards,

voidRunner
[Miscellaneous Android Development] abdoh01:
First sorry to disappoint you in lg k10 cant use this method you said to get ota cause after 2-2017 update cant be rooted so it will not work

Second it will take alot more time than 20 min cause my device is unlocked I have to lock it again to try this method

Third I am useing magisk 19.3 and it work along with magisk xposed

you can use try this way and see if it will work for you

Unlock bootloader

Boot twrp dont flash it

Allow modification and reboot than you will get message in every boot (your device is corrupted )

Boot twrp again

Dont allow modification

Flash magisk 19.3 and dont flash any thing else

And reboot it will take time in first boot and wish luck

Fourth my phone screen is broken too but I keep using it any way
[Miscellaneous Android Development] diplomatic:
If by "partial" you mean the bootless Magisk method, then a lot of people will disagree with you on that. Plenty of reasons to go with that solution over systemless install: you want to keep boot/system untouched for a variety of reasons, you want to keep the BL locked, you only need to make occasional administrative changes, you think security/privacy on your phone is relevant, and so on...

Anyway, this is all OT and you 2 should take this to the appropriate LG rooting forum...

Which phone and which OS? I'm using the latest MM just fine on Android N.

Why is that? mtk-su doesn't care if your BL is unlocked or you have Magisk. Trying 'mtk-su -v' takes less time than writing that post.
[Miscellaneous Android Development] vddrnnr:
Hi diplomatic,

It's a Nokia 5.1 plus ( x5 ) running PIE.

Best regards,

voidRunner
[Miscellaneous Android Development] diplomatic:
Oh, ok. I'm not sure why that happens on Pie. If I had a 9.x device, I would've had more insight.

Hey [MENTION=5312578]mrmazak[/MENTION], did you ever manage to get the latest Magisk Manager up and running?
[Miscellaneous Android Development] abdoh01:
You just said that there plenty of reasons to have advantages in keeping BL locked

And I have unlocked BL and magisk so it will be no use to try it in unlocked device that why it will take alot of time cause I have to backup then lock the BL (formatting the phone ) then try the method then restore and if it not working I will have to flash stock then unlock BL than root the phone then restore so it definitely take more than 20 min
[Miscellaneous Android Development] diplomatic:
[MENTION=8183734]abdoh01[/MENTION], I'm not saying you should uproot everything and try the bootless method in one go. You can simply run 'mtk-su -v' according to instructions in first post. If it doesn't spawn a root shell, then there's no sense in continuing to bootless Magisk. But if it does work, then you can know more or less that bootless root will succeed.
[Miscellaneous Android Development] mrmazak:
Not yet. I'm stopped on 7.1.1.

I can check it now.......

Update 7.1.1 works 7.1.2 works 7.2 did not work

After I updated the app the app froze on checking for update

Also the browser refused to open terminal emulator refused to open other various bugs.

Try it again with a fresh install and not update
[Miscellaneous Android Development] diplomatic:
OK, thanks, bro. So no go with the clean install? Is 7.1.2 the cutoff version for Android P?
[Miscellaneous Android Development] mrmazak:
As of this last test. Yes. cap the version at 7.1.2
[Miscellaneous Android Development] diplomatic:
OK, I updated the instructions with MM version info.
[Miscellaneous Android Development] abdoh01:
i have to flash stock to try it and even if it work in unlocked bootloader lg k10 that doesn't mean it will work in locked bootloader

and you must know that (lgk430dsy) is highly encrypted to degree that it seems impossible to decrypted it

dm-verity not working at all in this phone no matter how hard you try

i already tried enough to decrypt this phone but no use it still encrypted

if you have way to do so i will appreciate you to let me know
[Miscellaneous Android Development] Rustdroid:
[MENTION=8132642]diplomatic[/MENTION] Wanted to say thanks for this it allows me to run some apps like sdmaid, Titanium backup (installed apps only), Afwall+ They all work well. I noticed that I can't make any changes to system folder so apps like adaway don't work, it can't edit host file. Substratum themes don't work. I'm happy with what it can do, better than no root at all. I also have a Nokia 5.1 plus.

Thanks.

Edit: It's okay I just read that you can't modify System/Vendor partition unless boot image modified. Will have to wait until bootloader unlocked.
[Miscellaneous Android Development] mrmazak:
Good addition. I didn't have a device with a/b partition, so didn't run into that problem.

Adding asterisk to 'boot' on the boot/ recovery section will add boot back in. And an if-then line will fix the error of no recovery.

As far as what is nessesary to backup. I'm not sure.
[Miscellaneous Android Development] diplomatic:
Cool....Thanks for the feedback about this root method.

Something I'm concerned about is if you have visible boot_a and boot_b block device files, it means the suboot script is not doing its job. One thing it does is rename your active boot device file (e.g. "boot" to ".boot") so that Magisk can't find it if you try to run the updater (i.e. the "disaster prevention"). But I wasn't sure how to go about it on an a/b scheme. Can you help me out with that? There should be a property named ro.boot.slot_suffix that has either "_a" or "_b" in it. That was my assumption anyway. But apparently it doesn't exist on your phone? Can you check for any properties that have one of these strings with the getprop command?

That's ok, there actually IS a solution for a writable hosts file. :D I just tested this. Magisk has a module for a systemless hosts file. Just go to settings and tap Systemless hosts. Check if the module is installed. You then have to reboot to activate it. So do that, and on next boot cycle/init.d run, the /system/etc/hosts file will be mounted in a writable overlay, ready for your ad blocker to have its way with it. BTW, I used Manager 7.1.2. There seemed to be a glitch with this on the latest version even on Android N.
[Miscellaneous Android Development] diplomatic:
OK, suit yourself. But FWIW, as the creator of mtk-su, I have to say none of those things are relevant to mtk-su. There is nothing special about your phone vs. any other compatible device as far as this tool is concerned. All modern phones have dm-verity and encryption features incl. cryptographic signatures. Not sure what this "highly encrypted" business is.
[Miscellaneous Android Development] Rustdroid:
[MENTION=8132642]diplomatic[/MENTION] worked fine using MM 7.0.0 I'm going to try and update MM to 7.1.2 and see if that is working. Thanks mate.

Edit: Tried it and 7.1.2 doesn't work, going to have to stick with 7.0.0 on Nokia 5.1 plus.
[Miscellaneous Android Development] diplomatic:
[MENTION=4279823]rustdroid[/MENTION], nice, glad you got it sorted out. Maybe you don't even need to unlock the BL. :)
[Miscellaneous Android Development] Rustdroid:
[MENTION=8132642]diplomatic[/MENTION] I'm one step closer to not needing to only other thing I'd like to do is delete some pre installed apps but that doesn't matter I can just disable them. Oh Substratum themes would be nice but doesn't matter.
[Miscellaneous Android Development] diplomatic:
[MENTION=4279823]rustdroid[/MENTION], IMO, it's not worth deleting system apps because you can't reclaim the storage space, which is on the system partition, anyway....
[Miscellaneous Android Development] Rustdroid:
[MENTION=8132642]diplomatic[/MENTION] Yes that true so doesn't really matter. If you come across a way to get themes to work would be good if you could post it here. Thanks again.
[Miscellaneous Android Development] Qba_S:
For Nokia 5.1+ Pie the newest working Manager is 7.1.1.
[Miscellaneous Android Development] Rustdroid:
[MENTION=5662866]Qba_S[/MENTION] That works, Thanks.
[Miscellaneous Android Development] e.v.o:
Success on Sony XA1 G3121

I tried the solution in Post #135 from [MENTION=8132642]diplomatic[/MENTION] and it worked perfectly. Thanks!

Device: Sony Xperia XA1 G3121 with G3121_48.1.A.2.112_1308-4558_R3B. Bootoader Unlock Allowed: Yes. Bootloader Unlocked: No.

[EDIT] Is it possible to get rw on /system? I can't install busybox...
[Miscellaneous Android Development] Bananikus:
I have zte blade a530 (this phone is hopeless), it seems like mtk-su is working well, but magisk no, there is some selinux/whole partition structure mess i think.

$ ./mtk-su -v
param1: 0x1000, param2: 0x8040, type: 13
Building symbol table
kallsyms_addresses pa 0x40c5b500
kallsyms_num_syms 51717, addr_count 51717
kallsyms_names pa 0x40cc0700, size 675880
kallsyms_markers pa 0x40d65800
kallsyms_token_table pa 0x40d65f00
kallsyms_token_index pa 0x40d66300
Patching credentials
Parsing current_is_single_threaded
ffffff800837161c+40: ADRP x1, 0xffffff800943d000
ffffff800837161c+44: ADD xd, x1, 1216
init_task VA: 0xffffff800943d4c0
Potential list_head tasks at offset 0x390
0xffffffc02e1e9390 0xffffffc03f3ba390 0x000000000000008c
comm swapper/0 at offset 0x658
Found own task_struct at node 1
cred VA: 0xffffffc019f8c780
thread_info flags VA: 0xffffffc030e30000
seccomp mode VA: 0xffffffc030e30390+360
Parsing avc_denied
ffffff8008308d2c+0c: ADRP x4, 0xffffff8009686000
ffffff8008308d2c+14: LDR [x4, 108]
selinux_enforcing VA: 0xffffff800968606c
Setting selinux_enforcing
Selinux is already permissive
Trying seccomp-forbidden syscall
New UID/GID: 0/0
starting /data/data/com.termux/files/usr/bin/bash
#

# setenforce
setenforce: command not found
# /system/bin/setenforce
See setenforce --help
setenforce: Needs 1 argument

suboot.sh

New UID/GID: 0/0
CapInh:	0000000000000000
CapPrm:	0000003fffffffff
CapEff:	0000003fffffffff
CapBnd:	0000003fffffffff
CapAmb:	0000000000000000
open: /sys/fs/selinux/policy failed with 12: Out of memory
client: launching new main daemon process
[Miscellaneous Android Development] WesHTCB:
Hello [MENTION=8132642]diplomatic[/MENTION] im running on a low budget Wiko Ride (w-u300) whicch i was able to unlock bootloader. It is powered by a mt6761 chipset and a 4.9.1.1 kernel and a PIE os. Im also new to mediatek devices and not sure if i should proceed as i am unable to find stock firmware or recovery or any other support files at that in the event i were to brick. Its a cheap phone and im not going to cry if it were to break as i have 3 others. I am just curious if this would possibly be a valid method of even just a temp root in which i could backup stock system files to share with the community?
[Miscellaneous Android Development] NFSP G35:
^ no harm in trying.

I was able to run mtk-su and pull the boot.img and recovery.img off my Onn tablet (also Pie & unlocked bootloader) which came in VERY handy when I got stuck in bootloop because of trying to flash TWRP.

I was able to restore the stock recovery.img via fastboot.

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

^ no harm in trying.

I was able to run mtk-su and pull the boot.img and recovery.img off my Onn tablet (also Pie & unlocked bootloader) which came in VERY handy when I got stuck in bootloop because of trying to flash TWRP.

I was able to restore the stock recovery.img via fastboot.
[Miscellaneous Android Development] Abdo Ayman:
Hello First thanks for this thread and your hard work

second i have oppo f7 8.1 and im trying perm root and i do every thing as instructions say but when i get to press run script my phone reboot and when i go to script app to check last execution nothing appear so i tried adb method and the result was that

CPH1819:/ $ cd /data/local/tmp

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

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

armv8l machine

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

Building symbol table

kallsyms_addresses pa 0x40e18600

kallsyms_num_syms 54296, addr_count 54296

kallsyms_names pa 0x40e82800, size 703377

kallsyms_markers pa 0x40f2e400

kallsyms_token_table pa 0x40f2eb00

kallsyms_token_index pa 0x40f2ef00

Patching credentials

Parsing current_is_single_threaded

ffffff80083708f8+58: ADRP x2, 0xffffff8009729000

ffffff80083708f8+5c: ADD xd, x2, 1728

init_task VA: 0xffffff80097296c0

Potential list_head tasks at offset 0x3c8

0xffffffc05ff473c8 0xffffffc0129f23c8 0x000000000000008c

comm swapper/0 at offset 0x690

Found own task_struct at node 1

cred VA: 0xffffffc0b8b60000

Parsing avc_denied

ffffff800830c530+10: ADRP x4, 0xffffff8009a4d000

ffffff800830c530+20: LDR [x4, 1460]

selinux_enforcing VA: 0xffffff8009a4d5b4

Setting selinux_enforcing

Retrying...

Retrying...

Switched selinux to permissive

New UID/GID: 0/0

starting /system/bin/sh

CPH1819:/data/local/tmp #

help me pls
[Miscellaneous Android Development] diplomatic:
Great... good to know you got it working. You can't and wouldn't want to mount /system in r/w because dm-verity is still active. There are magisk modules that let you install busybox in systemless mode. It mounts a writable overlay on top of /system in some convoluted way so that files can be added or changed.

For some reason, the kernel is not letting magisk open the live selinux policy to patch it. Not much can be done about that. But what may work is if you skip the setenforce step in the script and leave your OS on permissive the whole time. I have not tested this, but try to comment out line 102 in suboot.sh, then reboot:

#setenforce 1