yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] AllowPing:
Any ideas on preventing Android from doing system updates once rooted? I may be behind the curve on all the progress that has been made for this phone, though I suspect that updates are why magisk v16.7 disappeared after having gained root successfully for a few good hours of use.

Since then installing updated magisk broke the OS and then installing the stock B12 firmware through QFIL and from TWRP were unsuccessful. I did get resurrection remix pie to run but without Visible service.

While I'm asking questions, might I have better luck installing the stock ROM from TWRP as an image, rather than as a zip? If so, I'd be grateful for a download link if anyone is feeling generous. I was unsuccessful at compiling the B12 stock files into an image and I'm sure that is because I don't know what I'm doing. My interest is to have root on whatever OS for a Visible hotspot where I can control the DNS settings for connected devices. I did order another $19 R2 and will try to use a backup from that to get the paperweight on my desk running again.

Sorry if there's too much word salad going on here and thanks for all of the community support!
[Miscellaneous Android Development] famewolf:
No one can provide you an image as unless they knew what partitions to exclude it would also include their imei information among others. If you have twrp installed you should be able to get one of the A-only treble images to flash..this would prevent updates and let you use pie or even android 10. Using a treble image WILL get past the hard coded limit of only letting one device tether. I strongly suggest you start from scratch and use the stock software posted in the other thread to restore to factory if nothing else.
[Miscellaneous Android Development] rkcbernard:
I've been playing around a bit and I can get everything working except for service on any of the treble roms. After installing the GSI and restoring the apn settings, I can get data but still no calls/text. I'm assuming volte isn't working. How are you guys doing this and keeping your visible service??
[Miscellaneous Android Development] LazGunn:
Hey everyone. I followed this method that have here and it worked wonderful , phone is rooted, well magisk and everything has been running smoothly. I did try some of the 9.0 ROMs but my service wouldnt work with them. Anyway, today I got an update, it's downloading for 9.0. I haven't let it install yet I'm going to save the downloaded file before. 3 questions, is it going to update being rooted and with TWRP on it? Second is TWRP and root going to be gone after the 9.0 update? I'm assuming it will be. Is there a way to preserve TWRP and Root with the update? Thanks in Advance
[Miscellaneous Android Development] Dib Membrane:
Thanks much for all that info, rkcbernard. Has anyone heard of any work being done to get TWRP working simultaneously with the R2's stock Android Pie OTA update?

On the other hand, root, at least, is still working after the stock Pie update, yes? How 'bout rooting a previously unrooted device after updating it to the stock Android 9 image?

LazGunn, did you learn anything more (e.g. on other sites) in answer to your questions? Did you go ahead with your Android 9 update? If so, what were the results w.r.t. TWRP and root?

---------- Post added at 01:50 AM ---------- Previous post was at 01:25 AM ----------

Oh, and rkcbernard, on your R2 that you tried out the stock Pie OTA, were you using Magisk 16.7, or a custom boot image plus Magisk 20.x?

And same question for you, LazGunn.

I have two R2s, one running Android 8.1, stock recovery, unrooted, and no SIM; and the other running 8.1, TWRP, and Magisk 16.7 (stock boot image). Trying to figure out the least painful way forward with the Android 9 OTA.
[Miscellaneous Android Development] rkcbernard:
When I installed the pie ota, I couldn't get to the installation of magisk because after flashing the twrp img with qfil, twrp would no longer boot with the stock pie boot image. I'm sure flashing the patched boot image would allow twrp to boot, but I was afraid of not having access to edl if both failed.
[Miscellaneous Android Development] Dib Membrane:
[MENTION=10385395]rkcbernard[/MENTION]: I see. I wonder if the Pie OTA would install smoothly if an R2 were rooted but used the stock recovery. I was going to go ahead and try just updating my non-rooted R2, but I'd forgotten that I had eventually installed TWRP on that device. And when I tried to get it to install the Pie update, it just rebooted into TWRP and sat there waiting for me to tell it what to do; rebooting afterwards confirmed the OS was still on 8.1. I tried poking around a bit (haven't tried searching exhaustively) looking for a downloaded ZIP file to manually have TWRP install, but I didn't see what I was looking for.

