yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] FEGuy:
Sorry, I've barely been online the last couple of weeks; too much going on.

I haven't had the issue with the timestamps being ordered improperly, but I can look into it this weekend. The way the timestamp is written for folder names means it shouldn't be an issue unless the clock itself is wrong at one point or another, which is something I did run into on an earlier build but couldn't reproduce.

As for wifi not working with Magisk 19.3: Does the same happen if you use a clean version of the patched boot image, without Magisk installed? I suspect it's a conflict between the kernel and the existing wifi module on the vendor partition; while I was able to build the kernel so that it'd accept the stock kernel modules (thanks to ZTE's carelessness), I haven't looked at the differences between the kernel and modules between B10-B12. The kernel should accept the modules' signature regardless, but there are other issues that might prevent it from loading properly if they're built differently, and I haven't exactly had a wealth of configurations to test against.

Pothole 1 - I'm thinking this is my fault for not updating the guide. ADB rarely works in TRWP without toggling MTP disabled/enabled under Mount settings, or entering into then cancelling Sideload mode in Advanced settings. I made a note of this in the FAQs at the bottom but should've updated the guide to point to it.

Pothole 2 - Unfortunately this phone's been my first real foray into messing with Magisk, encryption, and kernel compilation for Android, so the best I've been able to do is write down what has and hasn't worked for me. Now that I've got a second phone to test with I'd like to do a bit more to concretely figure out the most exact or foolproof steps, but the last couple weeks haven't left me with a lot of free time.

Pothole 3 - I ran into a similar issue with a Consumer Cellular (AT&T) SIM, where it asked me to activate the hotspot feature on my Verizon plan. I've found this Tethering Enabler module works to enable the stock hotspot, although I don't know how well it works on older versions of Magisk. Additionally, it doesn't work to enable other hotspot apps like FoxFi, nor does it work around the stock ROM's one-device limit for the hotspot. This seems to be built into the system app, as the hotspot app when using a custom Treble-based ROM doesn't have the device limit.

----

I'm going to try to work on some testing, rebuilding, and refining the guide this weekend if I have the time. ZTE might actually update the phone to Pie next month, which I'm sure is going to cause a bunch more headaches, but I'll try to stay on top of that too.
[Miscellaneous Android Development] dharary:
Does anyone know of a 3rd party visual voicemail app? Visible said the visual voicemail that comes with the R2 will not work.
[Miscellaneous Android Development] FEGuy:
[MENTION=320962]famewolf[/MENTION] Can you describe the error you're having with the backup timestamps in a bit more detail? I've noticed that on the stock ROM the time in TWRP should be fine (+/- the timezone settings), but after testing a Treble Pie ROM, TWRP shows the time/date as 1 January 2018 + (time since ROM initialization). I didn't get around to digging into it more but it'd help to know if it's the same issue you're having.
[Miscellaneous Android Development] famewolf:
Yeah I'm on the phh treble pie rom so it's the same issue. I haven't really changed the rom since I initially moved from stock. In hindsight I should have mentioned that. ;)
[Miscellaneous Android Development] FEGuy:
No worries, I'd have run up against it eventually either way. Sees like the system ROM might be using that same offset and then connecting to the network to get the 'proper' time, which is less than ideal. I'd have to take a closer look at what it's doing, but in the meantime there's a hackish solution if you're at your PC when making a backup - just run this script with your phone plugged in and ADB working, then make a backup. It's not ideal, especially since it won't stick between boots, but it's better than nothing, I guess.
[Miscellaneous Android Development] arbie2:
Thanks for your reply (and the thread).

Re: Pothole #1. My fault for not reading your addendum. TRWP's ADB worked, so, no harm.

Re: Pothole #3. Thanks for the tethering activation link. For me, Netshare+ has advantages

over R2's stock tethering. Netshare+ allows multiple tethering clients, while the R2's stock

tethering allows only one client. Also, Netshare+ works with both my third-party VPNs--I

could never get either of my third-party VPNs to work with the R2's stock tethering.

Reddit had discussions about Visible and VPNs that I've not pursued.

As a side note, I'm not renewing my Visible/Verizon service, which comes due soon.

For me, Visible/Verizon service is erratic, ranging from 50 Kbps (yes, dialup modem speed!)

up to 40 Mbps, depending on cell tower traffic. By comparison, I also have unlimited Sprint

service (through The Calyx Institute) that has consistently provided 35-40 Mbps for years.

Both services cost about the same: Visible/Verizon: $480/year, Calyx/Sprint: $500/year

(a portion of which may be tax deductible). One R2 gets repurposed to PagePlus, while

the other gets freed up for more TRWP / Magisk hacking.
[Miscellaneous Android Development] googlephoneFKLenAsh:
Is anyone looking into how to reduce partition sizes for partitions such as system and cache so that we can get more user storage?

Currently system takes about 9GB storage in storage information, while it's only about 5-6GB on similar moto devices.

Hopefully we can repartition the phone and get about 3GB more user storage.
[Miscellaneous Android Development] Dib Membrane:
Can TWRP root the R2?

Hi again. Hopefully I haven't scared everyone away from this thread permanently with that wall of text. :o If not, I have a followup question.

When you run TWRP, it gives you the choice of mounting the system partition read-only or read-write, and says that if it's mounted read-write, it'll offer to root your device. Has anyone tried rooting the R2 with TWRP? If so, does it work? What are the limitations? To quote from the Magisk GitHub page, I don't care about "system integrity verifications used in banking apps, corporation monitoring apps, game cheat detections", though I'm not sure if "most importantly Google's SafetyNet API" would affect me.

I also don't care about Google Pay and am not a Netflix subscriber. I do want OTA updates to work, though. But in theory, if root interfered with an OTA, I could just restore a pre-root Nandroid backup, take the update, and then re-root with TWRP afterwards, right?

Or is it the case that dm-verity prevents the R2 from even booting if you root with TWRP?
[Miscellaneous Android Development] FEGuy:
Sorry [MENTION=10135723]Dib Membrane[/MENTION], I've been offline for a couple weeks. I'll try to get through the important stuff real quick, but I'm kinda crunched for time.

The good news is that unbricking is possible if you can get into DFU mode; I think you can usually access it from holding Vol Up + Vol Down while powering up the phone; the deepflash cable shouldn't be necessary. If you've got the unbricking tool for the A2017, try following the instructions in this post to get back to a point where you can reflash stock firmware from QFIL. The bad news is that the port only stays responsive for a few seconds, in my own experience, so the best bet would be to have QFIL ready to flash at the press of the start button (the port settings generally correspond to the USB ports on your computer, so try to use the same one you used to flash in the first place rather than guessing later). Once the unbrick tool works (if you've got Windows sounds enabled, you should hear the hardware disconnect and reconnect as the phone switches from DFU to EDL mode), quickly Alt+F4 out of the unbrick tool and start the QFIL flash. Unfortunately this might take a couple tries, which means rebooting and starting the whole DFU process again from scratch each time.

As for what caused the problem in the first place... I don't know, honestly. It could be that another reset or two is needed to properly stop the device from force encrypting, or that setting up a passcode encrypted the device (although if TWRP didn't prompt about it, and the Magisk installer didn't nuke the data partition, I don't really think that's the case). It sounds like the Magisk installer still found and tried to patch something in the recovery partition, which is what caused the phone to stop booting to TWRP, as it didn't like the modifications, but I don't think there's anything there that Magisk should be trying to patch.

If you want to try it again (assuming you can get things booting properly), I would recommend not setting up security measures until AFTER Magisk is installed. It's a point I'd never thought about and probably ought to test personally. I don't know of any method to use TWRP to root the device directly (other than flashing a zip like Magisk). Neither dm-verity or editing /system (mounting system as r/w in TWRP) should really matter, as the bootloader doesn't actually check them and just reports that everything's good (which completely subverts the entire purpose, really), but I don't actually know why some otherwise-benign modifications to partitions still cause it to fail to boot.
[Miscellaneous Android Development] famewolf:
Android 10 available as Generic GSI

Android 10 is available here: https://mirrors.lolinet.com/firmware/gsi/Generic/ with more details here: https://mirrors.lolinet.com/firmware/gsi/README.txt

I've done nothing with this yet.

---------- Post added at 09:38 AM ---------- Previous post was at 09:35 AM ----------

Might be. I haven't fooled with it to much lately. It makes a really good roku remote once you use the right app. The built in roku remote in official roku app kept reverting to it's main page when screen went black instead of staying on the remote. A standalone remote remembered what device it was connected to and all you had to do was press your finger to the fingerprint scanner to have it light up again.

My main file server is in pieces in another room so it's my main interest right now so I'll check sometime and appreciate the thought.
[Miscellaneous Android Development] googlephoneFKLenAsh:
Have you flashed PIE GSI and/or android 10 GSI successfully?

Is it possible for you to put a brief guide/description on how you got GSI working?
[Miscellaneous Android Development] famewolf:
I've been on the Pie GSI pretty much from the beginning without issue. I'm pretty sure either this thread or the one with the factory rom has either a link or a step by step already. I followed something when I put it on originally. In any case it's pretty much the same policy you'd follow for any other rom except you'd download the "A only" version and only flash SYSTEM and not BOOT from twrp. I'm still on magisk 16.3...if you want the newer magisk's the dev had a patched boot image you could also flash which would allow use of the most recent 19.x ones.
[Miscellaneous Android Development] FEGuy:
The sparse image header fail when flashing a stock ROM is because the XML lists userdata.img as a sparse image, but the included image is just a blank file; there's no headers or any other data beyond the filename.

The Android 10 GSI looks interesting; if I can keep a stable enough connection I might give it a shot on the spare phone. Looks like phhusson has some 10 GSIs up on Github, which might be more compatible, but it seems like they're still in the testing stages.
[Miscellaneous Android Development] Dib Membrane:
Aonly & AB; remove userdata.img line from stock ROM rawprogram0.xml before flashing?

Does that Aonly and AB stuff refer to the seamless update capability introduced with Android Nougat? I had previously thought that all devices shipped with Nougat or later had the dual system partitions, but the R2 only has a single system partition, yes?

I think you mean 16.7, eh? I have almost typed 16.3 a bunch of times due to the other version being 19.3.

Huh. I see. So the solution is to either use MiFlash or TWRP instead, or if using QFIL, to edit the rawprogram0.xml file before flashing, and remove the userdata.img line:

<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="userdata.img" label="userdata" num_partition_sectors="6291456" physical_partition_number="0" size_in_KB="3145728.0" sparse="true" start_byte_hex="0x1e0000000" start_sector="15728640"/>

?

---------- Post added at 02:17 AM ---------- Previous post was at 01:35 AM ----------

Oh, I mentioned earlier that I'm not a Netflix subscriber, but a relative does have a free trial right now that's being shared with the rest of the family. I had been happily using Netflix on my R2 prior to rooting, but when I went to reinstall it on my original, now rooted, R2, I found that it shows on the Play Store as "Your device isn't compatible with this version." So apparently Magisk 16.7 doesn't trick current versions of Netflix into thinking the device isn't rooted?

Anyone know if Netflix works if you use the custom boot image and Magisk 19.3?

(Amazon Prime Video, by contrast, works fine.)
[Miscellaneous Android Development] famewolf:
Just make sure to check out the readme....it references a "fixzygote" file that may also need to be flashed....I'm thinking of trying the "oneplus" gsi on my 2nd r2.
[Miscellaneous Android Development] famewolf:
Who's actually using the visible service? I'm getting ready to activate it and wanted to see how it's been for folks. Did those who activated get the case and screen protector one person mentioned? I'd like to know before I order a case and glass screen protector off amazon if this is going to be my daily driver. Thanks!
[Miscellaneous Android Development] Dib Membrane:
Feedback on Visible service and R2 case & screen protector

Most of the time it's great. However, they definitely deprioritize the hell out of it with QoS compared to Verizon subscribers, and possibly even compared to some or all other Verizon MVNOs, per some observations. Occasionally it can become so slow or get so much packet loss that my horrible lowest-speed-available DSL line becomes preferable. If you live in a non-congested area (e.g. due to low population density), your experience may be better. For the same reason, it tends to be slowest during peak daytime hours, and fastest in the middle of the night.

Yes, but you don't get them until after you've paid your second month's bill. The case is great; very grippy. The screen protector I elected not to use, since A) I didn't find it possible to 100% eliminate air bubbles; B) if you have difficulty tuning out visual annoyances, as I do, you may be irritated by the rainbow effects you get on the sides of the screen protector when you tilt the phone; C) the oleophobic coating seems to be noticeably inferior to the screen's coating.

