yashsingh1/xdaforums huggingface dataset:
[Nexus 5X General] sfhub:
It took me a little while to figure out what was actually going on when I debugged a patch I wrote to fix a touchscreen problem some people were encountering, which worked in Marshmallow but stopped working in Nougat.

The reason the build.prop change doesn't "stick" in Nougat is the following:

When you make the change to build.prop while inside TWRP, it does make the change on disk/emmc. You can see the change and pull it to your PC and the change is there.

However when you boot to Android using a boot.img (for example stock) that has dm-verity (verified boot) enabled, your "changes" to build.prop are treated as "corruption" of the system partition.

The 7.0 kernel (if dm-verity is enabled) then proceeds to "forward error correct" using the reed solomon redundancy they added into the 7.0 builds/images. So the "on the fly" error correction will "correct" your changes to build.prop (ie corruption) and restore the original information.

You can see this "error correction" in action by typing

dmesg | grep verity-fec

For example:

bullhead:/ $ dmesg | grep verity-fec
[ 4.222216] device-mapper: verity-fec: 259:7: FEC 0: corrected 38 errors
[ 4.298401] device-mapper: verity-fec: 259:7: FEC 4096: corrected 4 errors
[ 4.443486] device-mapper: verity-fec: 259:7: FEC 81920: corrected 17 errors

The reason the method in the post you replied to works is because the installation of SuperSU (in the default systemless install mode) will disable dm-verity in your kernel/boot.img, which also disables the reed solomon forward error correction.

By doing so, his build.prop changes persist into the android boot, at which point he can modify the tether_dun_required setting, which I believe is stored in userdata area.

He then proceeds to restore original boot.img by doing full unroot (and optionally system.img) so the system is pristene again, and ready for differential OTA updates and Android Pay works.

Also any Nexus running Nougat that has the forward error correction code and reed solomon redundancy in the images will behave this way if dm-verity is enabled. It isn't something that is particular to the 5x. Older devices might not get the code or the redundancy in the images, but going forward I would guess all newer Nexus devices will behave this way.

Hope that helps clear things up.
[Nexus 5X General] tabormeister:
I embarrassingly didn't know that adb shell/su would work for editing settings db over adb, always just used terminal emulator on device and thought you needed root to do so - tried adb shell through twrp to do it and it doesn't work there so just assumed it would only work on device while booted haha

Right! I was just trying to compile a simplified method that works reliably across L, M, and N that anybody can do, AND that leaves you with working Android Pay, AND that doesn't give you 'device corrupted' messages. Seems like I stumbled into a way around dm-verity accidentally. So....yay?
[Nexus 5X General] Skitals:
Thanks, that is great info and definitely explains what is going on! I guess my lingering question is... once you do a full unroot and restore the original boot.img, isn't dm-verity reenabled? The tethering provisioning check would be in place again defeating the whole purpose. Still seems easier to just add the line to the prop in boot.img, and restore your stock boot.img when you are ready to do an ota. Android pay, tethering ,etc all work.
[Nexus 5X General] sfhub:
Possibly (regarding the build.prop entry and where to put it)

Regarding dm-verity, if the original pristine boot.img is being restored then dm-verity is reenabled as well as forward error correction and the subsequent reversion of the build.prop changes to original. It is possible in all of tabormeister's testing SuperSU might have backed up a boot.img that already had dm-verity disabled and restored that so I can't tell for sure if that full unroot step actually restored the stock boot.img.

I do not have the details of how the two settings you folks are using to enable tethering relate to each other.

From reading tabormeisters sequence, I got the impression that

net.tethering.noprovisioning=true

was required before you could enter

settings put global tether_dun_required 0

successfully, but once you had global tether_dun_required 0 registered in a sqlite db somewhere (ie stored persistently in userdata), the net.tethering.noprovisioning=true build.prop entry was no longer necessary for tethering to function going forward.

However, that is just my interpretation of the sequence tabormeister listed and a rationalization of how what he did could continue working after the "full" unroot he described (which I believe restores a pristine "stock" backed up boot.img)