Anyhow, since the OTA fails to install when TWRP is in place, one thing I guess I could try would be to revert to the stock recovery on my unrooted R2, then do the OTA, then confirm whether root is still working.

As for the custom boot image being likely to work fine after installing the Pie OTA, I'm not so sure about that. [MENTION=3540215]FEGuy[/MENTION] had to cobble together the kernel of that custom boot image from the source that ZTE apparently provided incompletely despite the GNU GPL rules, with missing bits filled in from I guess the official Linux source tree or somewhere. In the OTA, I'd be surprised if the stock kernel in the boot image isn't being updated to a new version along with the jump from Android 8.1 to 9.
[Miscellaneous Android Development] snacks777:
Logcat Snagged OTA Visible R2 9.0 Pie

I just got my Visible R2 in the mail and am excited to get things rooted I did a logcat and captured the latest OTA for 9 Pie in an attempt to help someone else who might be able to do more with it than me :)

Uploaded to Mega:

https: // mega .nz / #!3pgXmY7Q!tIchKoWVjqBScWBbf9m5GT-K0S9qm6-eeVQXbx3PouY
[Miscellaneous Android Development] Dib Membrane:
Thanks, snacks777! I'm downloading your OTA capture now. Also, I believe I'm able to post external links, so I've removed the spaces in your quoted URL above.

I didn't know logcat would be helpful for something like this. Do you just mean that you looked through logcat messages to find out what the name and location of the ZIP file were? That's a good idea. Not sure if all logcat utilities are created the same, but I just ran CatLog on my unrooted R2, and then started a new download of the Pie OTA, but no messages related to this came up in CatLog. It's feasible I'll get a message once the redownload is finished, though (on pretty slow Internet right now).

Snacks, I'd like to replicate your results with the OTA capture; could you give me a bit more guidance as to how to go about it? That way we can also see how, if at all, the capture I get differs from the one you got, and then people will know there hasn't been any tampering (assuming we're not colluding, nor sock-puppets of each other, of course ;)), and where any unique IDs appear, if any.

Oh, and just to confirm, your R2 came with Android 8.1 installed, yes?
[Miscellaneous Android Development] snacks777:
Thanks for fixing the spaces :) Happy to share yes I enabled USB debugging connected the device and ran in one terminal

adb logcat > file.log

and in a second terminal

tail -f file.log | grep ota

Connected to the internet on the device and clicked the check updates option to grab the ota url from log file. should show a link out like this to the file.

https:// imgur .com/ YpvE8vH

Not sure if its a helpful file. Yes I was on 8.1 when it came out of the box now I took it to go to 9.0 with this ota.
[Miscellaneous Android Development] snacks777:
I haven't yet I was working on that but unfortunately had issues on my Mac with the packages to run the recovery tools. But yes my current version is Android 9 now and I'm planning on seeing what I can do with it. I would be careful flashing that update with recovery as I understand it may mess up the dm-verity since it will most likely touch the boot and or recovery partition. I think only way is using the recovery tool to flash boot and recovery images. So my main goal rn is get windows or Ubuntu running on my other pc so I can hopefully get the tool working. But I need to play around a bit to see how the tools work :) I'm planning on doing that hopefully a evening this week.
[Miscellaneous Android Development] ichygoo:
Sorry I hope this is the right place to do this... I have the visible r2 and recently got the OTA update to Android 9 pie. when I went to go back through this process it failed and I no longer have a recovery system. Any ideas how to fix?
[Miscellaneous Android Development] FEGuy:
I haven't touched my R2 in a couple of months now, so I have no idea what the Pie situation is; honestly I didn't think it'd actually get released. Just finished downloading the OTA, I'll dig up the phone and start poking around. If there's no stock images uploaded I'll at least upload the stock boot and recovery images for Pie so people can recover from broken builds. If TWRP, etc. is actually broken on Pie it might take longer to track down the issue.
[Miscellaneous Android Development] FEGuy:
Still haven't had a lot of time to muck around, but here's what I've found:

-Seems like some actual security checking is in place; I can't get the stock recovery to boot if I've taken it apart and put it back together, much less boot TWRP.

-The update patched a bunch of partitions, including both the bootloader and secondary bootloader. Might be able to flash back to earlier versions from the B10/B12 updates to bypass verity checks, but you could just as easily brick your phone doing that. Alternatively, if the partition checking is just dm-verity in the kernel, flashing a different boot partition might be enough to get going.

