Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why CANT WE USE MAGISK? #5

Open
xAffan opened this issue Apr 4, 2021 · 13 comments
Open

Why CANT WE USE MAGISK? #5

xAffan opened this issue Apr 4, 2021 · 13 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@xAffan
Copy link

xAffan commented Apr 4, 2021

Magisk can work on systems that can only be mounted as read only. It's fairly cool too! (Magisk modules, edxposed or Lsposed) so that should be your goal instead of the trashy old superSU

@CerisWhite
Copy link
Owner

CerisWhite commented Apr 12, 2021

While I appreciate the input, I have no idea how Magisk works. Even after looking through their install scripts, I'm utterly baffled by how to implement it all. If anyone can piece it together, I'll gladly incorporate the changes. I jumped between r/Android and a few other discord servers trying to get more information and absolutely no one had any further information on it.

Also, SuperSU isn't "trashy". While it's not the most up-to-date method, it still works. The real issue here is the inability to set the image to mount read-write, which I'm still working on, alongside getting ARC into builds of ChromiumOS.

@CerisWhite CerisWhite added help wanted Extra attention is needed question Further information is requested labels Apr 12, 2021
@vinaykharayat
Copy link

Well, I am not an expert but when I tried to understand how magisk works, I found something interesting. Basically in other rooting methods, we place the su file in the /usr/bin folder and execute it. But magisk has a clever concept behind this. What @topjohnwu did is modified the boot.img and made some other path (data/sbin) to be used to execute su. I hope you will find the below links useful.
https://topjohnwu.github.io/Magisk/
https://topjohnwu.github.io/Magisk/details.html
Although I have no idea about Chromebook system architecture, I think magisk provides a manual method to path boot.img If Chromebook has boot.img concept (as it should) you can try patching boot.img and compare that to the unpatched version. Or you can try this with any android boot.img to get the idea.

@CerisWhite
Copy link
Owner

ChromeOS does not use boot.img. The only images the containers require are system and data partitions, thus leaving the current method unusable. If there was a way to force all system modifications to be written to /data instead, that would resolve all our issues, but that just doesn't seem to be possible.

If anyone can correct me on this, please do

@xAffan
Copy link
Author

xAffan commented Oct 6, 2021

If I'm not wrong, there must be something that tells the system that it needs to execute x from x path or just basic instructions. I'm not exactly sure where they are but it's really worth looking into as with magisk, we might even pass safetynet. The upcoming zygisk will provide even more powerful tools.

@vinaykharayat
Copy link

ChromeOS does not use boot.img. The only images the containers require are system and data partitions, thus leaving the current method unusable. If there was a way to force all system modifications to be written to /data instead, that would resolve all our issues, but that just doesn't seem to be possible.

If anyone can correct me on this, please do

Chrome OS is Linux based there has to be a boot partition.

@CerisWhite
Copy link
Owner

CerisWhite commented Oct 7, 2021

Chrome OS is Linux based there has to be a boot partition.

Not all Linux systems are the same. ChromeOS does not use /boot and neither does the android container. That said, the way ChromeOS boots isn't part of this repository and I won't go into detail, but my discord tag is now in the readme and you can discuss with me there if you're curious.


@xAffan That would be PATH variables, but those don't really do much for the system as a whole unless we set up a bunch of funky symlinks to redirect the System partition to the Data partition. I'd much rather figure out why changing the arc.properties trashes the whole image but I'm not exactly making much progress.
On a side note, there's a lot more going on with Magisk than just "redirecting". It's a lot more complicated than "why don't we use this?", especially on ChromeOS, which is fundamentally different from using a real android device. Like I said before, I cannot read the scripts used by Magisk, rendering it impossible for me to incorporate those methods.

No one else I've tried to talk with has any idea how it works either, so until I get some outside assistance, there's no way to even start working it into my current script.

@Geofferey
Copy link

I may be able to offer you some insight... Magisk essentially works at it's core by replacing the init binary in root of system / boot.img. Since the android subsystem doesn't use a boot.img we may be able to replace the init daemon in rootfs with magiskinit. On newer versions of ChromeOS they seem to be using Android 10 so magisk v21.0 should suffice for now. I plan to play with this concept some since CrAnberry doesn't seem to be working on my HP X2 '11. Hopefully this little bit of info is helpful.

@CerisWhite
Copy link
Owner

@Geofferey It's entirely possible that Android 10 breaks this method yet again. As I don't have a recent Chromebook with Android to test on, I'm afraid this is as far as I can go. I'm more than happy to discuss my current findings and see what's possible as far as getting this (and your) project up to speed with Magisk, though.

@zainullahk
Copy link

magisk could be possible when android apps move to vm

@xAffan
Copy link
Author

xAffan commented Mar 11, 2022 via email

@PicPew00
Copy link

PicPew00 commented Apr 7, 2022

there is a similar project going about chrome os root https://github.com/newbit1/rootCROS maybe you can help each other

@CerisWhite
Copy link
Owner

@PicPew00 Thank you for pointing my attention to that. If they ever reach out to me, I will gladly accept their help, but it seems like they don't intend to support any other devices other than the ones they have listed already. I'd have to read through the script myself to see if what they do can be adapted. For the most part, I've moved on to other projects and have accepted this one as complete, since I do not have a ChromeOS device with the latest version of android to work with anymore.

@heremiah81
Copy link

I know it has been over a year but if there is a Ramdisk you should be able to patch with Magisk, and even if there isn't a valid ramdisk (or boot.img }maybe look into a fork called Magisk Delta? The dude that runs that dist is named HuskyDg (or some amalgamation of husky Dog.) I'm trying to gain root on an old HP G3 chromebook for research reasons...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants