yashsingh1/xdaforums huggingface dataset:
[Magisk] J.Michael:
I believe that "adb shell" should be very much like running a terminal emulator on your device , except that you are using your PC keyboard and monitor.

If you just type "adb shell", do you get a command line prompt? Try typing

ls -l
ls -l /sdcard

If the adb shell stops responding too soon for you to type several commands, then do one command at a time, specifying the command on the "adb shell" command.

I wouldn't use "su". I don't think you are trying to look at protected files.

I wouldn't try to run Magisk. Again, I don't think you need "su".

I would like to be sure that we understand when and where you used Magisk to patch anything.

Some time ago you used Magisk 26.1 to patch an AP.tar. You used Odin to flash that AP.tar (along with other tar files), and you had Magisk running on your device.

Is this old, proven, patched-AP.tar the file you have been using recently? And you have tried flashing this old patched-AP.tar with the old BL, CP, CSC_HOME -- no TWRP, nothing in USERDATA -- and tried booting (not booting to recovery to activate Magisk, just hold power until it starts to boot, then let go and wait, don't respond to the nag screen, just wait) and after 30 minutes it still hadn't booted?

Your dancing with TWRP is confusing things. I don't think Odin treats the different slots differently. I think Odin just takes whatever tar file is in each slot, in some order, and downloads each image file in the tar file. If you have a recovery.img in patched-AP.tar, and another in TWRP.tar, I think they both get downloaded, and one overwrites the other. Since you end up being able to boot to TWRP, it must have been the last one downloaded. But it was never patched by Magisk. And since the warning about "never flash unpatched" doesn't explain what the problem is, or how much patching is needed, that could be part of your problem.
[Magisk] n.p.:
Apologies for the delayed reply.

The device (a TV box) has no buttons. One normally enters recovery by pressing an object (toothpick, for example) into the headphone port.
[Magisk] Nergal di Cuthah:
What a terrible design, I'm sorry for your situation
[Magisk] pndwal:
Thats strange... Fastboot commands generally update current slot or common partitions, and switch to inactive slot is normally triggered only by an OTA update... 🤔 PW
[Magisk] J.Michael:
So, you have a button, but you need a toothpick to push it.

I hate the idea of wiping the boot partition to get the device to boot from the recovery partition, leaving you with no organic recovery. (I know, you have the fallback to booting from an external SD-card -- unusually considerate for an Android device supplier.)

My point was, until you try doing it the recommended way, you don't know how often you will need to struggle to almost boot to recovery to get Magisk active.

But you have it working, and you're happy, so there's no reason to change anything until something stops working.
[Magisk] n.p.:
But I have only one button. The Magisk installation instructions say:

With no "volume up" button, if I wanted to boot into recovery, I wouldn't know how. Also, I still have some older devices where I would describe the button behavior as "flaky" (to say the least), meaning that pressing the button sequence to boot into recovery actually boots into recovery about one-third of the time (don't ask me why). It just makes more sense to me to have the device set up with the way that I want it to boot (vrtually all of the time, except when I want to upgrade) as the default.
[Magisk] Tony2k:
There is an app can't access the root, this is the Magisk log: 578 3103 W : su: request rejected (2000)

Why does this block happen? All other apps have no problem.
[Magisk] J.Michael:
Maybe you refused its request one time and that rejection is recorded. Are you getting any prompt to grant permission?

Check Magisk Superuser page, look for list of apps, both granted and refused. Try deleting the entry for this problem app.
[Magisk] Tony2k:
No, that's the weird part because I set the requests to grant so there's no reason to deny permission. The app is neither listed as accept nor as denied.
[Magisk] Mister Floppy:
Sigh... as you suggested, I re-opened the issue on Github with version code 27002, and that even inspired another member to comment she/he has the same problem on his device, but the Github guys closed it with the label "not our issue": https://github.com/topjohnwu/Magisk/issues/8072

They commented that "this is because someone has umounted magisk's devpts".

As they were able to reproduce the problem with a single simple "su -mm -c umount -l /debug_ramdisk/.magisk/pts/" command, I really hoped that the process could be reverted the same easy way and asked them if they could tell me the required commands one by one to do so (I found a work-around for running "su" commands with the help of a "BASIC" interpreter app).

Then they posted a snippet of code that I'm really not tech savvy enough to understand. In my opinion they are very curt with us, and I don't want to tear nearly every answer out of them.

Instead I politely ask if somebody in this forum would be so friendly to have a look at it and could give more helpful hints how to solve the problem.

Thank you in advance.
[Magisk] J.Michael:
I don't think the C++ source was intended to show you how to "solve" your problem. It might be a sign that one of the developers is looking into your problem, or has a solution, or is asking for another developer's opinion.

I don't think you are going to "solve" your problem by manually mounting something.

I do not have a /debug/ramdisk, so I can't poke at this. If you are able to use "su" in some environment, you could try, instead of unmounting, issue a mount command to see what got unmounted. (Again, I do not understand the problem, I didn't even know su had a -mm switch, I don't know if they're saying these things got unmounted in *your* global namespace and someone reproduced the message by damaging *his* global namespace; or if in *your* environment these things are not mounted in the namespace being used in su in a terminal.)

There is some Magisk option that refers to global namespace. Start by looking in Magisk manager app Settings -> Superuser -> Mount namespace mode. Try changing that.

I think a lot of what you see as curt and unhelpful is a result of people who are not fluent in English making an effort to communicate outside of their very tight knit group.

You say you granted terminal emulator su privilege in Magisk app, *then* tried running su in terminal emulator. This is not the way I remember it happening. I thought I installed terminal emulator, tried to run su, and got a prompt "Grant or not". I don't know if that's right, or if doing things in a different order would explain your problem -- just something to try.

When reporting a problem to the developers, it is a waste of time arguing that you are sure you haven't changed anything other than the Magisk version between it working and it not working. If that response meant a module was unmounting something, then you have to uninstall (or at least disable) all modules, run the test, either it now works, or you have a log they might pay more attention to.
[Magisk] vitalikan131:
Hello, last time I updated the version of lineage os from 20 (for android 13) to 21 (for android 14). On an earlier version magisk worked fine for me, but when I updated and patched the boot image on a new version of Android, my phone went into bootloop so I rolled everything back to the original boot image. What should I do to make magisk work? Any workarounds?

Thanks in advance for your answer

(Redmi Note 10 Pro M2101K6G

LineageOS 21-20240523-NIGHTLY-sweet

Magisk 27.0 27000)
[Magisk] Nergal di Cuthah:
First try disabling or even uninstalling all modules. Then see if it boots.
[Magisk] J.Michael:
Also, make sure you are using an image from thd new ROM, not the one from the old ROM that worked last time.

And make sure your new ROM doesn't require that you patch init_boot instead of boot.
[Magisk] Mister Floppy:
Thank you for trying to help and giving inspirations of things to test!

The order you described regarding granting terminal emulator su privilege in Magisk app is exactly the same way it happens on my device.

Disabling/enabling or changing the setting regarding "Mount namespace mode" in Magisks' manager app betweeen "adb", "apps" and "adb and apps" makes no difference, "recv_fd: msg_flags =m 0, msg_controllen(0) != 24" is always the result when running the "su" command in the terminal app afterwards.

When entering "mount" in my "su-command working BASIC-interpreter-app environment", I'm getting a ton of results flooding the screen... too much for it to handle, it quits without any further message.

I think I will wait for a while to see if the - unfortunately by yujincheng08 already labeled as "closed" - issue attracts some attention of one of the other developers.

If not, I might consider going the hard way of first disabling my Magisk modules one by one to see if that makes any difference, and downgrading to a working previous version of Magisk.
[Magisk] pndwal:
I agree with the advice (from @J.Michael) above.

There is always much refactoring going on in Magisk, and when Devs (often) don't implement things correctly, take shortcuts or assume certain Magisk behaviours are there for their use or can otherwise be relied on, refactoring means they sometimes need to tidy up their act... I think Shana (yujincheng08) assumed it's a module if not custom ROM... So I'd certainly be trying with other modules disabled... You have several that may complicate matters, eg zygisk-detach, terminal_systemizer, omeones revanced, ExSDCard(!?), more...

