yashsingh1/xdaforums huggingface dataset:
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
I'm not good with script, but here is my understanding,

In case of inaccessible data during flash, magisk will flash magisk.img temporarily in cache partition. During booting (after data is unencrypted), magisk check if the workaround image in cache exist and move it to data

scripts/flash_script.sh

if (is_mounted /data); then
IMG=/data/magisk.img
else
IMG=/cache/magisk.img
ui_print "- Data unavailable, use cache workaround"
fi

jni/daemon/bootstages.c

// Merge images
if (merge_img("/cache/magisk.img", MAINIMG))
goto unblock;
if (merge_img("/data/magisk_merge.img", MAINIMG))
goto unblock;

jni/magisk.h

#define MAINIMG "/data/magisk.img"
[Sony Xperia X Compact Guides, News, & Discussion] ondrejvaroscak:
Cool, very clever. I did not make the effort to study in in depth, but expected some sort of solution to exist when users succesfully installed Magisk even when they can not mount /data in TWRP. This temporary /cache mount is just nice example of clever programming :)
[Sony Xperia X Compact Guides, News, & Discussion] voilsb:
Hey, I think I pseudo-bricked my device while following these steps. I used fastboot to boot into TWRP, without disabling encryption, on Nougat 7.1. I didn't notice the requirement to disable encryption in Post #8 until afterwards.

Now the device appears to be on (my computer detects an unknown device when I plug it in), but it doesn't show any LEDs or react to any buttons. Is my only recourse to wait till the battery dies in a few days and try again, or is there another way?

HAHA, I found if I hold EVERY button (power, vol up, vol dn, and camera), the phone restarts and I have access again. w00t!
[Sony Xperia X Compact Guides, News, & Discussion] baz1:
Just wondering if somebody tried this with Nougat 7.1? I can't get TA_POC to work, security test displays error and sim card is not detected.
[Sony Xperia X Compact Guides, News, & Discussion] ypnos42:
Yes this works with 7.1 the same as with 7.0. How did you perform the update to 7.1?
[Sony Xperia X Compact Guides, News, & Discussion] gabed90:
I followed the guide to perfection, and everything works perfectly...but...If I want to turn a user app into system apps, link2sd gives me this error: mount: '/dev/block/bootdevice/by-name/system'->'/system': Device or resource busy" and system app mover gives me this error : "could not remount /system".

is system read only? why? I've already tried to enable "rw" "ro" through the command line without success...

Can anyone help me?

p.s. I have granted root permissions to the applications mentioned above at their opening
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
Did you disable RIC when patching the kernel?
[Sony Xperia X Compact Guides, News, & Discussion] gabed90:
Yes
[Sony Xperia X Compact Guides, News, & Discussion] gabed90:
I can not upload photos because of my posts below 10...
[Sony Xperia X Compact Guides, News, & Discussion] ypnos42:
gabed90, enable USB debugging on your phone and run the adb shell. In adb shell, enter `su` command to become root. Then enter `mount -o remount,rw /system`. Does it work?
[Sony Xperia X Compact Guides, News, & Discussion] gabed90:
F5321:/ $ su

F5321:/ # mount -o remount,rw /system

mount: '/dev/block/bootdevice/by-name/system'->'/system': Device or resource busy

1|F5321:/ #
[Sony Xperia X Compact Guides, News, & Discussion] ypnos42:
I observe the same behavior here. Maybe it is related to Magisk?
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
Yes, I have the same issue. Flash FTF using flashtool, sim card detected. flash modified boot image using fastboot, now the simcard is not detected. Security test is still failed.

For now I downgrade back to 7.0

Edit: during flashing with flashtool, it complaint about kernel debug something in the fsc is missing
[Sony Xperia X Compact Guides, News, & Discussion] gabed90:
It works well with 7.1.1 for me...have you the latest version of flashtool?

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

Has anyone tested it with magisk 13 beta?

I do not get flash errors, but The magisk manage app tells me that root is not installed...with 12 it's all ok
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
I haven't tried 13 yet. But according to the beta thread, it seems auto hide is not working properly. But someone found you can disable and enable it again in Magisk Manager and it might work.
[Sony Xperia X Compact Guides, News, & Discussion] qvmuhuuxz:
Thank you for this guide.

I see you do not install TWRP, but only boot it to install magisk.

If we choose to install it, android pay/safety net is still useable?

I think TWRP now still cannot decrypt our /data with nougat, but in the future when it can it will be even more useful to have TWRP installed.
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
I'm not aware that SafeyNet checks the presence of custom recovery, so it's highly likely TWRP should work with SafetyNet.
[Sony Xperia X Compact Guides, News, & Discussion] qvmuhuuxz:
Ok great, thank you.