Without the screen protector on there, tapping or dragging things on the very edges of the screen can be more difficult than without it, since there's a bit of a ridge that the screen is recessed below, but I haven't found that to be that much of an annoyance.
[Miscellaneous Android Development] famewolf:
Appreciate the followup. I'll assume the screen protector they send isn't glass then? Those are fairly easy to get the bubbles out and have saved my phones a couple of times by taking an impact that would have broken the screen.
[Miscellaneous Android Development] Dib Membrane:
Further info on R2 screen protector & case

[Update: Please disregard the parts of this post saying the screen protector is plastic — apparently it is glass (see the next post for more on that).]

No, it appears to be plastic. I haven't used a screen protector in years; the last one I used was a very flexible piece of plastic film, and getting all the bubbles out was tricky but doable. This one is a fairly rigid piece of plastic, and it has some tendency to lift at the edges, so even if you get all the bubbles out, they can come back that way.

I'm not super-concerned about screen protection, as I only ever cracked the screen on one device, an iPod Touch that I dropped against the rim of a jacuzzi, and it went in the water after that, so it was toast regardless. If I ever drop my R2 face-down, I'm thinking the ridge of the rubber case will most likely prevent the screen from getting cracked. I'd have to drop it on something hard and projecting, like a sharp stone, to crack it.

