Gaining root with Magisk ??

Discussion in 'Android' started by smallhagrid, Jun 2, 2018.

  1. smallhagrid

    smallhagrid MDL Addicted

    Sep 14, 2013
    608
    445
    30
  2. secgeek

    secgeek MDL Novice

    Feb 8, 2018
    42
    13
    0
    How can there be general guide when almost every device, with every other OS has different rooting exploits?
     
  3. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    13,081
    13,979
    340
    #4 Yen, Jun 5, 2018
    Last edited: Jun 5, 2018
    Magisk is not a root tool only. It allows to sytemless-ly alter the system.
    It lets you modify the system without to touch the system-partition itself.
    It can load modules from its own repository and you can write your own modules

    It's about customization of configs and apps and debloating.
    I use it to:
    Have better sound and EU volume restrictions removed / Viper4Android with Neon
    Have ads blocked by hostsfile.
    Have root without to fail safetyNet check.
    Have voice call record enabled...
    Have youtube app that runs with screen off....
    .....

    Even at XDA there are a lot of people who actually do not know the purpose of Magisk.
    They are using Magisk as another root app while touching the syspartition either way.

    The advantage to have systemless modules:
    The system partition's integrity is untouched. (OTA)
    You simply can undo the 'changes' by removing the Magisk modules.

    Since Magisk belongs to my (digital) life (I mean my life personally) I'd be glad to help you. :D

    There is a generic part of the instructions and a device specific.
    The generic part contains things like to let Magisk modify your boot.img (Kernel).
    The specific part contains things like how to achieve that. (Extracting the original Kernel.....etc.etc..)

    Magisk is actually nothing but a Kernel modification (initramfs included).
    It unpacks the boot.img and modifies the ramdisk and patches the kernel. After that it repacks the ramdisk and kernel to a new boot.img. Therefore it does not support LZMA packed boot.img.

    What do you want to know? And what is your device specifically?
    BTW: didgeridoohan has made good tutos. And many brands/models are supported by Magisk
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Michaela Joy

    Michaela Joy MDL Crazy Lady

    Jul 26, 2012
    4,071
    4,651
    150
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    13,081
    13,979
    340
    #6 Yen, Jun 5, 2018
    Last edited: Jun 5, 2018
    Yes. Of course before one starts to tinker any personal data should be safe.
    And I'd suggest to make *even* a complete 're-flash' plan in case one needs to resolve a brick.
    Or at least think about that you might have to factory reset anything.

    There are some traps (Huawei) for instance. If you uninstall Magisk (means restore the original Kernel) AND you do forget to unlock OEM again before then your own FRP (FactoryResetProtection) becomes your destiny if you have R/W remounted the syspartition one time before!

    This means you cannot factory reset your own device / flash proper partitions in order to make it running again! There are crooks who 'sell' useless of services to unlock FRP because they want make benefit from your situation. But there is a good solution, too.

    @Michaela Joy I thought getting to developers option unlock one simply needs to tap the "Build number" entry 7 times in rapid succession...:)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,587
    340
  7. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    13,081
    13,979
    340
    You're right. SM-900V Verizon editions come with a locked bootloader. Those are not available in EU.
    First step to do is to get an unlocked bootloader since Magisk needs to flash an altered boot.img.
    This applies to any Android device.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. smallhagrid

    smallhagrid MDL Addicted

    Sep 14, 2013
    608
    445
    30
    Thank You Yen.
    I have a couple of V5+ devices I picked up when they were super cheap & are as yet unused.
    My biggest goal with any Android phone right at the start of using it is gaining root access;
    I do this mostly for debloating, but also because there are some functions & apps which require root access.
    I figured from seeing what has been posted at XDA that this is a confusing subject - lacking in overview & general info as I was a bit baffled by what is there - and I've been rooting my devices for years already.

    Soon I need to pin down exactly which ones I want to work on & I'll post back once I've done that bit;
    Historically I've avoided Samsung, Huawei, HTC & other makes that seem to be most resistant to unlocking and rooting.
    Still - some of the cheaper ones simply do not have good options even IF they can be manipulated a bit & I really miss AA51 as it was the best source for the kinds of info needed to work with the cheapo end of things.

    Thanks Again for offering to help !!
     
  9. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    13,081
    13,979
    340
    #10 Yen, Jun 7, 2018
    Last edited: Jun 7, 2018
    There are (still) not many Vivo smarphones owners here (EU)...rather Huawei...

    Well at Samsung phones it strongly depends on the carrier if rooting is easy or not. AFAIK only the Verizon variant comes with a locked bootloader.
    I am using the F variants because I want to choose the carrier on my own. In Europe people use replaceable SIM cards either way. People with carrier contract usually can change the carrier after the period is over. (Those with temporary SIM carrier lock)...

    Samsung phones are also hard to brick. (Soft-brick only). The only annoying part is the 'warranty void branding' AKA Knox counter once flashed an unsigned recovery/boot.img.

    You can take this into consideration....:)
    The general steps for preparation: (These are actually not very different to CF SuperSU root)

    -Find a way to unlock the bootloader (if locked) / -Get ADB / fastboot for the device.
    -Check if there is a working TWRP recovery available for that particular model
    -Check if you can get your current firmware package for download. Check out how to flash it if once needed.

    There are 2 ways to install Magisk. With or without a custom recovery.

    If you don't have a custom recovery or you don't want to run one (I myself don't run it to have most of original integrity for OTA) then you need the original boot.img. The ways to obtain it are different. At Samsung firmware image you just have to untar it. At Huawei there is a special tool the Huawai firmware (UPDATE.APP) extractor.....

    Apply Magisk:

    -TWRP method. Flash TWRP through fastboot. Flash Magisk with TWRP

    -W/O TWRP: Extract the original (current) boot.img from the firmware (on PC). Patch it with Magisk manager on your phone. Copy the patched boot.img back to PC and flash it through fastboot.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Hadron-Curious

    Hadron-Curious MDL Guru

    Jul 4, 2014
    3,730
    603
    120
    #11 Hadron-Curious, Jun 12, 2018
    Last edited: Jun 12, 2018
    @Yen
    Is it possible to root Samsung Galaxy Note 4 on Verizon network using Magisk? [ Hardware Number N910V.05, Build Number KUI84P.N910VVRU1ANI1, Model SEPF_SM-N910V ]. A cousin of mine gave it to me long time ago and I couldn't do the software update due to the network being in different time zone. It works normally but not perfectly as it should - there are apps that wouldn't run because it is on Android version 4.4.4 which is outdated.

    However, I left it in the drawer for months and I remembered it when I saw this last post by you hoping there could be a solution. I intend giving it out as a gift to anybody who doesn't have mobile phone in my street but I would like to put it in proper condition first.

    Thank you.
     
  11. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,587
    340
  12. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,587
    340
    Indeed, the device is still capable enough. If you want to try AOSP alike roms, unofficial Lineage OS works great (albeit with some minor bugs) on it.
     
  13. Hadron-Curious

    Hadron-Curious MDL Guru

    Jul 4, 2014
    3,730
    603
    120
    How safe is AOSP? There are many smartphones with open source Android that come with bloatware bundles - those annoying ads popping up when using them.

    I want to give it in perfect condition. Meanwhile, 'one good turn deserves another sometime' as some of the people in my street are very nice and friendly.
     
  14. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    13,081
    13,979
    340
    Depends on the people who create the AOSP based ROM. Cyanogen (lineageOS) is known to be safe, anyway since Samsung's hardware driver are special some things might not work (properly).

    Alternatively you can update to stock MM and since there is an exploit to unlock the BL you can magisk root it and load/install a magisk debloat module from the repo to remove unwanted apps.

    Since you want to have it in perfect condition I think a fully working phone on a debloated stock fw is better..

    You should figure in advance what exactly would not work on the AOSP ROM and then decide....if anything works without issues on the Note 4 then you can go for it....
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. fabre gastro

    fabre gastro MDL Junior Member

    May 29, 2018
    72
    25
    0
    jtag? (off topic)
    if you know how to jtag, wallah, you won't need any other exploit ever. imho. unless they block the jtag access pads itself from the mainboard pcb. xD
     
  16. fabre gastro

    fabre gastro MDL Junior Member

    May 29, 2018
    72
    25
    0
    AOSP are generally never bloated. i haven't seen any. sorry i may be wrong. but seriously bloated aosp rom? and the ads have nothing to do with aosp in my opinion. they are because of the apps "you" load from google play store which are loaded with admob binaries which all developers add to generate revenue for their free/paid apps. or you sideload using adb which are either prepregged with admob or other ad revenue platform mostly pirated apps.
    so i guess you must be really misinformed.
    have you tried apps from f-droid i can only say one thing, they have very very very few apps which carry advertisements, rest are foss and mostly pretty much everything is in github. such that you can roll your own.
     
  17. Hadron-Curious

    Hadron-Curious MDL Guru

    Jul 4, 2014
    3,730
    603
    120
    I Kindly agree with you on being misinformed about AOSP. Perhaps the ones I have come across happened to be bloated for the same reason you made mentioned of. Who knows when I didn't go further to try them myself?

    This is my first time of knowing about f-droid and I would like to trying it out and see what I can make out of it.

    @ Tito and Yen

    The Samsung Galaxy Note 4 in question took me a whole day to get it working and it is still on Verizon network with Android 6 and most apps now work. I wish I can get something newer than that. The LineageOS 13 I downloaded from XDA gave a boot-loop error which I have to go with the Android version 6 on Verizon network.

    Thank you.