yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] ramjet73:
The beta 2.0 script is setup to create that database entry automatically using the command line utility sqlite3 but that portion needs to be debugged.

It does appear that the "tether_dun_required=0" entry is no longer required in 5.0 for T-Mobile accounts that have no tethering allowance, like the $30/month with 5GB of 4G data.

So the zip file still has value since when it is working correctly it will avoid having to purchase Sqlite Editor, flash the current hybrid radio, and install an init.d script to modify iptables for another network's tethering requirement. I believe that was AT&T where Band 4 (1700 MHz) is available, but it could be one of the Canadian networks, and those changes don't seem to affect T-Mobile at all.

ramjet73
[Nexus 4 General] *child:
Yes, the build.prop edits are unnecessary as I outlined in this post months ago. Since I found that out, I decided that the next release would just edit settings.db to enabled LTE. Since I was already modifying the settings.db for the TMo tethering fix, also enabling LTE should be easy, or so I expected. Unfortunately, I do not have an Nexus 4 for testing.

However, I still do not know if iptables modifications are still required for tethering over LTE on Rogers, Bell or Telus Canadian networks with Android 5.0 as it was in <5.0. Until someone lets me know, I will continue to develop this fix.

Anyway, I found another sqlite3 to try. I think why sqlite3 worked before is because BusyBox may have been installed and was providing the missing libs. However, if you are recently rooted without BusyBox installed, these libs are missing, causing the sqlite3 commands to fail with missing libs errors. So I found another sqlite3 to try; This one is much bigger so hope it includes the missing libs. Please let me know how it goes.

PRE-RELEASE Update

Before flashing, please remember to make a Nandroid backup.

INSTALLER 2014/11/18 v2.0-pre2 - Downloadhttps://github.com/marcandrews/mako-lte-and-lte-hotspot-fix/releases/tag/2.0

Update sqlite3

UNINSTALLER 2014/11/18 v2.0u-pre2 - Downloadhttps://github.com/marcandrews/mako-lte-and-lte-hotspot-fix/releases/tag/2.0u

Update sqlite3
[Nexus 4 General] ramjet73:
The script runs in recovery so how would a busybox installation, or the lack thereof, in the system partition affect it?

So depending on the feedback from the Canadian users the script may be down to flashing the current hybrid radio and adding one entry to the settings.db database? IMO it is still worth if because that saves Nexus 4 users from having to locate and flash the radio, or install an app from the Play Store to do that, and purchase Sqlite Editor or use sqlite3 to manually edit settings.db.

ramjet73
[Nexus 4 General] *child:
I'm not 100% sure, but custom recoveries do utilize busybox for certain actions. If you ever used the terminal within TWRP, you'll see that a lot of busybox commands are available, even though busybox is not properly installed on the ROM. In *unix, everything is symlinked together, so custom recoveries may have access to additional libs provided by a proper busybox installation.

Thanks for seeing the worth in this project. Even if the iptables modifications are no longer required, I'd just remove them and just make this an LTE enabler-only script.
[Nexus 4 General] ramjet73:
OK. Most of the updater-scripts that I've seen include their own busybox if they need it so they have a known quantity for the commands/applets it supports.

I'm backing up my current ROM now, and will restore the stock LRX21T ROM after that competes, and then I will test rev2 of your script to see if the sqlite3 problem is fixed or not.

BTW, I noticed you left the command to create the "tether_dun_required=0" entry in the settings.db. Based on my testing, that doesn't appear to be needed with Android 5.0 and may cause confusion if left in your script.

ramjet73
[Nexus 4 General] ramjet73:
Getting closer. This time sqlite3 ran but it's looking for a home directory.

Installing '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre2.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment initialized.

------------------------
Nexus 4 LTE fix
by *child
------------------------

Nexus 4 LTE and LTE hotspot/tethering fix v2.0

about to run program [/sbin/busybox] with 3 args
Nexus 4 Android 5.0 ROM detected.

Flashing 33/104 hybrid radio ...
about to run program [/sbin/busybox] with 4 args
91075+0 records in
91075+0 records out
46630400 bytes (44.5MB) copied, 7.223958 seconds, 6.2MB/s
Adding addon.d and init.d scripts ...
minzip: Extracted file "/system/addon.d/80-mako-lte.sh"
minzip: Extracted file "/system/etc/init.d/81makoltetether"
about to run program [/sbin/busybox] with 3 args
mount: mounting /dev/block/mmcblk0p23 on /data failed: Device or resource busy
run_program: child exited with status 255
Setting LTE as the preferred network mode ...
about to run program [/tmp/sqlite3] with 3 args
/tmp/sqlite3: Error: cannot locate your home directory
run_program: child exited with status 1
about to run program [/tmp/sqlite3] with 3 args
Installing tether_dun_required fix for T-Mobile ...
/tmp/sqlite3: Error: cannot locate your home directory
run_program: child exited with status 1

Nexus 4 LTE fix SUCCESSFULLY applied!
script result was [3]

Edit: Just a guess, but you may need to make a working copy of settings.db in /tmp and copy it back to /data after the updates. Or maybe do the updates in a script instead of edify?

ramjet73
[Nexus 4 General] *child:
I still think there is an issue mounting the data partition. If it cannot mount the data partition, it will not be able to modify settings.db either through scripting or edify. Is your device encrypted? Can you try mounting your data partition manually through the CWM/TWRP recovery and then running the update ZIP?
[Nexus 4 General] neod192:
Well, I read all the new posts here and in the other threads. I flashed the Flashes .33/1.04 hybrid radio, installed SQLite Editor, enabled LTE and updated the settings.db.

Now I have LTE again and it sticks after a reboot! I'll have to test tethering later tonight (I'm on the T-Mobile 5GB / 100 min plan for $30).

Thanks for all the help guys! It's been a while since I messed with my N4 and forgot some things :)
[Nexus 4 General] *child:
PRE-RELEASE Update

OK, so I updated my flashable zip relative to the latest CM nightly (included file_contexts for SELinux and update-binary). I also updated the mounting commands. Before flashing, please remember to make a Nandroid backup. Let me know how it goes. Thanks!

INSTALLER 2014/11/18 v2.0-pre3 - Downloadhttps://github.com/marcandrews/mako-lte-and-lte-hotspot-fix/releases/tag/2.0

Merge updates from latest CM nightly flashable zip
[Nexus 4 General] Handala48:
Can this work with Android 5 stock without any modification?
[Nexus 4 General] ramjet73:
I am using TWRP 2.8.1.0 and nothing is encrypted.

The data partition is already mounted when the recovery is booted, so I tried un-mounting it and re-mounting before flashing the zip with the same results as my last post, then I reboot recovery and un-mounted data before flashing and still got the "cannot locate your home directory" error for each attempted database update.

Maybe someone else who's monitoring this thread can try and pull the recovery.log file afterwards?

---------- Post added at 08:30 AM ---------- Previous post was at 08:22 AM ----------

I just tried again with rev3 and got the same results:

Installing '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre3.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip contains SELinux file_contexts file in its root. Extracting to /file_contexts
I:Legacy property environment initialized.

------------------------
Nexus 4 LTE fix
by *child
------------------------

Nexus 4 LTE and LTE hotspot/tethering fix v2.0

Nexus 4 Android 5.0 ROM detected.

Flashing 33/104 hybrid radio ...
about to run program [/sbin/busybox] with 4 args
91075+0 records in
91075+0 records out
46630400 bytes (44.5MB) copied, 7.091957 seconds, 6.3MB/s
Adding addon.d and init.d scripts ...
minzip: Extracted file "/system/addon.d/80-mako-lte.sh"
minzip: Extracted file "/system/etc/init.d/81makoltetether"
mount: failed to mount /dev/block/platform/msm_sdcc.1/by-name/userdata at /data: Device or resource busy
about to run program [/tmp/sqlite3] with 3 args
Setting LTE as the preferred network mode ...
/tmp/sqlite3: Error: cannot locate your home directory
run_program: child exited with status 1
about to run program [/tmp/sqlite3] with 3 args
Installing tether_dun_required fix for T-Mobile ...
/tmp/sqlite3: Error: cannot locate your home directory
run_program: child exited with status 1

Nexus 4 LTE fix SUCCESSFULLY applied!
script result was [3]

I think we need someone else to test the zip file.

You don't have the Nexus 4 anymore?

ramjet73
[Nexus 4 General] ekwillister:
Flashed the pre3 zip successfully but LTE doesnt stick on reboot. Works fine after switching the preferred network though. Using the stock 5.0 rom.
[Nexus 4 General] ramjet73:
Did you get the recovery.log file?

All you need to do is issue the following command after flashing the zip file while still in recovery:

adb pull /tmp/recovery.log recovery.log

The recovery.log file should be in the same directory as adb.exe after issuing that command and if you can post it here that would help with the debugging.

If you didn't get the recovery.log on your last flash it won't hurt to flash the zip file again since it would just be flashing the same radio.

I just manually made a copy of settings.db in the /tmp/directory and modified the script to update that copy and it still got the same "home directory" error so I don't think the problem is access to the data partition.

Any debugging help would be appreciated since getting this zip file working would mean that the database update won't have to be done manually each time a ROM is flashed.

ramjet73
[Nexus 4 General] *child:
OK, let's try it your way. Try the attached zip. It only includes the database modification done by a script (instead of edify). I hope there are no syntax errors. Let me know how it goes.
[Nexus 4 General] murava:
This version does not include the actual radio if you didn't notice that.

I'm on a rooted stock 5.0 install, and can't get LTE to stick after reboot with any of the previous versions (1.6, 2.0B1 pre 1/2/3)
[Nexus 4 General] ramjet73:
Set permissions syntax error this time:

Installing '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre4-sqlite3-test.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip contains SELinux file_contexts file in its root. Extracting to /file_contexts
I:Legacy property environment initialized.

Nexus 4 LTE and LTE hotspot/tethering fix v2.0
by *child

mount: failed to mount /dev/block/platform/msm_sdcc.1/by-name/userdata at /data: Device or resource busy
minzip: Extracted file "/tmp/scripts/query.sh"
Nexus 4 Android 5.0 ROM detected.

Extracting files ...
minzip: Extracted file "/tmp/sqlite3"
script aborted: set_perm_recursive() expects 5+ args, got 4
set_perm_recursive() expects 5+ args, got 4
I:Legacy property environment disabled.
E:Error executing updater binary in zip '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre4-sqlite3-test.zip'
Error flashing zip '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre4-sqlite3-test.zip'
Updating partition details...

ramjet73
[Nexus 4 General] *child:
Yes, that's what I said and that's what you quoted. Repeatedly flashing modems can lead to curruption, so I'm just going to debug the settings.db modifications. This is what will allow LTE to stick after reboots.
[Nexus 4 General] ramjet73:
Yea, none of those create the required database entry to make that setting stick.

Still working on that. ;)

ramjet73
[Nexus 4 General] *child:
OK, fixed. This is so annoying :p
[Nexus 4 General] ramjet73:
Yea, really. ;)

