[T-Mobile LG G3] motoridersd:
I've managed to get my stock Hotspot to work without using pcweb as the APN, but it's not consistent. Sometimes it won't work after a reboot, but another reboot makes it work. It's definitely more consistent if I use Tasker to start it vs the settings screen.

The changes I have made so far are:

Modified arrays.xml in framework-res.apk

Removed <item>4</item> from this array:

<integer-array name="config_tether_upstream_types">
<item>0</item>
<item>4</item>
<item>5</item>
<item>7</item>

0 is mobile, 4 is dun, 5 is hipri and 7 is Bluetooth

Replaced pcweb.tmobile.com with fast.t-mobile.com in <string-array name="config_tether_apnlst">

And I set tether_dun_required to 0 before starting the Hotspot using a shell script and the sqlite3 binary.

sqlite3 "/data/data/com.android.providers.settings/databases/settings.db" "INSERT INTO global(name,value) VALUES('tether_dun_required',0)"

When it works, I can see the tethering being done through the fast.t-mobile.com APN:

D/Tethering( 1027): current_default_active_network[NetworkInfo: type: mobile[LTE], state: CONNECTED/CONNECTED, reason: connected, extra: fast.t-mobile.com, roaming: false, failover: false, isAvailable: true, smCause: 0, isConnectedToProvisioningNetwork: false]
D

The interesting part is that it's using it as a type mobile, vs mobile_dun. When it fails, it's trying to use the same APN, but as mobile_dun, and this fails:

D/CaptivePortalTracker( 987): NoActiveNetworkState{ when=-1ms what=1 obj=NetworkInfo: type: mobile_dun[LTE], state: DISCONNECTED/DISCONNECTED, reason: apnFailed, extra: fast.t-mobile.com, roaming: false, failover: false, isAvailable: false, smCause: 51, isConnectedToProvisioningNetwork: false target=com.android.internal.util.StateMachine$SmHandler }

The difference is that when it's failing, it's the CaptivePortalTracker that is not liking the use of fast instead of pcweb. This is probably happening when I start tethering from the settings screen and I'm causing the UpsellDialogActivity process to run:

D/UpsellDialogActivity(17691): Upsell Dialog Activity, Tethering_Type : Wifi

When I start the hotspot with Tasker, I do not get any UpsellDialogActivty or CaptivePortalTracker entries in the logs. I don't think my APN changes in frameworks-res.apk are making a difference in this case. The APN type might be.