On the other hand, vv,'s comment may indicate she thinks otherwise, that the issue may be with daemon.ccp code... Don't assume the response is for you (but I'm not sure about this; would have expected 'needs investigation' label to be added?)... It may also just be help for Devs needing to make their ROMs or modules comply...watch that issue for any further comments...

Hope it helps... Hope someone w/ Dev experience can clarify this here further too... 🙃 PW
[Magisk] Mister Floppy:
I just decided to post another log on the Github page with all Magisk modules disabled (with the error still occuring). Now let's see how things are going on their side.
[Magisk] vitalikan131:
It worked! Thank you very much for your help!
[Magisk] zgfg:
Just, don't forget to reboot after disabling the modules

And sorry, I forgot, have you tested from ADB:

adb shell

su

< Grant root to ADB >

< some command like ls -l / >

exit

You will also need to grant root to ADB in Magisk app, Settings, Superuser access, Apps and ADB
[Magisk] J.Michael:
Is the correct sequence:

enable Superuser for Terminal Emulator in Magisk manager app

run Terminal Emulator

run "su" in Terminal Emulator

?
[Magisk] J.Michael:
We should have emphasized that you must install the latest debug build of Magisk (which I *think* is the same as the builds labelled "Canary") before producing a log to post on github.
[Magisk] zgfg:
That's for TE (and that fails for him) but I asked above to use ADB from PC and then:

- enable Superuser access for ADB and Apps in Magisk app, Settings

- Run adb shell su from PC

- grant root if asked

to see would he have the mnt error as in Terminal Emulator
[Magisk] Mister Floppy:
Yes, I did reboot after having disabled the modules and before posting the new Magisk log.

I also tested all possible combinations of Magisk app settings under "Superuser access" and "Mount namespace mode", every time the same error.
[Magisk] J.Michael:
When I suggested fiddling with Magisk manager Superuser settings, I meant the "Mount Namespace Mode", which on my ancient Magisk manager has an option "Global Namespace". It appears to be a global option, and I have no idea of the consequences of changing it for every app.

I don't understand "it quits without any further message". Do you get a further message when you try something like "ls -ld /sdcard" in this BASIC environment?

Too much for *what* to handle? The interface to a shell? Your program? The BASIC interpreter?

Is running a command in this "environment" a matter of running a BASIC program you wrote which calls something like "system()", passing it a command string? How do you get the output of the command? Is there an option to get one line at a time, rather than having everything returned in one string?

You can run the "mount" command in a terminal. It almost certainly won't show the "pts" that's missing, but it will let you see that, while it *is* a lot of crap, it is not impossibly large. (For me, it is 52 lines, 6 KB.)

If your Magisk manager Settings has a toggle for "Safe Mode" (A.K.A. "Core-only Mode"), try that.
[Magisk] J.Michael:
I was trying to pin down whether there is a step "go into Magisk manager and somehow add a particular app to the list of apps authorized to use su".

He made it sound like he did that. I don't remember doing that. I thought that the first time an app tried to use su, I got a prompt. Whether I granted or refused, I thought that moment was when Magisk added an entry for that app.
[Magisk] Mister Floppy:
I installed the debug build of Magisk which is automatically downloaded when I click on "Magisk debug" button on the Magisk Github website:

https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk

I assume it's the latest one.
[Magisk] Mister Floppy:
You're right, I looked again and found that available options under "Mount Namespace Mode" on my smartphone are "Global namespace" and "Isolated namespace", obviously I confused it with the Magisk app settings under "Superuser access". Sorry for that.

Nonetheless, as suggested by zgfg in the meantime, I tested all possible combinations of Magisk app settings under "Superuser access" and "Mount namespace mode", every time resulting in the same known error.

There is no such toggle for "Safe Mode"/"Core-only Mode" in the Magisk Manager settings on my system.

Regarding the "BASIC" environment part:

I've tested it again in the BASIC environment, this time by redirecting the output into a file. I entered "mount >mount.txt" and got the attached file.

The BASIC app comes with many example programs written by its developer, one of them is called "f36_superuser.bas" with the description "The program implements a Superuser terminal". Here's what the manual of the app says on pages 127 and 128 about its used su commands:

Superuser

These commands provide for the execution of Superuser commands on rooted devices. See the Sample Program, f36_superuser.bas, for an example using these commands.

Commands

Su.open

Requests Superuser permission. If granted, opens a shell to execute system commands. The working directory is set to /. If you open a command shell with either Su.open or System.open, you can't open another one of either type without first closing the open one.

Su.write

Executes a Superuser command.

Su.read.ready

Tests for responses from a Su.write command. If the result is non-zero, then response lines are available.

Not all Superuser commands return a response. If there is no response returned after a few seconds then it should be assumed that there will be no response.

Su.read.line

Places the next available response line into the string variable.

Su.close

Exits the Superuser mode.

Here's the content of the "f36_superuser.bas" BASIC program:

!!

The program implements a

Superuser terminal.

Your device must be rooted

to successfully run this

program.

!!

! Get Superuser permission

SU.OPEN

! Main loop

loop:

! get the command from the user

TGET r$, "cmd: "

! if cmd is "exit"

IF r$ = "exit"

SU.CLOSE

PRINT "Exited"

END

ENDIF

! write the command

SU.WRITE r$

! Give system time to respond

PAUSE 500

! check for a response

SU.READ.READY ready

! if no input, do next command

IF !ready THEN GOTO loop

! read responses

DO

SU.READ.LINE l$

PRINT l$

SU.READ.READY ready

UNTIL !ready

! Go for the next command

GOTO loop

Source:

RFO-BASIC! Manual

rfobasic.miraheze.org
[Magisk] pndwal:
Yup, that link always gets latest; they don't want you using older Debug builds for obvious reasons...

Think they would have picked on logs if hadn't been Debug! 😜

Nah... Note the larger size/URL difference...

Canary used to be built as debug (with debug flags) so was required for issues, but it has been built as release for a while now (since many users want it for daily use and debug builds are resource hungry which can affect older device performance/stability).

Anyway, that's why they added Debug (built as debug) channel and GitHub link... Can be confusing as both are built simultaneously from the same commits in same https://github.com/topjohnwu/magisk-files/tree/canary repo/branch... 🤠 PW
[Magisk] pndwal:
FWIW, Shamiko fixes are being built again; internal Alpha testing only for now... 👍 PW
[Magisk] mrgbuzz:
I'm getting a failed message when I try to rename Magisk. This is my current install.

Do I need to downgrade to be able to hide root?
[Magisk] bdr127:
Known issue with Canary 27002. Either switch to stable or debug and it will work.
[Magisk] zgfg:
It's only about hiding the APPLICATION Magisk, not hiding Magisk and root themselves:. I never use - however I use LSPosed and its Hide My Apps module (to hide not only Magisk app but all other root apps, mainly LSPosed modules - from the particular banking and similar apps that look for them; btw, Play Integrity does not look for any of them)
[Magisk] J.Michael:
I still don't understand "too much to handle". When you run a BASIC program, do you get the output in a "window" with limited scroll ability?

I don't see "pts" or ".magisk" in your mount output, so I'm no closer to understanding.

Can you reproduce the error in the BASIC environment by using the "umount" command posted on github?

I'm not sure what good it will do, but I would like to confirm that you are using Magisk's su. Do

which su
ls -dl $(which su)
ls -dl /data/data/android

in the BASIC-su environment.

Does the BASIC provide a "system.bas"? I'm guessing if you make a copy of superuser.bas and change all "su." to "system." you'll be running in a non-privileged shell. Try that, run the "which" and "ls" commands again; try "su -c ls -ld /data/data/android" to see if you can run "su" within a non-privileged shell; then try the killer command from github.

Maybe you should just go back to the Magisk that worked for you. I have read that renaming the appropriate magisk.apk to magisk.zip and then installing it as a Magisk module in the manager app (the current manager app, do not start by installing the older manager app) will replace the Magisk installed in boot.
[Magisk] pndwal:
Just checking... Poco is completely stock right?; Didn't flash Franco (or other) custom kernel?... 👍 PW
[Magisk] Mister Floppy:
That's correct. And I didn't flash a custom kernel.
[Magisk] Mister Floppy:
In the "BASIC" app, there is an "Editor" mode and a "Run" mode.

When I load the "f36_superuser.bas" program which implements a Superuser terminal in "Editor" mode and run it, it switches to another window in "Run" mode with a "cmd:" prompt:

When I enter a command like "ls" from there, I can scroll the corresponding data in the output window. Contrary to the "mount" command, where I just see the corresponding data flooding the output window for a very short time, then the "BASIC" app closes the output window automatically and jumps back into "Editor" mode without any further explaination. I assume the sheer amount of data produced by the "mount" command is too much for it to handle.

If you want, you can try it by yourself, the "BASIC" app is a handy, very light-weighted one, has no ads, comes with an exhaustive manual and is for free!

Source:

RFO-BASIC! Manual

rfobasic.miraheze.org

I can't reproduce the error in the BASIC environment by using the "umount" command posted on github, if I

enter it, I just get back the "cmd:" prompt. Entering a su command like "getenforce" for test purposes still does produce an expected response like "Enforcing".

For the results of the commands you posted please see attached screenshot.

Unfortunately, there is no "system.bas" or something like that in the examples.
[Magisk] J.Michael:
Is there an "su.bas"?

The extract you posted mentioned using "su.open" or "system.open" to open a command shell. I meant for you to make a copy of "f36_superuser.bas" and change all references to "su." to "system.", to see if that would give you an alternate path to a shell. Assuming it did, I was curious whether "pts" would show up in the output of "mount"; whether "su -c ls -l /data/data/android" would show that su works; whether the umount command posted on github followed by the sample su command would reproduce the problem you are having.

Nothing I suggest is going to lead to a solution of your problem. I was just curious.
[Magisk] timea:
What are the current solutions to modify read only partitions such as my_*, vendor, product...etc directly?
[Magisk] Mister Floppy:
You're right, I overlooked that the "BASIC" apps' SU commands actually have corresponding SYSTEM commands.

When running the commands you suggested in the adapted BASIC program, I get the attached screenshot.

When entering "mount >mount.txt", I get the attached output file.

When I enter "su", I get the Magisk prompt to grant "super user access" to the "BASIC" app. The umount command posted on github does not reproduce the problem I'm having, tested it with entering "getenforce" and getting back "Enforcing" afterwards.

I also stumbled over the following extract from the apps' manual:

System

The System commands provide for the execution of System commands on non-rooted devices. The SU commands provide for the execution of Superuser commands on rooted devices. See the Sample Program, f36_superuser.bas, for an example using these commands.

The App commands provide for sending messages through the Android system to other applications on your Android device. They are not related to System or SU, but they are typically used to replace commands of the form System.write "am start " or System.write "am broadcast ".

I I understand this correctly, the "BASIC" app is using some work-around and thus does not show the same symptoms after running the killer command.
[Magisk] J.Michael:
I think this su or system interface from BASIC is not capturing STDERR, just STDOUT. You could check the manual to see if there's another call you need to make to get it to return STDERR. There might be a shell command that will accomplish this. I don't know. This is a side nuisance.

Given that some kind of shell environment is compatible with su, I suggest revisiting the idea that you have poisoned your terminal emulator.

Try installing a different terminal emulator. I use Android Terminal Emulator by Jack Palevich from the Google Play Store. If you are a.ready using it, you are on your own to pick another. I downloaded the Kali Nethunter when @zgfg suggested it to someone as an easy way to check whether the problem of the moment was tied to the choice of terminal emulator. I could not get it to behave at all like I expected. I have avoided Termux because I don't trust that it will put me as close to my "real system" as I would like.

Maybe easier would be uninstall your terminal emulator, make sure there is no residual entry in Magisk manager, reinstall, and try using su.

More thorough, but more drastic: delete everything under /data/adb, reboot, test. (Maybe rename /data/adb, then rename back after test, rebooting after each rename.)
[Magisk] kakashikeshu21:
Hello, excuse my bad English, I use Google Translate, I have Slimbox 11.26 aosp installed and I want to use the DirecTV Go application, but when I run it and start it, a logo appears that says: Your operating system has been changed, I don't know what to do to get it Start correctly, if anyone knows how to edit the apk or the firmware so that this apk works correctly, or some way with magisk or some other method I would greatly appreciate it, I would appreciate your help.