-The Pie update did bring a new kernel, upgrading from 3.18.71 to 3.18.120. It also updated the boot partition to use the Pie-standard system-as-root feature; in other words, there's no ramdisk in the boot partition, and Magisk can't inject itself into the boot process in a standard way. Instead it has to be installed into the recovery partition and hijack the recovery boot process every time you want to boot into a rooted system. This is a moot point right now for two reasons - can't boot modified partitions at the moment, and there's no source code available for the updated kernel. No idea if booting the older kernel with the Pie system/vendor partitions would work or lead to stability issues, either.

At the moment, it seems like if there are no rollback protections it'd be easier just to do a full downgrade to Oreo, then install a Pie image (either a GSI or attempting to flash and boot just the system/vendor partitions from the official Pie update) and run with that, rather than doing a full upgrade and dealing with the extra protections in place.

For anyone who tried booting TWRP after the Pie update, here's the stock recovery.img. Just unpack it and flash it with QFIL/qdl - if you're not sure how to do that, just follow Step 1 in the guide in the first post, using this package instead of the TWRP zip.
[Miscellaneous Android Development] tarvoke:
many thanks for the recovery zip link!

yeah, lol, I had tried the twrp image on my 1st R2 (already updated to pie/9) and was not too surprised the recovery was entirely broken, didn't exactly care too much give this is a nineteen dollar phone hahaha.

bought a 2nd R2, installed working twrp, then let it download the OTA update, just didn't allow install but copied the file. was planning to transfer to laptop and gank the recovery image out of it, but you already did thank you again ;)

oh, for others interested -

/cache # ls -l
drwx------ 2 system system 4096 Jan 1 1970 backup
drwx------ 2 system system 4096 Jan 1 1970 backup_stage
drwxrwxrwx 2 root root 4096 Jan 1 1970 keybox
drwxrwx--- 2 root root 4096 Jan 15 17:35 lost+found
-rw-r--r-- 1 root root 1515 Jan 1 1970 magisk.log
-rw-r--r-- 1 root root 2157 Jan 15 18:30 magisk.log.bak
drwxrwx--- 2 system cache 4096 Jan 15 19:13 recovery
drwxrwx--- 2 system system 4096 Jan 15 17:43 time
-rw------- 1 u0_a23 u0_a23 1393246069 Jan 15 19:04 update.zip
/cache # md5sum update.zip
3a07db094cb0e905bca405559079d165 update.zip
/cache # sha1sum update.zip
4ae51f05a63ed93282671c3667f18c15668282a3 update.zip
/cache #