I noticed that I tried to build the kernel with ta_poc including twrp, by naming it recovery.img like it wanted.

Then the second step with the rootkernel tool, I answered 'no' to the TWRP question (because I already had put TWRP in the kernel image via ta_poc).

But when I tested after flashing, I didn't get TWRP to show when I held vol up/down (I forget which, I tried both)...

So I simply did fastboot flash recovery twrp.img and it works fine... :)

Any problems or differences with flashing 'direct' to the recovery partition and not all in one with the kernel?

I haven't tried android pay yet but I guess it will work fine.

--

It is normal for SafetyNet to fail if Magisk Hide is not enabled?
[Sony Xperia X Compact Guides, News, & Discussion] gabed90:
Yes it's normal
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
Same here for magisk 13.1. Both in app updating and flashing from twrp failed
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
I just tried the official release of Magisk 13.1 yesterday and both in-app update and TWRP flashing resulted in no Magisk installed at all.
[Sony Xperia X Compact Guides, News, & Discussion] recurvered89:
I'm not to familiar with rooting android or anything but it is something I feel I need to have on my phones just for the adblocking alone, I'm thinking of returning the moto z play I just picked up and buying this phone instead and I just have a couple of questions.

This is still the correct way to root the phone on 7.0+?

Does any of this enable the fingerprint sensor on the US version on the phone? or has anyone got a way to root and enable the fingerprint sensor?

Thanks
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
This guide was written with my Marshmallow XC. So I don't quarantee it works on Nougat. But at least you need to downgrade to Marshmallow before you start everything because the DirtyCow exploit is already fixed in Nougat and we need it to backup the TA partition.

As for fingerprint sensor, I think you need to flash non-US ROM and you should be fine. It's only disabled in US.
[Sony Xperia X Compact Guides, News, & Discussion] recurvered89:
Thanks for your response, I'm really not to familiar with doing this stuff, when do you think I should flash the non-us rom, before or after I follow the steps in this guide?
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
You can begin with flashing directly the non US Marshmallow ROM.
[Sony Xperia X Compact Guides, News, & Discussion] Noisemaker00:
Hi guys :)

I wanna install Magisk on my X Compact to remove bloatware. Is this guide still valid with latest firmware with Android N (7.1.1)??

I mean: if I follow all steps with Marshmallow then can I upgrade to 7.1.1 via OTA/flash?

Will Magisk, SafetyNet trick, etc stop working or give problems?

PS: what is it RIC service?

I done some search around the web and understands a little bit more things about this procedure.

So, in addiction to previous questions, I want to ask:

Is necessary to disable DM-Verity and Sony RIC?

As far as I understand Magisk can run with RIC enable, right?
[Sony Xperia X Compact Guides, News, & Discussion] Noisemaker00:
I done some search around the web and understands a little bit more things about this procedure.

So, in addiction to previous questions, I want to ask:

Is necessary to disable DM-Verity and Sony RIC?

As far as I understand Magisk can run with RIC enable, right?
[Sony Xperia X Compact Guides, News, & Discussion] dohanin:
If I don't have a backup of the TA partition, does it mean that there is no way I can proceed with this method?

I think I have lost my TA partition when I followed this method to root my phone ->

http://www.stupdroid.com/2016/10/root-sony-xperia-x-compact.html

where "DRM patch from tobias.waldvogel" was used.
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
I think DM-Verity is needed. But you can leave RIC as enabled if you don't plan to change the system partition.
[Sony Xperia X Compact Guides, News, & Discussion] itandy:
DRM patch is a method to make your system thinks the DRM key is intact. You need to run the DirtyCow tool to backup your TA partition before unlocking your phone. Otherwise, it's lost.
[Sony Xperia X Compact Guides, News, & Discussion] Supremad:
I tried to update Magisk (from 12.0 to 13.2) and now Magisk Manager don't detect root anymore.

I don't know what happened, cause I've just flashed magisk zip into twrp recovery.

Do I lost root ? And do I need to reflash my device ?
[Sony Xperia X Compact Guides, News, & Discussion] trewelu:
I don't think magisk 13 work for xperia . https://github.com/topjohnwu/Magisk/issues/265

to revert:

1. flash back boot image

2. boot to twrp

3. wipe cache/davlik. this is needed because without access to data, magisk install temp image on cache. if it already exists in cache (from failed instalation of v13), it will skip installing there for v12

4. install magisk 12
[Sony Xperia X Compact Guides, News, & Discussion] Supremad:
I've just reflashed magisk 12.0 under TWRP and it seems that I have recover full root access. I will be waiting the XC support to update magisk.

Also anyone know how to update android without loosing root, drm and if possible data ?
[Sony Xperia X Compact Guides, News, & Discussion] feder7_7:
Tested.

Magisk is not working with RIC enabled. Even flashtool (when you connect "normally" your phone [just plug your ubc cable without pressing any buttons] with usb debugging enabled and allow it on phone screen, flash tool logs some information on screen) doesn't recognize root access with RIC enabled (I tried enabling both in ta_poc and kernelroot... haven't tried other combinations)

So... we need:

DM-Verity: disabled

RIC: disabled

(it's a pity... but as advanced users I think we can live without that security measure).

---------- Post added at 06:15 PM ---------- Previous post was at 06:09 PM ----------

Magisk 13.3 / Magisk Manager 5.1.1 is working with X Compact :)

---------- Post added at 06:43 PM ---------- Previous post was at 06:15 PM ----------

What I did was flashing 7.1.1 (ROM 34.3.A.0.217; easy to get using xperifirm) after getting TA from 6.0.1 (34.1.A.1.198) and unlocking while having that version.

(I mean: _1- backup TA while having 6.0.1 ; _2- unlocking... TA will be erased from phone; _3- flash 7.1.1; _4- root kernel & re-TA your phone all the same time using method from this thread)

I don't know if OTA is going to work. But if it does, I think that there's a chance to lost your rooted kernel... And you will need to reflash the new rooted kernel.

See tobias.waldvogel's post for full description.

(sorry, I can't post links because I am not root. Post title is "[ROOT][Kernel][TWRP] repack of the stock kernel with dm-verity and SONY RIC off" and was linked in first post of this thread)

---------- Post added at 07:27 PM ---------- Previous post was at 06:43 PM ----------

I've managed to do it using encryption enabled.

-Edit-: Added clever reference of steps just in case original post is modified.

What I did was keeping my phone turned off after flashing lastest rom (7.1.1 / 34.3.A.0.217; see above).

Then I flashed boot.img into phone (final part of step 2 in original post) and then I booted up in TWRP and installed magisk (step 7 & 8 in original post).

I've never turned on my phone until step 9 (installation of magisk manager).

I've skipped steps 4 & 6 (checking that TA is recovered) in original post (but you may check out that TA is restored; and after that reflash 7.1.1 and repeat step 2, before going to step 7 & 8).

In order to allow accesing magisk zip (kind of step 5 in original post), I put it inside an sdcard using a card reader in my laptop. But if you don't own a sdcard reader in your computer, but you own an sdcard, you can put magisk inside your sdcard before flashing latest rom (while on 6.0.1).

If you run into problems following this method you can apply solution on #17 and then go with #8 .
[Sony Xperia X Compact Guides, News, & Discussion] andrej4711:
Thank you very much, itandy, for this work!

I've followed the guide and got it working for my fresh X Compact.

- downgrade to MM using F5321_34.1.A.3.22_R5B_Central Europe 1 Generic_1304-8434.ftf to generate TA backup

- upgrade back to Nougat 7.1.1 by F5321_34.3.A.0.228_DE.ftf

- use kernel kernel.sin from F5321_34.3.A.0.228_DE.ftf for steps 6,7,8

- install twrp-3.1.1-kugo-2017.08.22.img into recovery

Security check by *#*#7378423#*#* shows no problems (WIDEVINE, FIDOKEYS), camera and Sony extensions seem to work properly.

But:

- SafetyNet check fails.

- Netflix seems to detect the device as "non-genuine" by marking as incompatible in playstore, but latest apk from apkmirror runs without problems (including offline function).

- OTA system update 34.3.A.0.238 fails to install, but should be expected?
[Sony Xperia X Compact Guides, News, & Discussion] ondrejvaroscak:
You need to use for example MagiskSU and Magisk Manager in order to pass SafetyNet.

You also need to know that Google is constantly working on countermeasures to detect SafetyNet violations and masking. You need to wait for developers to come with new versions of SafetyNet masking. it is endless game..

OTA will not work, it is expected behaviour.
[Sony Xperia X Compact Guides, News, & Discussion] andrej4711:
In fact, I've installed Magisk-v12.0 and MagiskManager-v5.3.0, but it didn't work.

Now, after flashing Magisk-v13.3 and installing MagiskManager-v5.4.0.apk it works - MagicSU is available and SafetyNet "succeed"!
[Sony Xperia X Compact Guides, News, & Discussion] ondrejvaroscak:
What version of firmware and version of Google Play Services are you using?
[Sony Xperia X Compact Guides, News, & Discussion] andrej4711:
Firmware version 228, google play services 11.5.18 (not sure for the last).

In the meantime, I've upgraded to firmware v238 (downloaded by XperiFirm.exe) as follows:

1. Build new boot.img by "TA PoC" and "Tobias kernel repack tool".

2. Build 34.3.A.0.238.ftf (from the folder downloaded by XperiFirm.exe) and flash it, reboot into system -> OK

3. Flash boot.img from step1, reboot into system -> OK (incl. Sony keys)

4. Reboot into fastmode, flash TWRP.

5. Reboot into recovery, flash Magisk v13.3 , reboot into system -> OK (incl. SU and SafetyNet).

I think (and even hope:)) some steps were unnecessary (esp. step 2 is time consuming), but my phone hangs if doing dirty flash of boot.img v238 over installed v228).