D/Tasker ( 8546):	A2: WiFi Tether [ Set:eek:n ]
D/Tasker ( 8546): 18.32.09#E: exe: Hotspot On / WiFi Tether [ Set:eek:n ]
D/Tasker ( 8546): 18.32.09#E: WiFi Tether: cur: false new: true
D/Tasker ( 8546): 18.32.09#E: WiFi Tether: setWifiEnabled()
D/Tasker ( 8546): 18.32.09#E: wait for wifi tether state 3
D/WifiApDisableIfNotUsed( 1027): ACTION_TETHER_STATE_CHANGED
D/Tethering( 1027): sendTetherStateChangedBroadcast 1, 0, 0
D/WifiApDisableIfNotUsed( 1027): ACTION_TETHER_STATE_CHANGED
D/UsbSettingsReceiver( 3076): [AUTORUN] onReceive() : action = android.net.conn.TETHER_STATE_CHANGED
D/UsbSettingsReceiver( 3076): [AUTORUN] onReceive() : TetherState Changed=wlan0
D/UsbSettingsControl( 3076): [AUTORUN] setTetherStatus() : status=false
D/Tethering( 1027): Tethering wlan0
D/Tethering( 1027): InitialState.processMessage what=2
D/WifiApDisableIfNotUsed( 1027): ACTION_TETHER_STATE_CHANGED
D/Tethering( 1027): sendTetherStateChangedBroadcast 0, 0, 0
D/WifiStateMachine( 1027): transitionTo: destState=TetheringState
D/UsbSettingsReceiver( 3076): [AUTORUN] onReceive() : action = android.net.conn.TETHER_STATE_CHANGED
D/UsbSettingsControl( 3076): [AUTORUN] setTetherStatus() : status=false
D/WifiStateMachine( 1027): moveTempStackToStateStack: X mStateStackTop=2,startingIndex=2,Top=TetheringState
D/WifiStateMachine( 1027): invokeEnterMethods: TetheringState
D/WifiStateMachine( 1027): processMsg: TetheringState
D/WifiStateMachine( 1027): processMsg: TetheringState
D/CommandListener( 346): TetherCmd::runCommand. argc: 4. argv[0]: tether
D/TetherController( 346): tetherInterface(wlan0)
D/TetherController( 346): addV6RtrAdvIface: len = 2. Iface: wlan0
D/TetherController( 346): Router advertisement daemon stopped
D/TetherController( 346): Router advertisement daemon running
D/Tethering( 1027): Tethered wlan0
D/WifiApDisableIfNotUsed( 1027): ACTION_TETHER_STATE_CHANGED
D/WifiStateMachine( 1027): processMsg: TetheringState
D/WifiApDisableIfNotUsed( 1027): updateTetherState [wlan0]
D/WifiStateMachine( 1027): transitionTo: destState=TetheredState
D/WifiStateMachine( 1027): invokeExitMethods: TetheringState
D/WifiStateMachine( 1027): moveTempStackToStateStack: X mStateStackTop=2,startingIndex=2,Top=TetheredState
D/WifiStateMachine( 1027): invokeEnterMethods: TetheredState
D/Tethering( 1027): sendTetherStateChangedBroadcast 0, 1, 0
D/Tethering( 1027): MasterInitialState.processMessage what=1
D/TetherController( 346): Setting IP forward enable = 1
D/UsbSettingsReceiver( 3076): [AUTORUN] onReceive() : action = android.net.conn.TETHER_STATE_CHANGED
D/UsbSettingsReceiver( 3076): [AUTORUN] onReceive() : TetherState Changed=wlan0
D/UsbSettingsControl( 3076): [AUTORUN] setTetherStatus() : status=false
D/TetherController( 346): config_write_setting(/proc/sys/net/ipv6/conf/all/proxy_ndp, 2)
D/TetherController( 346): config_write_setting(/proc/sys/net/ipv6/conf/all/forwarding, 2)
D/CommandListener( 346): TetherCmd::runCommand. argc: 16. argv[0]: tether
D/TetherController( 346): Starting tethering services
D/TetherController( 346): Sending update msg to dnsmasq [update_ifaces;wlan0]
D/TetherController( 346): Tethering services running
D/CommandListener( 346): TetherCmd::runCommand. argc: 7. argv[0]: tether
D/TetherController( 346): setDnsForwarders(0 = '8.8.8.8')
D/TetherController( 346): setDnsForwarders(1 = '2001:4860:4860::8888')
D/TetherController( 346): setDnsForwarders(2 = '8.8.4.4')
D/TetherController( 346): setDnsForwarders(3 = '2001:4860:4860::8844')
D/TetherController( 346): Sending update msg to dnsmasq [update_dns;8.8.8.8;2001:4860:4860::8888;8.8.4.4;2001:4860:4860::8844]
D/Tethering( 1027): adding v6 interface rmnet0
D/CommandListener( 346): TetherCmd::runCommand. argc: 4. argv[0]: tether
D/CommandListener( 346): command tether interface add_upstream rmnet0
D/TetherController( 346): addUpstreamInterface(rmnet0)
D/TetherController( 346): .
D/TetherController( 346): addUpstreamInterface: interface rmnet0 already present
D/Tethering( 1027): current_default_active_network[NetworkInfo: type: mobile[LTE], state: CONNECTED/CONNECTED, reason: connected, extra: fast.t-mobile.com, roaming: false, failover: false, isAvailable: true, smCause: 0, isConnectedToProvisioningNetwork: false]
D/Tethering( 1027): upType: 0, active NW type=0
D/Tethering( 1027): chooseUpstreamType(true), preferredApn =5, got type=0
I/Tethering( 1027): Skip IPv6 Connectivity Check because IPv6 Tetheirng is supported.
D/Tethering( 1027): Only IPv6. but tethering uses both IPv4 and IPv6, so add default v4 dns addresses too - LinkProp:{InterfaceName: rmnet0 LinkAddresses: [2607::/64,] Routes: [::/0 -> fe80::,] DnsAddresses: [fd00:976a::9,] Domains: null MTU: 1440 Stacked: [ [{InterfaceName: clat4 LinkAddresses: [192.0.0.4/32,] Routes: [0.0.0.0/0 -> 192.0.0.4,] DnsAddresses: [] Domains: null MTU: 0} ],] }
D/CommandListener( 346): TetherCmd::runCommand. argc: 6. argv[0]: tether
D/TetherController( 346): setDnsForwarders(0 = 'fd00:976a::9')
D/TetherController( 346): setDnsForwarders(1 = '8.8.8.8')
D/TetherController( 346): setDnsForwarders(2 = '8.8.4.4')
D/TetherController( 346): Sending update msg to dnsmasq [update_dns;fd00:976a::9;8.8.8.8;8.8.4.4]
D/Tethering( 1027): notifying tethered with iface =rmnet0
D/Tethering( 1027): TetheredState.processMessage what=12
D/CommandListener( 346): [LGE_DATA] star tethering ...
V/NatController( 346): runCmd(/system/bin/iptables -A natctrl_FORWARD -i rmnet0 -o wlan0 -m state --state ESTABLISHED,RELATED -g natctrl_tether_counters) res=0
D/radish (11503): radish_setup_ipv6_stat_counters: ip6tables -N natctrl_tether_counters
V/NatController( 346): runCmd(/system/bin/iptables -A natctrl_FORWARD -i wlan0 -o rmnet0 -g natctrl_tether_counters) res=0
D/radish (11503): radish_create_counter_rules: ip6tables -A natctrl_tether_counters -i bridge0 -o rmnet0 -m quota2 --name bridge0_rmnet0 --grow -j RETURN
D/radish (11503): radish_create_counter_rules: ip6tables -A natctrl_tether_counters -i rmnet0 -o bridge0 -m quota2 --name rmnet0_bridge0 --grow -j RETURN
D/radish (11503): radish_create_forward_rules: ip6tables -A natctrl_FORWARD -i rmnet0 -o bridge0 -m state --state ESTABLISHED,RELATED -g natctrl_tether_counters
D/radish (11503): radish_create_forward_rules: ip6tables -A natctrl_FORWARD -i bridge0 -o rmnet0 -g natctrl_tether_counters
D/Tethering( 1027): [Tethering] Station Num = 0
D/WifiStateMachine( 1027): processMsg: TetheredState