EDIT: apologies, [MENTION=10135723]Dib Membrane[/MENTION] already covered the checksums lol! (huh, the MENTION tag doesn't work anymore?)

but yeah my next step will likely be messing with GSI/treble images I guess? /EDIT
[Miscellaneous Android Development] FEGuy:
I should probably note I don't have any of my tools handy, I just ripped the recovery partition from my device rather than applying the patch (from the update.zip) directly to the older recovery image. If it turns out the one I uploaded ends up giving bootloader warnings or something after flashing it I might have to try something else.
[Miscellaneous Android Development] tarvoke:
it worked fine for me, no warnings or problems, thanks again!

maybe in the morning my lazy-ass will copy the update.zip over to a computer and compare the 2 files, but I'm not terribly concerned. (also, last night I finally entered the Visible APNs into my F1 - which worked a treat and is now my primary phone - the two R2 phones are now just dev/backup/toys...)
[Miscellaneous Android Development] FEGuy:
So I don't really have much else to say on the subject of Pie, other than that downgrading to B12 works. I don't know enough about the boot chain on Pie to know what I'd need to do to get modified partitions to boot (and even if I could, the bootloader works now and is locked with no fastboot interface to unlock it), so TWRP and root on stock Pie isn't something I can help with at the moment; I'd recommend downgrading to Oreo if you want root/TWRP and (optionally) upgrading to some other Pie GSI. Maybe things will change if/when I get the source for the newer kernel, but I don't have a whole lot of free time to go through it.
[Miscellaneous Android Development] ichygoo:
Thank you that worked perfectly, but I am not able to downgrade to 8.1 message in QFIL is FAILED.
[Miscellaneous Android Development] googlephoneFKLenAsh:
Can you give us an instruction to flash back stock?

Currently I have GSI android 9.0 rom on the phone. I tried to flash back to stock using qfil and it failed. Now I don't know what system I have right now or whether I have TWRP. It is on black screen and I still haven't rebooted the phone after the QFIL failed flash.

also [MENTION=3540215]FEGuy[/MENTION], How did you flash back to stock rom?

More details:

in the port_trace, it seems like the flash failed at userdata step:

22:07:37: INFO: Reading through sparse file 'userdata.img' and pulling out relevant header information...

_____

| ___|

| |__ _ __ _ __ ___ _ __

| __| '__| '__/ _ \| '__|

| |__| | | | | (_) | |

\____/_| |_| \___/|_|

22:07:37: {ERROR: sparse_open:1939 Didn't properly read the sparse_header!
[Miscellaneous Android Development] FEGuy:
Sorry, once again I've been short on time to actually check XDA. I forgot that there are some issues with the default XML.

What you need to do for a successful flash is open the rawprogram0.xml in a text editor and scroll down until you find the userdata section. Either remove it entirely, comment it out, or set sparse="false". It's trying to flash an empty image as a sparse image file, and failing because there's no data to indicate it's a sparse file. I would also recommend editing the recovery section to look for the TWRP image and flash it instead of the stock recovery.img - the reason why is below. Make sure the TWRP image is in the same folder as the rest of the firmware files.

I've had issues in the past with getting the QFIL tool to restore the stock system and vendor images if they're in sparse mode; the tool will flash everything else and then freeze forever when it gets to one of those partitions. No idea if that's because of something I did when tinkering with things or not. If it happens it's safe to unplug the phone and kill QFIL at this point (only if it goes 5+ minutes without updating), but you won't be able to boot up the phone into anything but recovery or DFU mode, since the newer Pie system won't boot with everything else downgraded. If you installed TWRP already, you can boot into that, copy the stock system/vendor images onto the device, and then use TWRP to flash them to their respective partitions. If not, you'll need to find your way back into EDL mode without the benefit of ADB, which is possible, but a pain in the ass. From there, you can either flash TWRP or use something like simg2img to convert the system/vendor images to non-sparse images, and update the XML to look for those (make sure you set sparse="false" too).
[Miscellaneous Android Development] Romphone:
Just wanted to let everyone know that I have downloaded the latest build v215 with gapps (aonly) and camera + flash is now working. Simply installed the system img in twrp and factory reset, rebooted back into twrp for a 2nd reset, and everything worked.

Builds are here: github.com/phhusson/treble_experimentations/releases/
[Miscellaneous Android Development] jacdavben:
Hi thanks you for your work, the patched boot image link from the guide in the first post appears to be down, any mirrors?
[Miscellaneous Android Development] famewolf:
Just curious if anyone has an Android 10 GSI image working on the R2? Also wondered if an updated twrp ever came out that worked above oreo. Attempts to restore system give me a 255 error. On the other hand having a copy of boot comes in handy if you screw yours up trying to flash to new a version of magisk. Failing an android 10 are there Pie GSI images other than the vanilla that boot? I tried several unsuccessfully.
[Miscellaneous Android Development] jacdavben:
The latest phh treble gsi works fine, you'll need to downgrade to the stock 8.1 b12 firmware before you can successfully flash and boot twrp though, which can be a nightmare. I was finally able to get it to flash with miflash linked in this thread along with editing the rawprogram.xml to exclude userdata. Once you have everything ready to flash you can just rename the gsi you use to "system.img" and twrp to "recovery.img" and drop them in the folder you are flashing from, then you don't have to do anything else.

Edit: by latest I mean android 10 v222 not the 11 pre-release.

Edit 2: also if you have the patched boot image that used to be linked on this thread, I would be eternally grateful if you would provide me a download link. Without it, any kind of root related operations completely lock up the phone, requiring a soft reset.
[Miscellaneous Android Development] famewolf:
Thanks for the reply. My mistake was trying to flash the system.im in twrp then. Cause I tried that one. TWRP starts just fine for me so apparently I'm already/still on B12. I'll look at miflash but I'm a linux user which pretty much limits me to qdl.
[Miscellaneous Android Development] jacdavben:
if you can boot twrp you should be able to do everything else on-device, and that's what I would recommend because it's way easier. I've never had your specific issue in twrp so far, but it sometimes fails to do some operations (like resizing system) and i have to try again a few times, but it always works eventually. Maybe try wiping system before you flash a new image if you haven't already.

edit: ensure that you are doing the basics like flashing system.img to system and not anywhere else, but twrp can flash system images fine

edit 2: after reading your first post again carefully, are you sure that you are flashing it correctly? First, go to the wipe menu, advanced wipe, wipe system. back out to the main menu, tap install, choose your storage device if it isn't there already, and tap "install image". Then you have to tap on the system partition, and swipe to flash. then go back to the wipe menu and factory reset, then reboot. obviously have a full backup beforehand.
[Miscellaneous Android Development] famewolf:
Are you using twrp 3.3.1-0 on your r2? It's possible I'm on B10 so I'm grabbing the B12 firmware and will flash the boot.img and see if it makes a difference because even after multiple downloads I can't get any of the Android 10 GSI's to load..even with data, cache and dalvik cleared. I don't mind so much since I'm basicallly just using it as a treble test device right now and other than that maybe a roku tv remote. ;) I'm getting my $19 worth. Got a 2nd one still in the box.

Is 16.7 the latest magisk you got working? When I try to install magisk (pretty much any version) It'll bootloop so I'm thinking it has to be a B10 issue. I think all the quirks is why I set it aside last time. (qdl is finicky).

Yeah I have around 15 different devices and am well aware of twrp's install image feature..in fact that's ALL I've been able to use...try to get to fastboot and it never appears in fastboot devices (adb reboot bootloader).

---------- Post added at 05:17 PM ---------- Previous post was at 04:44 PM ----------

Flashing the B12 boot.img (from TWRP) got it booting the Android 10 images just fine so apparently it was still using the B10 boot image.

---------- Post added at 05:32 PM ---------- Previous post was at 05:17 PM ----------

As a heads up the Phh Android 10 with gapps image does not appear to have working wifi. The version without gapps worked fine.

* I better make sure I'm actually on the most recent. Redownloading and willl reflash.
[Miscellaneous Android Development] famewolf:
Well I've confirmed v222 of the Android 10 does not have working wifi for me....this is possibly because I never actually flashed the B12 Rom in full so my modem is out of sync with the boot. Short of replacing the system and recovery then flashing the whole thing I don't see a way around that but I recall an earlier version working so I'm going to backtrack and see if I remember right. I imagine v222 works fine if you already HAVE wifi passwords setup.
[Miscellaneous Android Development] jacdavben:
That's interesting, I've never had that issue. I started out on b12 with TWRP 3.3.1-0 and from there was able to flash phh treble without issue, wifi works fine, and I did wipe data after flashing. I have ran both with gapps and without with no issues. Only minor problem is that auto brightness doesn't have a profile to adjust itself.

Just to be sure, you are running system-quack-arm64-aonly-gapps? You might be having hardware issues if you are trying to run an arm or ab rom on this device.

Edit: if you just flashed the b12 boot image then you are missing the vendor image and some other stuff possibly, you should do a full flash of b12 firmware with everything except userdata (edit the rawprogram.xml) and start from there.
[Miscellaneous Android Development] famewolf:
Yep. arm64 and aonly. I'm pretty sure if I put the older boot image back the problem will go away but then I won't be able to run 10 GSI's...only the 9's. When you say you "started out on b12" are you saying you flashed it to b12 right away or saying your phone's CAME with b12? B12 was released after I had my phones. I plan to extract the B12 rom on my linux pc...swap out the system.img and the recovery then use qdl to flash the rom so everything will be in sync. There's definitely a modem update in it which I'm pretty sure also covers wifi. Yeah vendor would be out of sync. I shouldn't have to mess with userdata since at this point it's already wiped out from moving up from pie to quark. Annoying device. I haven't even bothered rooting my oneplus 7 pro although I did convert the t-mobile version to an "international" so it can get faster updates and supports dual sim (with a dual sim tray from ebay since t-mobile only includes a single sim tray).