It would bum me out if the screen got scratched by sand in a pocket or something, but I guess I'll risk it for the better oleophobic coating, better screen feel, and lack of irritating bubbles or pieces of dust/lint trapped under the protector. Not sure if anyone makes a high-end screen protector that would be a perfect fit on the R2 anyhow.
[Miscellaneous Android Development] Dib Membrane:
Screen protector is apparently tempered glass

Oh. Sorry, I was just looking at the packaging the screen protector and case came in, and it's labeled "ZTE R2 Tempered Glass Protector". So apparently though it feels like plastic to me, it is in fact glass (assuming the label on the packaging isn't inaccurate). This is the first glass screen protector I've handled, so I'm none-too-expert on them.
[Miscellaneous Android Development] Silverbogan:
Thank you so much.
[Miscellaneous Android Development] pwalsh110:
EDL not working?

When I "adb reboot edl" everything goes dark (off?) I'm not sure if the bootloader is really unlocked on mine, I did dev tools and changed that setting but I'm unable to "adb reboot bootloader" to use fastboot.

Any ideas where I went wrong?
[Miscellaneous Android Development] Romphone:
I have installed phhusson AOSP 10.0 v201 filename: system-quack-arm64-aonly-vanilla.img.xz on my visible r2 for those interested.

Edit: system-quack-arm64-aonly-gapps.img.xz (Gapps version) is also working
[Miscellaneous Android Development] Romphone:
Installing Android 10.0 on ZTE Visible R2