My shell script is as simple as:

#!/bin/sh
sqlite3 "/data/data/com.android.providers.settings/databases/settings.db" "INSERT INTO global(name,value) VALUES('tether_dun_required',0)"

It is executed by tasker before the Hotspot is turned on.

I'll poke around some more tomorrow.

EDIT: At some point today I tested the tethering and it was working on my laptop. I'm certain I saw the APN being used was fast as type = mobile. When I tried to use the hotspot in the car, it didn't work so I fell back on WiFi Tether Router. Now that I'm home I notice that tethering is enabled, but the IPV4 portion is broken. I can get to IPV6 hosts on my computer through the tether, IPV4 DNS works (and I actually get the T-Mobile DNS entries:

Name: google.com
Address 1: 2607:f8b0:4005:800::1006 nuq05s01-in-x06.1e100.net
Address 2: 208.54.5.52 m340536d0.tmodns.net
Address 3: 208.54.5.59 m3b0536d0.tmodns.net
Address 4: 208.54.5.50 m320536d0.tmodns.net
Address 5: 208.54.5.53 m350536d0.tmodns.net
Address 6: 208.54.5.58 m3a0536d0.tmodns.net
Address 7: 208.54.5.51 m330536d0.tmodns.net
Address 8: 208.54.5.57 m390536d0.tmodns.net
Address 9: 208.54.5.56 m380536d0.tmodns.net
Address 10: 208.54.5.48 m300536d0.tmodns.net
Address 11: 208.54.5.54 m360536d0.tmodns.net
Address 12: 208.54.5.55 m370536d0.tmodns.net
Address 13: 208.54.5.49 m310536d0.tmodns.net

So something is not getting started properly when using the Tasker process to get IPV4 tethering to work properly. Back to the drawing board.

I was looking at the java/smali code for tethering and I wasn't understanding it very well. Anyone more familiar with this, let me know, and I can show you what I have.