Since I don't personally use these changes I might have misread or misunderstood what tabormeister was doing.
[Nexus 5X General] Skitals:
That's the thing, they are unrelated. Most carriers only require net.tethering.noprovisioning=true to disable provisioning check. Some carriers also require the tether_dun_required 0 so that data isn't flag as tethering and blocked. One doesn't negate the other.
[Nexus 5X General] sfhub:
From the way I read your response these tethering flags control whether an alternate "tethering NAI/username" is used for tethering data and depending on carrier one or both (or none) of the changes might be required.

So it is possible for tabormeister's carrier he only needed

tether_dun_required 0

because

net.tethering.noprovisioning=true

should have been removed once he did the "full" unroot (which presumably restores original stock boot.img, enabling dm-verity, and forward error correction, thus restoring original build.prop) There is also slight potential that after a lot of testing, the boot.img that got backed up by SuperSU install actually wasn't the original stock one, but one that had dm-verity disabled.

So the net of all this is tabormeister's sequence might possibly only work for his carrier, but we are not completely sure what is going on because we haven't verified the contents of build.prop after the full unroot step in his sequenced procedure.
[Nexus 5X General] TauxiC:
I downloaded your modified boot.img file and flashed it to my Nexus 5X but I still am not able to tether. When I try to enable it, the toggle for it first turns green as if it is going to work, but then goes back to the disabled/off position after a few seconds. However, after flashing your boot.img, it at least no longer pops up the grey "checking subscription status" box anymore. Any idea?
[Nexus 5X General] andTab:
Bluetooth tethering connects, "Internet Connection Sharing" is checked on the Nexus, Windows PC shows as connected, .... NO INTERNET.

Sends traffic fine. Shows ZERO incoming bytes received.

Just updated to 7.0 and followed the instructions to get tethering to work.

Note that I do have to use a VPN to get around carrier restrictions (they do detect tethering otherwise), so I use Torguard. No issues with Wifi tethering.

Happy for suggestions how to get Bluetooth tethering to work.
[Nexus 5X General] Lollolollo84:
when i try to push back the edited build prop file to the phone i have this error:

failed to copy build.prop to /system/build.prop: couldn't create file: Read-only file system
[Nexus 5X General] govindadas:
have a custom recovery installed and

>> adb reboot bootloader

in TWRP recovery there is an option to mount the system and then you can push it through adb

otherwise if you are already rooted, there are some apps that you can toggle read/write access of system.
[Nexus 5X General] sfhub:
Mount system partition read/write in TWRP.

You'll need to install root for the build.prop changes to stick around otherwise they will be error corrected back to original.
[Nexus 5X General] Lollolollo84:
I think that I have some problems with root/supersu...

Before I will try to flash factory images, twrp and super su again... I hope it solve!

---------- Post added at 05:44 PM ---------- Previous post was at 05:24 PM ----------

My N5X have root (checked with root checker) and was decrypted...

I don't know the reason but system now is RO instead of RW... Can I solve the problem flashing again factory image, twrp and super su?
[Nexus 5X General] tabormeister:
Oh gosh, I didn't see this discussion until right now! I only included the bottom bit about restoring the original boot.img in order to flash an OTA when one comes out. Yes, restoring the original boot image will break tethering again, depending on your carrier. This is more an 'all-carrier' approach, Sprint and Verizon I believe require both of those settings. So basically, run the first part of the guide from stock, then run the second part to flash an OTA if you need to, then run the first part again and boom, tethering and Android Pay working again. Leave the boot.img alone until you need to OTA again, when doing the full unroot I didn't let it reflash that or recovery.img.
[Nexus 5X General] sfhub:
In the twrp "mount" page there is a check mark to mount system partition read-only. Uncheck that.
[Nexus 5X General] Lollolollo84:
I found this already unchecked...

???
[Nexus 5X General] sfhub:
Try renaming and pushing build2.prop.

That will tell you if there is a problem overwriting build.prop (in which case you could move it out of the way, or problem with writing to /system in general)

Also I assume you are doing the adb push in TWRP, not in android.
[Nexus 5X General] Lollolollo84:
I think that the problem is:

Now i have root systemless

But I need to root system also...

How I can solve this problem and have a normal / full root (NOT Systemless!!!)

EDIT:

i found this guide: Some opinions????

Step 1: flash SuperSu 2.71 normally (this will patch boot.img)

Step 2: boot the device and full unroot in Supersu app (device should now

be unrooted, however because of step 1, the patched boot.img is still there)