The "delete_recursive("/tmp");" command you added deletes the recovery.log :(, so I booted into android to check the contents of settings.db and there is a "preferred_network_mode" entry but the value is "0". Without recovery.log I'm not sure if the script made that entry or it was there from something else.

ramjet73
[Nexus 4 General] *child:
FFS. OK see if you can get the log now.
[Nexus 4 General] ramjet73:
I deleted that row from settings.db so it will be clear if that entry is added by the zip or not.

Syntax error in the SQL command this time:

Installing '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre6-sqlite3-test.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip contains SELinux file_contexts file in its root. Extracting to /file_contexts
I:Legacy property environment initialized.

Nexus 4 LTE and LTE hotspot/tethering fix v2.0
by *child

mount: failed to mount /dev/block/platform/msm_sdcc.1/by-name/userdata at /data: Device or resource busy
minzip: Extracted file "/tmp/scripts/query.sh"
Nexus 4 Android 5.0 ROM detected.

Extracting files ...
minzip: Extracted file "/tmp/sqlite3"
Setting LTE as the preferred network mode ...
about to run program [/tmp/scripts/query.sh] with 1 args
Error: near line 4: near "(": syntax error
run_program: child exited with status 1
Nexus 4 LTE fix SUCCESSFULLY applied!

script result was [3]
I:Legacy property environment disabled.
Updating partition details...

That's progress! :good:

ramjet73
[Nexus 4 General] *child:
LOL OK I think we have it.
[Nexus 4 General] ramjet73:
A different syntax error this time.

Installing '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre7-sqlite3-test.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip contains SELinux file_contexts file in its root. Extracting to /file_contexts
I:Legacy property environment initialized.

Nexus 4 LTE and LTE hotspot/tethering fix v2.0
by *child

mount: failed to mount /dev/block/platform/msm_sdcc.1/by-name/userdata at /data: Device or resource busy
Nexus 4 Android 5.0 ROM detected.

Extracting files ...
minzip: Extracted file "/tmp/scripts/query.sh"
minzip: Extracted file "/tmp/sqlite3"
about to run program [/tmp/scripts/query.sh] with 1 args
Setting LTE as the preferred network mode ...
Error: near line 4: near "ON": syntax error
run_program: child exited with status 1
Nexus 4 LTE fix SUCCESSFULLY applied!

script result was [3]
I:Legacy property environment disabled.
Updating partition details...

If you redirect stdout to a log file when you run the script we may get some additional info.

ramjet73
[Nexus 4 General] *child:
So close! I can feel it!
[Nexus 4 General] ramjet73:
You got it! :highfive:

Installing '/sdcard/Allupdates/Patches/nexus-4-lte-fix-v2.0-pre8-sqlite3-test.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip contains SELinux file_contexts file in its root. Extracting to /file_contexts
I:Legacy property environment initialized.

Nexus 4 LTE and LTE hotspot/tethering fix v2.0
by *child

mount: failed to mount /dev/block/platform/msm_sdcc.1/by-name/userdata at /data: Device or resource busy
Nexus 4 Android 5.0 ROM detected.

Extracting files ...
minzip: Extracted file "/tmp/scripts/query.sh"
minzip: Extracted file "/tmp/sqlite3"
about to run program [/tmp/scripts/query.sh] with 1 args
Setting LTE as the preferred network mode ...
Nexus 4 LTE fix SUCCESSFULLY applied!

script result was [3]

ramjet73
[Nexus 4 General] *child:
Awesome! Well done. Thanks for the help. I will need to put everything back together for one more test.
[Nexus 4 General] *child:
It happened to me once with my Nexus 4 while testing a release. I must have flashed a zip 20-30 times consecutively without rebooting. I think not rebooting is what caused the corruption. It's still a good idea to check the modem before flashing but I don't think it can be done easily, and it's probably unnecessary if just flashing even a few times a week.
[Nexus 4 General] murava:
The pre8 version did work for me in keeping the phone set to LTE/GSM auto (prl) through reboots, but for some reason, my phone won't actually connect to 4G. It will only show up as connecting to H.
[Nexus 4 General] ramjet73:
One more thing...

One last suggestion.

Since there was a settings.db entry on my Nexus 4 for "preferred_network_mode=0", and I have no idea how that got there, it might be a good idea to add a SQL query to the script to update the value to "9" in case that row already exists and the insert fails.

That's because it was a test version for the database update only and didn't include the hybrid radio.

I wonder how many people have been lurking in this thread and flashing the test versions without even knowing what they contain. :rolleyes:

ramjet73
[Nexus 4 General] *child:
I factored that in already: preferred_network_mode is removed, and then added back as preferred_network_mode=9.

That's XDA for you. People flashing stuff without reading :D
[Nexus 4 General] *child:
PRE-RELEASE Update

Before flashing, please remember to make a Nandroid backup. Also, please double check the MD5 hash of the ZIP. Additionally, you can download the .md5 file and have TWRP check it for you. Please test both the installer and uninstaller. Let me know how it goes.

Thanks!

INSTALLER 2014/11/18 v2.0-pre9 - Downloadhttps://github.com/marcandrews/mako-lte-and-lte-hotspot-fix/releases/tag/2.0

Update hybrid radio to .33/1.04

Update update-binary, sqlite3, and add file_contexts for SELunix

Update updater-script for 5.0

Utilize settings.db edits (instead of build.prop edits) to enable LTE permanently

UNINSTALLER 2014/11/18 v2.0u-pre3 - Downloadhttps://github.com/marcandrews/mako-lte-and-lte-hotspot-fix/releases/tag/2.0u

Update radio to 1.04

Update update-binary, sqlite3, and add file_contexts for SELunix

Update updater-script for 5.0
[Nexus 4 General] ramjet73:
No big deal, but did you intend for your flashable zips to have .md5 extensions?

NVM. I see now that those are the MD5's for the zip files. :good:

ramjet73
[Nexus 4 General] *child:
I removed the previous pre-releases so now there are only two files there, the flashable zip and the corresponding .md5 (i.e nexus-4-lte-fix-v2.0-pre9.zip and nexus-4-lte-fix-v2.0-pre9.zip.md5). If you download both to the same directory on your phone, TWRP will automatically check the MD5 before flashing.

Edit: No worries.
[Nexus 4 General] murava:
Well no, that's not why. I had already had the hybrid radio flashed. Where I was though, I am on a border of where LTE cuts off, so it was connecting to the stronger H signal instead of the weaker LTE signal. When I changed locations, it went to LTE with no issues. In the past, my phone would generally still connect to the weaker LTE signal instead though.

But thanks for being condescending :rolleyes:
[Nexus 4 General] ramjet73:
I didn't mean to come across that way but there were several posts during that part of the thread that identified those versions as incomplete and for testing purposes only. AFAIK you, and everyone else for that matter, didn't offered to help with the testing even though I asked at one point for someone to verify my results.

You're more than welcome to flash test versions publicly available on XDA but it will help the developer(s) and tester(s) in the future if you make it known that you are doing that. Otherwise it will appear, as it did to me, that you are using test versions and reporting results without being aware of their intended purpose.

ramjet73
[Nexus 4 General] madadhd:
Hi All, I've installed the new twrp 2.8.2.0, rooted my phone with the new supersu v2.27, then I installed busybox free and init.d toggler from the app store to enable init.d. Finally I flashed the lte fix 2.0 pre-9 fix. Also, I have a TM9190 sim card which I THINK is LTE enabled.

So here are my issues:

1. Under Settings, More, Cellular Network, the idiot in me wanted to see why there was no preferred 4G setting so I changed it to 3G and now I can't change it back to 4G because there is no option. How can I change the preferred network back to 4G?

2. Under APN the only option I have is T-Mobile GPRS which is selected. There is no LTE network option and I'm in an area with LTE. What have I done wrong?

Also, thank you for the great work you do. It is very appreciated by many and certainly by me.
[Nexus 4 General] marcviado:
Im guessing this has no effect for at&t users? Just flashed it i now have the LTE option in networks but still getting the H and H+ connection..
[Nexus 4 General] *child:
First off, well done on rooting, installing busybox and enabling init.d, but all these are only necessary if you are on Rogers, Bell, or Telus and need the tethering over LTE fix ... but it's not that important, so don't worry.

As for your issues:

You can simply reflash the zip.

You need to add the appropriate T-Mobile LTE APN:

Name : T-Mobile LTE

APN: fast.tmobile.com

MMSC: http://mms.msg.eng.t-mobile.com/mms/wapenc

MMS Protocol: WAP 2.0

MCC: 310

MNC: 260

APN Type: default,supl,admin,dun,mms

Someone else who's actually on T-Mobile can confirm these APN settings.

Hope this helps.
[Nexus 4 General] *child:
[MENTION=275009]ramjet73[/MENTION] are you running stock Android 5.0 LRX21T?
[Nexus 4 General] *child:
It only works where AT&T is using LTE on Band 4. See here for more information.
[Nexus 4 General] ramjet73:
I've got stock (LRX21O) on my Nexus 5 and the [MENTION=1050103]sykopompos[/MENTION] .99999 ROM on my Nexus 4, but if there is something you want me to test, it's easy enough to restore my NANDroid of stock LRX21T.

ramjet73
[Nexus 4 General] *child:
OK cool! [MENTION=4533691]Joshua Mr PC Repair[/MENTION] has told me that tethering over LTE still works even without the init.d and addon.d scripts. Can you restore LRX21T, and then run the following in a Terminal Emulator or ADB ...

su
iptables -S > /storage/emulated/legacy/iptables.log
iptables -t nat -S > /storage/emulated/legacy/iptables_nat.log
iptables -t mangle -S > /storage/emulated/legacy/iptables_mangle.log

... and then post those three files, iptables.log, iptables_nat.log and iptables_mangle.log, here? I need to look at the iptables to confirm that modifications are not required.
[Nexus 4 General] ramjet73:
Attached.

This is without your mod installed which I assume is what you wanted.

ramjet73
[Nexus 4 General] *child:
Thanks. Seems like iptables modification is no longer required. I guess this will just become an "LTE enabling" mod.
[Nexus 4 General] ramjet73:
At least for now.

The lack of a carrier authorization for tethering may have been an oversight in 5.0 and we may need "tether_dun_required=0" in settings.db or something like it again in the future with 5.x.

Thanks for continuing to support this mod even though it appears that you have moved on to the Nexus 5. :good:

ramjet73
[Nexus 4 General] CSX321:
I made all the modifications manually to 5.0. So I should probably remove the init.d script now? Or is it unnecessary, but not hurting anything by being there?
[Nexus 4 General] *child:
... and I still don't know exactly why tethering over LTE works for the most part on T-Mobile, and not any Canadian carriers. I think the packets have labels, tethered data packets have a different label than normal data packets, and Canadian carriers may be detecting the packet labels and denying them. It could have also been an oversight by Google when developing the firewall and not factoring in LTE capability.

I guess only time will tell, but I think Android 5.0 may be the last official update for the Nexus 4.

From what I can tell, those init.d and addon.d have no effect, but if you want to, remove the following files:

system/etc/init.d/81makoltetether

system/addon.d/80-mako-lte.sh
[Nexus 4 General] ramjet73:
I'd be surprised if Google doesn't maintain Lollipop on the Nexus 4 until it is replaced by the next version of Android but, as you said, time will tell.

ramjet73