yashsingh1/xdaforums huggingface dataset:
[Sprint LG G2] Ascertion:
There is no Tethering.apk. it's integrated into the LGSettings.apk.

I'll recompile with this one and see if it works shortly.

Sent from my LG-LS980
[Sprint LG G2] fryguy:
Thought it was in system/framework/services.jar. That's where the tether.smali I was looking at. Here's the odex. Not at my computer for deodexed.

https://www.dropbox.com/s/97rzlx2z14pnvjn/StockZV8-Odex servicesjar.zip

Will have to look at LG settings also. Not that I knew what I was looking at but now I know to look there also.
[Sprint LG G2] Ascertion:
No go. Here's a screenshot of the problem.

Here's my files, includes both the stock Services.jar, and the decompiled Services.jar.
[Sprint LG G2] Ascertion:
Alright. I found something somewhat interesting. Not sure if Sprint's involved in this method, but there's another file called Tethering$EntitlementCheckService.smali file that has a lot of entitlement checks. Most of which appear to be AT&T checks, but some are for different carriers. Can't tell which is Sprint or how to disable them.

You'll find the Tethering$EntitlementCheckService.smali in the same folder you'll find Tethering.smali. I've tried numerous different workarounds but without understanding how things work, I'm taking shots in the dark.
[Sprint LG G2] leroybrute:
I have been doing the same in this area for 2 weeks now. I have actually had tether a few times and used for an hour or so. But something changes when i shut off tether and try to re-enable which causes a reboot or breaks my phone.

I can't stop trying even though I know this is above my pay grade.. Glad smarter people are involved now.
[Sprint LG G2] metalboy94:
Please also try replacing TetherNetwork.smali with this one in services.jar and using stock Tethering.smali. If it doesn't work, I may need logcats as finding the activity name for the 'not allowed' dialog will be a pain.

https://www.dropbox.com/s/kseb5y9j113g3xe/TetherNetwork.smali
[Sprint LG G2] Ascertion:
The not allowed dialog is in the LGsettings.apk under res/values/strings.xml, if that helps.

EDIT: I'm uploading the decompiled LGSettings.apk now and will link shortly.

Testing your tethernetwork.smali.

EDIT2: Tethernetwork.smali didn't work.

Here's the download now to all of the files that should be related to Sprint tether. (It contains LGSettings.apk, and Services.jar. Both Decompiled for you.)

Uploading logcat as we speak.

Sent from my LG-LS980
[Sprint LG G2] metalboy94:
I will take a look in there - if the file also contains the ID used by android to reference the dialog, we're golden.
[Sprint LG G2] Ascertion:
Here's the log cat.

https://www.dropbox.com/s/9olaqsv61pp2di1/2013-12-20-13-18-19.txt

Sent from my LG-LS980
[Sprint LG G2] metalboy94:
Thanks for your support, this is just a little bit messier than what I usually do (cracks for removing root checks or *ahem* activating premium features).
[Sprint LG G2] Ascertion:
Much respect for trying...considering you don't even own this device. I'll be more than happy to continue testing your attempts, though.

Sent from my LG-LS980
[Sprint LG G2] metalboy94:
So far I know the intent that launches the dialog is "lge.tethernetwork.action.NETWORK_ERROR_DIALOG". This does not sound well, but let's see if it really comes from the network.
[Sprint LG G2] metalboy94:
I've hit a pretty big roadblock.

_L5:

if (Tethering.access$1900(_fld1) != null) {

Tethering.access$1900(_fld1).showAuthErrorDialog();

return flag;

showAuthErrorDialog triggers the dialog you're getting when trying to activate tethering. However this block is part of a switch-case sequence which is not fully decompiled (tried with 2 different Java decompilers), so I cannot grab the value of whatever is checked for this block to run.

I tried JD-GUI and JAD. Anyone know of any others?
[Sprint LG G2] Ascertion:
Which file is it and I'll attempt to get it decompiled for you. Is there a way to change the script there to just remove the check so it doesn't refer to that dialog?

Sent from my LG-LS980
[Sprint LG G2] metalboy94:
Sure there is, in fact I could have done this on a higher level - but I believe this only stops the dialog, and the tethering will still not work. It's worth a shot though. The file I was talking about is Tethering$TetherInterfaceSM$InitialState.smali in services.jar .

I removed the dialog in TetherNetwork.smali. Give it a try: https://www.dropbox.com/s/kseb5y9j113g3xe/TetherNetwork.smali
[Sprint LG G2] justinswidebody:
Give it a try when I get home. Thanks for a great Christmas present
[Sprint LG G2] bullghost:
metalboy94, Congrats you made it after long trying error !! .
[Sprint LG G2] justinswidebody:
Metalboy can you post your email that I am supposed to send you money on right here please. I don't know how to find donation links on the mobile app
[Sprint LG G2] ericdabbs:
Sprint wifi tethering issue has been solved. Please see this thread for more information.

http://xdaforums.com/showthread.php?t=2584775
[Sprint LG G2] souleman:
Yeah, that was the people in this thread (mostly metalboy94 coding) working on the fix and then posted in Sprint forums once it was working. Can't use development section to work on development, only to post things that have been developed. So the work went here and the final product went there.
[Sprint LG G2] ericdabbs:
Yuo. My point of my post is that discussion about the Sprint native tether should go into that thread now instead of here since this thread won't be maintained.
[Sprint LG G2] metalboy94:
New goal: being able to activate tethering multiple times without rebooting.

Can anyone test https://www.dropbox.com/s/z604e5q363hyncb/TetherNetwork_2.smali and provide a logcat?
[Sprint LG G2] Ascertion:
Recompiling it now. Will have results shortly.

EDIT: Caused bootloops.
[Sprint LG G2] justinswidebody:
Didn't realize we were back over here.
[Sprint LG G2] metalboy94:
Reboot without WiFi on? I kinda need a logcat to figure out what I did wrong.
[Sprint LG G2] DRACONIANDRAGON:
Would hotspot allow full speed connection? My 4g in my home is a solid 30Mbps, but anything connected by hotspot averages 2-3Mbps. Is their something I could do to improve this?
[Sprint LG G2] ericdabbs:
Crap..I didnt know that trying to activate it multiple times was an issue. No wonder my hp touchpad couldnt find it. After reboot it can find it now.
[Sprint LG G2] metalboy94:
Probably not, you have to remember the WiFi chip in the G2 isn't exactly router-level, nor does it have actual antennae.
[Sprint LG G2] DRACONIANDRAGON:
Would changing TCP Congestion Algorithm help?

My wifes S4 gives me on average 23-25Mbps.

Your probably right about the LG antenna.
[Sprint LG G2] Ascertion:
Will get that after work tomorrow. Sorry long days here.
[Sprint LG G2] Ascertion:
[MENTION=4088197]metalboy94[/MENTION], we've confirmed that tether works flawlessly over a 4g lte connection but it times out on 3G and causes an error that it cannot connect to data services. I'll get a log of this first, then rebuild that other services.jar now and get a log of that.

Sent from my LG-LS980

EDIT: Even with WiFi off upon reboot, still sends me into infinite bootloop.

Here's the logcat for the 3G-only tether that's giving us problems. It'll drop the 3G data session (3G icon goes away), then it'll display that there's errors connecting to the network, then -67 error will pop up.)
[Sprint LG G2] xxKaDiaNxx:
Native hotspot is working with stock rooted odex rom on 3g network for me. Using twrp recovery if that helps.
[Sprint LG G2] Ascertion:
Can you post a logcat of it running please? There may be a problem with the Network Mode then on some devices. Are you set on Global or CDMA?

EDIT: Were you also on 4G when it activated and dropped to a 3G session?
[Sprint LG G2] souleman:
A couple days ago, I had a 30 mile drive to do. Son connected his Kindle Fire via hotspot to watch YouTube. Established connection in 4G, dropped to 3G about 10 minutes in. Lost data (on phone, there is a dead zone for about 3 miles). Reconnected when it got signal back, and back into 4G a couple miles from destination. The only time we had any issue was in the dead zone and his video started right back up as soon as I got out of the dead zone.

No logcat, didn't realize people were having an issue.

Oh, and with this pone, I very rarely turn off WiFi. Always have it on when I reboot.
[Sprint LG G2] xxKaDiaNxx:
There is no 4G in this area (only 3G for us sprint users where i live) My preferred network mode is set to Global. I tried the IceRom 1.1 but could not get the Wifi Tether to work, came on once or twice for a few seconds then wouldn't work. Works flawlessly now. Wiped delvic, cache, data, and system (not internal data) used twrp 2.3.3 for wipe and to flash the Stock Rooted LS980ZV8 deodex (not Odex like I mentioned before, my mistake.) Then flashed the Native hotspot [v8] mod. I am only slightly familiar with logcats from when i did a little android programming, not sure how to record exactly what you want but I used an app to make 2 captures of my turning it on and having a device connect. If you could tell me what type of filters to use it would be helpful. Hope any of this helps, super excited after days of trying to get this to work. :D

Also I have seen no issues thus far with enabling the native hotspot multiple times, have not tried excessively but a handful over the night, no need for reboot as of yet.
[Sprint LG G2] Ascertion:
Thank you very much for this. This will help the others that are having issues.

Sent from my LG-G2
[Sprint LG G2] ericdabbs:
Can you try it also on LTE/CDMA network mode just to see if there is any difference?
[Sprint LG G2] charlie95113:
Check pm plz
[Sprint LG G2] justinswidebody:
Metalboy, I need your help. I found in TetherNetworkDataTransition.smali where it limits hotspot only to ehrpd and lte service. I need you to take a look and see if we can disable it. I don't know what values to change. I assume they are const. Values from 0x0 which equals false to 0x1 which equals true?
[Sprint LG G2] metalboy94:
Sorry I've been away these past few days, had things to do. I will likely take a look on the logcats and TetherNetworkDataTransition after NYE.

Off I go to a 5 hour sleep. :eek:
[Sprint LG G2] justinswidebody:
No problem,enjoy yourself
[Sprint LG G2] ericdabbs:
Any update on this?
[Sprint LG G2] justinswidebody:
Pretty sure I have fixed all the issues. Just need someone to test. The link is posted in the other thread
[Sprint LG G2] Ascertion:
Very much appreciated. Give me about an hour for work then I'll be back at my PC to recompile and test. If it works, I'll make a thread in Sprint development and give you 100% credit.

Sent from my LG-LS980
[Sprint LG G2] fatboypup:
Yay i wanna donate a few bucks to whomever if this works
[Sprint LG G2] Ascertion:
You're definitely on the right track, but it unfortunately did not work. Dialog is now gone (as predicted), but it still toggles off shortly after turning on because it fails the check.

EDIT: I think I got Tethering$TetherInterfaceSM$InitialState.smali decompiled. Try here.
[Sprint LG G2] Riley1524:
I'll donate to whomever gets this working as well. Where I live, there's only one choice for a Internet service provider and they really suck balls! I would love to be able to use my LTE like I was with Verizon. Thanks guys!
[Sprint LG G2] uniquenameevo:
I rarely tether, but I would also throw a few bucks towards a solution. If I needed it today I would have to flip back to the iphone5.

I'm assuming it would be paypal? I'm in for $10.
[Sprint LG G2] metalboy94:
This much I could do myself - the problem occurs when trying to convert it to Java source code (it's easier for me to read it and figure out whatever it deals with). I will try to deal directly with the smali again.
[Sprint LG G2] metalboy94:
I have found the values in the switch-case sequence but I don't really know what they mean. However I singled out 2 cases which do not seem to happen for errors, and switched their values with the one which triggers the error dialog.

Please try each of these out, removing the underscores and numbers before recompiling. It shouldn't matter if you use the previous Tethering.smali patch or not.
[Sprint LG G2] Ascertion:
I'll give it a shot after work today.

Sent from my LG-LS980
[Sprint LG G2] Ascertion:
Both test files caused a reboot on me. Any other ideas?

I left everything else stock, only replaced the Tethering$TetherInterfaceSM$InitialState.smali files each time.
[Sprint LG G2] bullghost:
i think its permission denied on calling method because of different user level access on each system file
[Sprint LG G2] leroybrute:
Agree. In the last few weeks of messing with this I have had 3 or 4 instances where I had tether working on my laptop and tablet, after 45 min to an hour I would get an unauthorized access error and reboot. I could never get tether back. Permissions and some of the changes I made would reset, so I would have to start from scratch.
[Sprint LG G2] metalboy94:
Not good. What I did was force tethering to start no matter the network response. Now is a good moment to find out what those values are.
[Sprint LG G2] Ascertion:
By System Level, are you referring to SU/Normal user privileges, or rw--r--r--? With root, we should be able to change the user levels, or is that dependent on those smali files we can't decompile fully?

Sent from my LG-LS980
[Sprint LG G2] metalboy94:
I think it depends on those smali files or, worse, on something inside the baseband. In the logcats, android seemed to complain about the user for the calling method when displaying the dialog, which actually works.

Can you give me a logcat before the phone reboots with those patched SMInterface files?
[Sprint LG G2] bullghost:
its apk sign problem when you deodex the system files, each system file should have same signed key.

you can found out the more detail by logcat ,try start log the logcat from start booting the phone
[Sprint LG G2] chris0160:
On PA wifi tethering works, so is it possible to find the answer from a logcat or something from that?
[Sprint LG G2] metalboy94:
This kinda confirms the answer is within the smalis.
[Sprint LG G2] Ascertion:
I'll adb log cat to my PC and send you the patched log cats. Give me a few minutes.

Sent from my LG-LS980
[Sprint LG G2] Ascertion:
Okay, turning WiFi on or having it enabled whenever you boot with both of the test smalis cause instant bootloops. I was wondering why they weren't causing bootloops before. LOL!

Give me a few more minutes and I'll have both logs.
[Sprint LG G2] metalboy94:
Okay this is really weird. I suppose those values in the switch-case are somehow used later on for connectivity... I'll have to try and decipher the smali again.
[Sprint LG G2] Ascertion:
Here's Logcats 1 and 2.

Logcat 1 was for the smali_1 file.

Logcat 2 was for the smali_2 file.
[Sprint LG G2] metalboy94:
It seems the phone gets close to opening the hotspot (even activates the code for automatically disabling the AP when not in use), but doesn't like some code in or around that switch-case i modified.
[Sprint LG G2] Ascertion:
So, in other words, it works, aside from the WiFi causing it to crash and reboot?

Both of the tests caused a reboot upon using anything Wi-Fi related. If they both have something in common, then we can narrow it down. (I didn't thoroughly look but I think I did notice a change from 0x1 to -0x1 in certain areas and vice versa. Maybe one of those need to stay the same, while only the other one needs modification?
[Sprint LG G2] metalboy94:
Okay, I figured out what it's not happy about (Google Search thankfully indexed exactly the part of the Android source code that contained this information). Moreover, it seems that with the _2 file the hotspot is actually started for a split second:

D/WifiStateMachine( 5532): SoftApStartingState{ what=131100 when=0 obj=* ID: -1 SSID: LG-LS980_ddb BSSID: null PRIO: 0

Stand by for the fix (gotta go out for a few minutes).
[Sprint LG G2] Ascertion:
Thanks buddy for all of your help again.

Can't wait to test it when it's ready.
[Sprint LG G2] metalboy94:
Don't get all giddy just yet, that ID: -1 looks a bit worrying. But we'll see what happens next. ;)
[Sprint LG G2] metalboy94:
Here they are - I decided I'd fix both of them since there is a chance they may both work. But try _2 first, since I found that line with the hotspot SSID in the second logcat.
[Sprint LG G2] Ascertion:
It appears we're much, much closer. The reboot on both are fixed. On test 1, it says WiFi hotspot is active!!! But it shuts off within 2 seconds.

Second one gives me an error "Unable to connect to hotspot. Please check with your carrier and add a hotspot subscription plan."

Here's logcats again.
[Sprint LG G2] justinswidebody:
If you compared the paranoid android tethering$tetherinterfaceSM$initialized.smali with the factory is there a chance you might find the fix?
[Sprint LG G2] metalboy94:
Will be doing that after dissecting the logcats a little - however I have a feeling this is all LG code.
[Sprint LG G2] justinswidebody:
[/COLOR]https://www.dropbox.com/s/o1ln7zxjbbvgze1/paranoid services.zip

There is the paranoid android services decompiled
[Sprint LG G2] metalboy94:
I can sort of see what the PA team has done. I think we can replicate that.

Ascertion, I hope you're patient today, we will be testing 2 things. This smali here does the first part of the (presumably) necessary edits. If it won't work, I will do the second part of the edit (and bring it almost to PA form). If it still won't work, we'll try the same with the second version of this smali.

https://www.dropbox.com/s/w6ujxsfitn9gbs7/Tethering%24TetherInterfaceSM%24InitialState_1_new.smali

Btw, please be kind and save logcats of every trial.
[Sprint LG G2] Ascertion:
I got work off today so if you're willing to pump out attempts or fixes, I'll be more than happy to test them.

Give me a few minutes and I'll have results/logcats shortly.
[Sprint LG G2] metalboy94:
I'm not doing anything special tonight, so maybe we can work this out. :laugh:
[Sprint LG G2] Ascertion:
Turns on, displays on status bar the Wifi tether is active, but turns it back off within 2-3 seconds. Logcat attached.
[Sprint LG G2] Ascertion:
Here's the funny thing...USB tethering works. lol
[Sprint LG G2] justinswidebody:
Count me in for 20 dollars as long as someone can provide me with an odex version
[Sprint LG G2] metalboy94:
Well, that's something. Here's the second stage.

https://www.dropbox.com/s/6p1q97dhj9cbnm8/Tethering%24TetherInterfaceSM%24InitialState_1_new2.smali
[Sprint LG G2] justinswidebody:
Ascertion, You might also want to install WiFi tether for root users to see if any of these edits allow it to broadcast a WiFi tethered signal. I know we can at least get that apk not to show any errors when activating but it won't broadcast a signal
[Sprint LG G2] Ascertion:
Removed the active WiFi Tethering and shut off within 3 seconds.

EDIT: This one also broke USB Tethering.
[Sprint LG G2] metalboy94:
Okay then, now let's see the second version.

https://www.dropbox.com/s/bfxsa1pral567am/Tethering%24TetherInterfaceSM%24InitialState_2_new.smali
[Sprint LG G2] Ascertion:
Same thing as last one. Active WiFi tethering display is no longer there and it turns off after ~3 seconds or so. USB Tethering doesn't work, either.
[Sprint LG G2] metalboy94:
I am a bit curious about something, can you please try using _1_new and this Tethering.smali: https://www.dropbox.com/s/syk1b8zcsqzkzzj/Tethering.smali

Thing is that there is an error coming up in the logcat saying a particular object "isn't created or Tether feature is blocked", and after that a message (like the ones in the switch-case) gets sent. I removed that message, I'm wondering if it will now stop turning tethering off on its own.
[Sprint LG G2] Ascertion:
USB Tethering works, but no WiFi. WiFi tether displays active in status bar, but turns off after ~3 seconds.

Logcat attached.
[Sprint LG G2] metalboy94:
E/WifiStateMachine( 815): Error tethering on wlan0

Getting better and better. /s

justinswidebody, can you supply Tethering.smali from PA?
[Sprint LG G2] Ascertion:
https://dl.dropboxusercontent.com/u/37471265/Android Stuff/Tethering.smali

That's from PA.
[Sprint LG G2] justinswidebody:
Ascertion beat me to it.

---------- Post added at 09:48 PM ---------- Previous post was at 09:41 PM ----------

In TetherNetwork.smali. there are a few sections. One is gethotspotfeatureenabled , disabletethernetwork and enabletethernetwork, are these worth looking into?
[Sprint LG G2] metalboy94:
They will be if I can't make anything out of diff'ing stock Tether.smali and PA Tether.smali. I swear, why does LG have to do everything so difficult.
[Sprint LG G2] justinswidebody:
I'm sure there is an easier solution to this. I just wish I understood smali better.
[Sprint LG G2] metalboy94:
There would definitely be a better solution if Tethering.smali would decompile correctly. As it is, however, all I can do is guesswork (I wonder if there's any tool for debugging smali line by line).
[Sprint LG G2] justinswidebody:
I don't believe there is. I am using virtuous ten studio. It gives me all the sub categories and I can hover over some of the code and it tells me how it's read
[Sprint LG G2] metalboy94:
First time I hear about that tool and it looks really interesting. It might improve my workflow, but I'll see about that after we're finished here.
[Sprint LG G2] justinswidebody:
You might want to go ahead and download it. It makes life a lot easier. Color codes everything and puts it all in sections
[Sprint LG G2] Ascertion:
In another Sprint thread, there was a build.prop edit that involved Tethering. It's not present on my current build.prop, but I'm looking for that thread now.
[Sprint LG G2] justinswidebody:
ro.tether.denied=false
[Sprint LG G2] Ascertion:
Thanks, giving it a try now. Also trying another method that might work.
[Sprint LG G2] souleman:
Not sure how much code you are actually getting using your software. Have you tried dex2jar to get a .class file from the dex, and then something like jd-gui to get plain text java? I haven't tried it (I quit coding years ago), and from my understanding, the resulting java is messed up enough that you couldn't just recompile it into a working program. But it might be enough to give you an idea on what is going on in the .smali to figure out what it's doing.
[Sprint LG G2] Ascertion:
No go on that build.prop.

I got it to successfully connect via WiFi tether, but I had to temporarily disable my active data connection. (I toggled to 3G from 4G, and it times my connection out briefly to make the switch. During this timeout, I got it to turn on and it broadcasted an SSID. However, even when the device got it's data connection back, there was no data connection to the PC that was tethered.)
[Sprint LG G2] justinswidebody:
I hardly know what I am looking at to begin with, however this program say there is a cond_7. If you hover over it It will bring up a pop up of what line that cond_7 Is referenced from.

---------- Post added at 10:26 PM ---------- Previous post was at 10:25 PM ----------

So then you jump to that line and you can tell what is supposed to happen
[Sprint LG G2] metalboy94:
That is exactly what I am doing, but jd-gui gives an INTERNAL ERROR on Tethering.smali. So I have to go through the smali in Notepad++.
[Sprint LG G2] justinswidebody:
Ascertion, can you get a log cat of that? That was using the WiFi tether Trev mod apk right?
[Sprint LG G2] Ascertion:
Nope. That's with Native hotspot. I'll grab a logcat real quick. 1 second.
[Sprint LG G2] Ascertion:
Here's the logcat. I was able to reproduce it. The Hotspot will turn on and work if there's no active data connection when it's toggled. No active data connection after the connection through SSID is met to laptop.
[Sprint LG G2] justinswidebody:
Thanks
[Sprint LG G2] metalboy94:
Does anyone here need Bluetooth tethering? I wanna try a little something. Not expecting success but hey, worth it.
[Sprint LG G2] Ascertion:
I can definitely test Bluetooth tethering.
[Sprint LG G2] metalboy94:
I was actually wondering if you'd care about it missing. I have this odd feeling it can help with our problem.