Step 3: boot into twrp >go to the terminal > and type: "echo

SYSTEMLESS=false>>/data/.supersu" (force the new 2.71 to only install in

system mode)

Step 4: now flash supersu 2.71 in twrp (if you read the logs, it should say

something like "installing in system mode")
[Nexus 5X General] sfhub:
You can install SuperSU in system that way, but I don't think that is related to you not being able to place build.prop on /system.
[Nexus 5X General] ald040:
Has anyone run into any issues using this method with Android 7.0? I've been getting the factory images, flashing them, installing the OTA and then doing the process to gain no tethering provisioning and has worked flawlessly for the past 6-7 updates, but now doesn't seem to work with the new Android 7.0 update, any help will be greatly appreciated!

Edit: I apologize, I did the unthinkable and asked the question without spending more time researching. I figured the conversation would have been on the last page of the thread, but it appears I updated a lot later.
[Nexus 5X General] Ken.Adams:
Great Guide helpful at times!!
[Nexus 5X General] andTab:
I wish someone would just start a new guide with 7.0 instructions.
[Nexus 5X General] tabormeister:
http://xdaforums.com/showpost.php?p=68467873&postcount=189
[Nexus 5X General] tabormeister:
So is there a way we could do this without having to do the systemless root step? I'd really rather do it without having to root at all
[Nexus 5X General] DualSportDad:
You quoted the way to do it without rooting.
[Nexus 5X General] sfhub:
He wrote the post that he referred to. It requires rooting.
[Nexus 5X General] tabormeister:
[MENTION=1299673]sfhub[/MENTION] exactly! Lame as it is, Android Pay still works with my method but the latest Pokemon Go stopped working. I need my pocket monster fix, so for now I'm using paid Foxfi + pdanet on my laptop...this is actually an awesome solution because it autoconnects when I plug in my phone, but it'd be rad if we could figure out a way to fix the forward error correcting problem (I think the dude I quoted mentioned changing default.prop) without even having to install systemless.

I was approaching this thinking you could only do settings put with root...now I know that's not the case, maybe another echo into default.prop would do the trick? Also, the reason I echo into build.prop is since MM there's like 0 space left in /system so if you try to pull, edit, and push build.prop it errors out
[Nexus 5X General] DualSportDad:
I'm talking about modifying the boot. IMG

http://xdaforums.com/showthread.php?p=68380897
[Nexus 5X General] sfhub:
I think I may have misread your original reply. Apologies.

...

Just disable dm-verity on the boot.img. You don't need the root portion, just the side-effect of SuperSU disabling dm-verity.

You can modify the SuperSU install script if you don't want to edit it yourself.