I bought two zte visible r2's and already have android 10 on my first. I am installing 10 on my 2nd phone right out of the box.

1. Follow directions for Part 1 then Part 2 in the OP.

2. Download, Extract, & copy to internal storage or sdcard which version you like from github.com/phhusson/treble_experimentations/releases/tag/v201

----Android 10 AOSP: system-quack-arm64-aonly-vanilla.img.xz

----Android 10 with GAPPS: system-quack-arm64-aonly-gapps.img.xz

3. Boot into TWRP, Install, Install Image, and select the IMG you copied.

4. Flash to System Image then confirm.

5. Go back and select Wipe then do a Factory Reset.

6. Reboot to system.

Not currently working:

Camera & Flash

Current Version: AOSP 10.0 v201

Troubleshooting:

Q. Stuck on black screen immediately after bootup?

A. You installed the Patched kernel required for the later version of Magisk. Download the stock B12 firmware (Link in OP) extract and install the boot.img in TWRP.

Thank you OP for the guide & anyone else that played a part.

Edit: Thanks & Troubleshooting
[Miscellaneous Android Development] googlephoneFKLenAsh:
Are you able to flash magisk?

I tried V19 to v20.1 magisk, and also magisk-phh.zip custom magisk and the phone would just power off after the zte screen.

---------- Post added at 03:08 PM ---------- Previous post was at 02:59 PM ----------