Is there a simpler upgrade procedure (to be ready for the next Sony system update)?
[Sony Xperia X Compact Guides, News, & Discussion] 9h0s7:
For Oreo? Definitely not.
[Sony Xperia X Compact Guides, News, & Discussion] andrej4711:
I was thinking rather about monthly patches...
[Sony Xperia X Compact Guides, News, & Discussion] 9h0s7:
I doubt we'll get another monthly security update before Oreo drops
[Sony Xperia X Compact Guides, News, & Discussion] eresac:
I've followed this guide and found two issues, hope you can help on.

First, I'm not able to make Magisk work (installed, but no root): I guess I have to investigate on magisk thread on how to activate it, but I'll do when I have time since surivived by installing SuperSU.

Second, I have a kernel rooted but in "enforcing" mode, not "permissive": I've disable both DM-Verity and Sony RIC (also Force-encrypt); is that normal or there's something I made wrong?

Thanks in advance for your suggestions.
[Sony Xperia X Compact Guides, News, & Discussion] ondrejvaroscak:
Magisk 14 works, there was an issue on previous versions of magisk on Sony phones.

Enforcing mode is default even if you are rooted, you may need Selinux mode changer app to switch to permissive on boot or use boot script (init.d or analogous)
[Sony Xperia X Compact Guides, News, & Discussion] eresac:
Thanks a lot!

For Magisk, I'll try the procedure again with newest version, when I have time.

About permissive Selinux mode, I saw the stuff regarding Selinux mode changer and init.d scripts. But if I understand well, there's no way to change the default while creating boot image.
[Magisk] mkhcb:
Hi guys, I currently have a chromium browser with built in adblocker. I would like the browser to use its own adblocker and not use the system host file from AdAway.

AdAway blocks certain links like Google shopping and Slickdeal links. I have tried to whitelist these links in AdAway, however, this causes lots of apps to display ads. Consequently, I would like to whitelist things on the browser end and use the AdAway host file for system wide ad blocking, within every other app.

That said, may a Magisk module be made where Chromium uses a blank host file and the rest of the OS uses a different one? Does an app/tweak/mod like this already exist?

Any assistance would be much appreciated. Thank in advance.
[Magisk] JRJ442:
I know this isn't the answer you're looking for, but you could try Adguard instead. There are options to allow useful ads, such as Google shopping links and Slickdeals. If you use it in VPN mode you don't even need root. It never messes with your host file so it won't trip SafetyNet.
[Magisk] Didgeridoohan:
Since when does an edited hosts file trip SafetyNet?
[Magisk] JRJ442:
Isn't that the whole reason for systemless host files? That's the impression I was given.
[Magisk] Didgeridoohan:
Nope.

Keeping your system mods systemless doesn't have anything to do (directly) with passing SafetyNet.

Copy-pasta incoming:

I've said it before and I'm sure I'll say it again. The purpose of Magisk is NOT to hide root and pass SafetyNet (it's just a really nice feature); it's to make your system modifications systemless. You could use this to keep your devices ability to update through OTA, with a couple of extra steps. But, the main advantage for me (and it's the deal-breaker) is that I don't have to redo any of my system modifications after an update. These could be changing screen density, debloating system apps, systemising apps, changing prop values, etc. Before Magisk I could spend 30-45 minutes after an update just setting upp all the system tweaks the way I wanted it, only to realise a couples of days later I'd forgotten something. Now, with Magisk - flash the update, done!
[Magisk] JRJ442:
I thought I read in the Adaway thread some time ago altering the host file will trip it, maybe that was just with SuperSU tripping it rather than an altered host. Either way, my first post in this thread was an alternative to helping the OP with his issue of certain sites being blocked, so its valid. Adguard would be a great alternative to the problems he's having with sites being blocked.
[Magisk] Deic:
I can do the module you want, but I haven't many free time this week.. I will see what I do
[Magisk] mkhcb:
This would be great. Please keep me posted!
[Magisk] alagga:
Was the module ever made?🌚
[Samsung Galaxy S8 Questions and Answers] Prosperous:
Having come from years of Nokias to the first iPhone and sticking around until my current one, the iPhone 6s, I have decided I wanted to jump ship and see what else is out there when it comes to smartphones. I have been a big supporter of using phones created by the operating system owner (Apple iOS for iPhone and Google Android for the Nexus and Pixel) but after reading some reviews on the Samsung Galaxy S8, I cannot make my mind up.

I intend to buy the phone outright to save in the long run when compared to contracts/plans so I want to be sure of my purchase.

The Samsung Galaxy S8 comes with some very nice features and from what I've seen, the build quality is great. I haven't played around with one yet but I am quite savvy when it comes to smartphones and technology in general so getting used to the Android operating system will not be a huge deal for me.

Am I making the right decision going from my iPhone 6s straight to a Samsung Galaxy S8? What should I be looking out for?
[Samsung Galaxy S8 Questions and Answers] CASz:
The S8 is a standout looking device (OTOH I too purchased outright LOL). If you decide to jump to Android but not the S8, at the very least buy a premium device that is comfortable in hand - that's really the only way you'll get a comparable experience to your iPhone. Even though you are tech savvy, there will be a learning curve. I've adapted to many operating systems but still fumble when I pick up an iPhone because I never use one. If you rely on iMessage , there isn't something comparable on Android it seems.
[Samsung Galaxy S8 Questions and Answers] Prosperous:
If I was to jump to Android it would definitely be with the S8. Despite the Google Pixel being a top phone I do think that the S8 has the edge.

No doubt about it. My girlfriend used to have an Android (I think it was a HTC) a couple of smartphones ago and I got some early access on that. I do own a Google Nexus 5 that I used for a couple of weeks before coming back to my iPhone 6s so I have had some sort of exposure already.

Android doesn't have an equivalent app to iMessage?
[OnePlus 3T Questions & Answers] helioXverse:
I'm new to the op3t, owned and modded every Nexus phone since Galaxy Nexus. When a new firmware/modem releases, in my case OB7, does the ROM I'm running (RR from zenity) have to be updated before I can flash the newer firmware or is it like a Nexus and I can run any modem version on any ROM?
[OnePlus 3T Questions & Answers] ShapesBlue:
In all the roms I've run on my OP3T I've never updated the modem. I've had Nexus devices as well. You should be good
[LeEco Le Max 2 Questions & Answers] TheLastCanadian:
So, I'm just wondering if anyone can offer some insight.

I've been recently trying to get this all working with the PureNexus Rom (7.1). EDITI've isolated it to flashing Chainfire's SU app. Any ideas?

I need root for Adaway. I want literally nothing else from it but this beautiful app. Please assist!
[LeEco Le Max 2 Questions & Answers] Leo7D:
I'm on pure nexus everything fine here

SuperSU icon doesn't appeared in app drawer but in settings

IF YOU HAVE FLASHED BS KERNEL THEN IT WILL END UP IN BOOTLOOP.
[LeEco Le Max 2 Questions & Answers] TheLastCanadian:
Ah. Perhaps that's it. I will need to check.

I have been flashing the SU zip on top of the PN rom?

Edit: There's no superuser in settings.... And root checker fails.

Edit #2: Magisk is the compatible Root module for this ROM, per the PN thread here. Installed, system boots and root checks out.
[Xiaomi Redmi Note 3 Questions & Answers] ShivamTiwari:
I unlocked my bootloader unofficially and has been using mh device for a long time but since latest builds of roms requires officially unlocked mm bootloader, i can't flash new builds now.My device is working fine and have miui.eu rom installed, i have access to fastboot mode, recovery and everything is fine but i just want to be officially unlocked now. So to flash the stable fastboot rom 8.2.2.0 onto my device, can anyone provide me a guide which explains the process to flash the rom.

Any help will be greatly appreciated.

P.S: My bootloader is locked now.
[Xiaomi Redmi Note 3 Questions & Answers] VaibhavKumarReddy:
Flash fastboot rom but bootloader will get relocked , you can search on YouTube for the procedure as it's same for rooted or non rooted devices .