Same can be done for the default.prop changes.
[Nexus 5X General] DualSportDad:
I have to ask this cause I don't fully understand.... What is the importance of adding the "tether_dun_required 0" ? My mom was using T-Mobile and they started to throttle her tethering so she switched to cricked a couple of days ago and her tethering would connect but not allow data transfer. I ran the adb commands to add the above mentioned and it worked no problem. She is on a 6.0 or 6.0.1 pure nexus ROM. I went to do the same to my phone in fear that's how T-Mobile was able to see her tethering usage (I'm on T-Mobile) but after running the commands I went to check and I don't even have a settings.db folder, I'm on 7.0 stock with elemental kernel, not rooted. I checked my nexus 6 on a 6.0 ROM and it has the settings.db folder and took the dun mod just fine.
[Nexus 5X General] novacav:
So is there currently no working wifi tether unlock on T-mobile and Metro? I can confirm nothing in this thread works on Metro as of today :( Seems to have been that way for a while.

As far as I can tell, T-Mobile has successfully thwarted ALL wifi tether limit workarounds. Even Fabio Grasso's WiFi Tether Router root app doesn't get past it. Really upsetting, especially to be on a Nexus and not have uncapped tethering. That's one of the main reasons I got a Nexus.

So.... does anyone have any ideas? Maybe I should create a Bounty thread. Would be worth paying to have a clever or new solution with potential to work long-term, IMO. Really don't wanna have to go back to wired tethering :eek:

I suspect the reason they have gone all-out on this is because T-Mobile actually sells unlimited wifi hotspot now, the premium T-Mobile One plan. It's $95 a month though, before device payments. That's a bit steep for me.
[Nexus 5X General] DualSportDad:
I would gladly throw in on a bounty. I have tried everything I know of with T-Mobile and they catch my tethering. I'd pay the $95 if tethering wasn't capped at 3g speeds. I might switch to at&t or cricket to get my tethering back but I'm afraid it's only a matter of time with them as well.
[Nexus 5X General] bagsofcole:
anyone loose tether after a reboot or two? I'm on 7.0 NBD90W w/ Vz and used skitals method
[Nexus 5X General] wpbear:
How to know if T-Mobile knows you are tethering vs not?

Im on latest PN and tether seems to work ok on T-Mobile for me.

My plan is the 4 lines for $120 w/10GB LTE data (temp free upgraded to unlim LTE)
[Nexus 5X General] DualSportDad:
Download the t mobile app and see if it's counting tethered data.
[Nexus 5X General] wpbear:
Yes you're right it's counting. Does PN already have entered settings put global tether_dun_required 0 ? I verified the build.prop is correct but don't know where to verify global......
[Nexus 5X General] DualSportDad:
Last time I used PN ROM it didn't even have the settings. Db folder
[Nexus 5X General] mgbelisle:
It looks to me like this method doesn't work in Android 7 (Nougat) because Android 7 mounts its own /system/build.prop instead of what actually exists at /system/build.prop . I don't see how that could be though so I made this thread with details:

http://xdaforums.com/general/help/android-7-overwrites-build-prop-boot-t3520466
[Nexus 5X General] garrettc134:
I had to root once I upgraded past 7.0
[Nexus 5X General] jbarcus81:
Seems I'm having issues? I follow the guide and with the command adb shell settings put global tether_dun_required 0 ... it seems to do nothing? My Command window just sits there...

Got it.. had to install a command app on the phone and the command worked...
[Nexus 5X General] derakht:
Same Problem.. Does anyone have a solution?

I'm having exactly the same issue. Does anyone know what to do about this? No tethering for me with these instructions. :(
[Nexus 5X General] govindadas:
one line of code failed on Oreo, but still working.

Just got a refurb and updated to latest 8.0 Orea OTA (the second 8.0.0 in factory image list, it's the most recent one as of yesterday). Unlocking, rooting went fine, fixing the tethering went fine except for the last line of "adb shell settings put global tether_dun_required 0". After issuing that command the command prompt returned but never completed, it just hung there. I let it hang for a couple minutes then ctrl-c to stop it. Tried it 2 or 3 times making sure TWRP was awake at the time.

However, tethering works now just fine though. Not sure exactly what that line did. Maybe it is unnecessary for Oreo, or maybe needs to be modified somehow.
[Nexus 5X General] Gabriel1495:
Hi, I have a question.

In settings --> Google --> instant tethering

It seems that I can enable internet sharing without root, but it is not true, it doesn't work, so what is that setting for?

Thank you
[Nexus 5X General] lambdaaa:
does not work

At&T nexus 5x, no root. Everything went fine until the last command. It hung there and did not do anything. Tether still does not work.
[Nexus 5X General] stackv:
Same thing here! Connected ... but no internet on the laptop. Data fully functional on the android 7 phone, tethering activated (wifi/hotspot, bluetooth tethering and USB-tethering), but always same effect on the laptop: I got an IP-address and all, but still NO INTERNET.

no idea why.

then tried this (adb):

ugg:/ $ settings put global tether_dun_required 0

with this answer:

"Error while accessing settings provider

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS"

now i'm totally stuck.

(got a huge 100 Go data plan on the phone, tethering is allowed, but no support is given.)

anyone?
[Nexus 5X General] Ascertion:
Okay, it removes the check for the tethering, but does not appear in list of devices to connect to. We'll find a way for Sprint users.
[Nexus 5X General] joeybobo:
I am on Sprint and while I can connect to my phone, I get no internet connection. Any thoughts? I verified the steps provided in the beginning of this post.
[Nexus 5X General] joeybobo:
I've found that

adb shell settings put global tether_dun_required 0

does not work while in TWRP, you have to execute this command after a normal system boot.

Once I did that, tethering on Sprint worked just fine!
[Nexus 5X General] ClubSoda:
"First grab TWRP for 5X from here. Save it in the same folder as your adb/fastboot install."

Just want to make sure that this twrp file is to be saved on the computer, and not the phone?

I've never attempted this with a phone before, and I don't want to guess on any of these steps, thanks!
[Nexus 5X General] Jexx11:
Yes save it to your computer.
[Nexus 5X General] ClubSoda:
So "fastboot oem unlock" needs to be entered into the command prompt after the "adb reboot bootloader" step, correct? Or is there a different sequence to follow?

Also, I found a video on youtube that seems to be a good companion to this thread... thoughts?

The title is "Root Nexus 5X on Marshmallow! Safe and manual way with explanation!" Since I can't post a link to outside sites yet!
[Nexus 5X General] boomerxyz:
I am on t-mobile. I did what is on the op and my tethering didn't unlock tethering. I added ",dun" to the end of the APN Type in APN settings and it now appears to work.
[Nexus 5X General] jackdubl:
OP steps worked for me on Verizon, and didn't need the last step. Thanks!
[Nexus 5X General] paul_one:
Heya guys,

I hooked the phone up with USB debugging on and ran this ADB command:

adb shell settings put global tether_dun_required 0

I didn't unlock the bootloader, didn't boot into twrp, etc.

I then rebooted and things work for me just fine - but, the OS update has vanished.. Just wondering if anyone can explain?
[Nexus 5X General] stackz07:
What are the best reddit subs for 5x and/or android?
[Nexus 5X General] Dignified Pauper:
Has anyone confirmed if this maintains your ability to use Android Pay? That's the only thing stopping me from unlocking my tether options.
[Nexus 5X General] Cheesejam:
If I already have TWRP, can I just boot into it and do the following steps?

"When TWRP finishes booting, click Mount and check the box for /system

Now we need to pull the build.prop file.

Code:

adb pull /system/build.prop

Using a text editor add this line to the end of the build.prop file and save it.

Code:

net.tethering.noprovisioning=true

Now we push it back to the phone.

Code:

adb push build.prop /system/

Make sure the permissions are correct.

Code:

adb shell chmod 644 /system/build.prop

And lastly

Code:

adb shell settings put global tether_dun_required 0

Now we just reboot

Code:

adb reboot

and your tethering should be working!"

Edit: The answer is yes! But I had to do the last command just after a normal boot.
[Nexus 5X General] jackdubl:
Sure, or just boot the phone, open a file explorer app, and add the build.prop line. Seems a lot easier to me.
[Nexus 5X General] rwilco12:
For those Sprint users having issues getting tethering to work I was able to get it to work by adding net.tethering.noprovisioning=true to the build.prop and restarting. I still wasn't able to get the Hotspot Quick Tile to work right away. I activated the Hotspot from within the menus and then the quick tile started working without any problem. I hope this helps someone.
[Nexus 5X General] Skitals:
Thanks for this guide. Does anyone know the steps to take an OTA? Can I just revert my build.prop, or am I hosed from getting updates now?
[Nexus 5X General] jduawa:
can the bootloader be relocked after making the change to build.prop?
[Nexus 5X General] qaelith.2112:
I'm interested in this as well -- whether a modded build.prop is enough to cause the OTA to fail.

Meanwhile, you're not entirely SOL, though if the OTA refuses to install due to modification, it may be a bit more work than usual. Not complicated, just a bit more time and work:

1) Install the same factory image you're currently running *with NO WIPE* enabled using Nexus Root Toolkit -- very careful about that "no wipe" thing. This will overwrite any modifications that would have been objectionable to the OTA updater.

2) Now you can either allow the OTA to install itself, or if it doesn't present itself, download it manually and sideload it also using NRT.

That's about it. You will still get OTA notification whether it's going to work or not, and the worst that happens if it won't install is that it'll give some error while trying to install and then kick you back through a normal boot cycle. The notification will then either remain or will reappear again later. In case of failure, you can just do the two steps above, re-mod your build.prop, and call it a day. The unlocked bootloader itself definitely won't prevent OTA from working. It's just an open question whether build.prop mod will. My gut feeling is that you're going to be flashing the factory image once.

You could also dirty-flash the newer factory image but I don't suggest that. Better to let the OTA updater run because it includes a script which cleanly transitions you from one build to another.