@FEGuy,

I noticed that in phone info (*#*#4636#*#*), we can only select network type starting with "L" in the preferred network type option. The option won't stick if we choose other modes not starting with "L".

So I guess ZTE is limiting the network mode to LTE only with a simple regex expression in the kernel.

Since you know how to modify and compile the kernel, I am wondering if you can look for a line of code with regular expression to limit the modes starting with "L".

If we can set the preferred network mode to other modes like GSM after modifying the kernel, we may be able to use call and messages on other carriers.

You can try it if you have time. Thanks.
[Miscellaneous Android Development] Romphone:
I have tried a few different ways, but end up looping like you. I just pulled the boot from the b12 stock file and flashed the image in twrp. Takes out magisk, but the rom is rooted.
[Miscellaneous Android Development] FEGuy:
Looks like Visible's got some new phones available for new customers to swap for - the Moto e6 is pretty similar to the R2, although the upgraded Snapdragon 435 comes at the expense of USB-C and a fingerprint scanner. The ZTE Blade A7 Prime is more of an upgrade but uses a Mediatek processor and explicitly states that it's LTE-only; it'll likely present the same challenges as the R2 did in terms of rooting, recovery, etc., perhaps moreso if there's not a similar enough TWRP tree to base a recovery on. Interestingly the internal hardware seems different from the regular Blade A7 despite using the same body. I'd recommend either one over the R2, really, but neither are great as anything more than a backup or a toy. I'm halfway tempted to pick up that Blade just for the sake of messing with it, but I'm guessing I'd have to open another Visible account, trade in another old phone, and pay for at least a month of service that won't even work, so... maybe not.

I've noticed when upgrading Magisk through the manager that it doesn't exactly work out as expected. I think something's up with the way the image gets repacked or flashed, but I've never had the time to look at it in depth. When I upgraded to v20.1, I reflashed the Magisk-ready boot image, flashed the Magisk v20 zip, rebooted, and uninstalled the extra copy of Magisk Manager that the new installation spawned (this probably will only happen if you're using Magisk Hide to obfuscate the Manager app). I have no idea if that'll work for the Magisk image for the Android 10 GSIs, but regardless I'll try to amend the guide this weekend.

As for the network types... that's a bit of a goose chase, with a few too many assumptions for my liking. I'm not entirely certain it's just a regex thing, and even if it were I doubt it'd be in the kernel so much as one of the software packages. The size of the kernel presents another headache - even with a script to identify every declaration of a regular expression, combing through each of them, where they are, what they do, etc. would be a massive time sink, and to be honest I don't really have the time or energy to do anything else related to this phone at the moment.

It's worth noting that any of the stuff in that menu that starts with L starts with LTE, which is the default setting (ro.preferred.network.mode, or something) in one of the .prop files in the vendor partition; I briefly changed it from the default value (11, I think?) on my device without any luck; I think the changed values stuck to some extent without actually changing anything, but I've since reset my vendor partition to stock (other than editing the fstabs to disable force encryption).
[Miscellaneous Android Development] n2locarz:
Instructions work great. Successful on 3 different R2's. Anyone have success installing a newer version of Magisk? If so, can you please provide instructions. Thanks
[Miscellaneous Android Development] ryan0720:
Need help with a boot loop. Still have twrp loops at zte screen did the force encryption then restarted I've spent the day trying everything twro no longer sees images flashed my backup even tried to flash stock firmware on PC nothing works. I thought no matter I could wipe everything and put my backup on and that would fix it but no go. Any help on what to do in stuck?