[Solved] OnePlus 5 Oreo OOS 5.0.2 User Agent mismatch - OnePlus 5 Questions & Answers

I have been having issues with authentication on a bunch of different sites that use the user agent string for verification that the same device is being used (to prevent session hijacking).
On a regular page load the user agent sent is:
'Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A5000 Build/OPR6.170623.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36'
On Ajax post, the user agent sent is (notice the ONEPLUS A5000 is missing from the user agent):
'Mozilla/5.0 (Linux; Android 8.0.0; Build/OPR6.170623.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36'
The bug has been reported on the OnePlus 3, but doesn't have any acknowledgement from OnePlus:
https://forums.oneplus.net/threads/...different-when-making-an-post-request.691815/
These stack overflow questions also pertain to the same issue:
https://stackoverflow.com/questions...ent-to-sent-user-agent-when-requesting-websit
https://stackoverflow.com/questions/48596702/oneplus-chrome-different-user-agent-on-ajax
With a rooted OnePlus 5, how would I go about fixing this myself? I work in web development and this is preventing me from properly debugging/testing our in-house product that we sell, as well as causing all sorts of other login issues on other sites.

I was able to get this working by modifying the script on this thread with the user agent sent during the Ajax requests (without the ONEPLUS A5000):
https://forum.xda-developers.com/android/help/google-chrome-user-agent-android-7-x-t3517157/

Related

Desktop browsing instead of android mobile

Tired of the about:debug hopefully a fix is coming soon....
Sent from my Xoom using XDA App
TheWh0leTruth said:
Tired of the about:debug hopefully a fix is coming soon....
Sent from my Xoom using XDA App
Click to expand...
Click to collapse
From what I understand its up to the developers of websites to differentiate between "Android" which is tablets, and "Android Mobile" which is phones.
Dolphin is the bees knees on my xoom I love the side to side features... all ready uninstalled the stock browser
Sent from my Xoom using XDA App
martonikaj said:
From what I understand its up to the developers of websites to differentiate between "Android" which is tablets, and "Android Mobile" which is phones.
Click to expand...
Click to collapse
You are correct, but isn't that a little ridiculous? I mean the other browsers deliver us a desktop experience with no problem. I guess I understand the desire for the browser to be recognized as Android-specific, but relying on websites to change their code ultimately results in a less-than-ideal experience for the user. I don't know what a website's motivation would be to change their code. From their standpoint, I think it would seem like we are expecting them to make changes so that our substandard app will work. The websites will probably catch up, but meanwhile, shouldn't the stock browser be able to bring us as satisfying an experience as a third party app does?
nbowes said:
The websites will probably catch up, but meanwhile, shouldn't the stock browser be able to bring us as satisfying an experience as a third party app does?
Click to expand...
Click to collapse
The websites would never catch up if that was the case. Right now the best way to deal with it is write to page owner that have this problem and complain.
Why not just change the user agent? Am I missing something?
Sent from my Nexus One using XDA App
Magnesus said:
The websites would never catch up if that was the case. Right now the best way to deal with it is write to page owner that have this problem and complain.
Click to expand...
Click to collapse
You make a very good point here. And I guess the sites in question are actually the better sites that redirect a user to alternative content (low-res video or non-Flash pages) based on the browser's signature. Since they already consider that, they may be more likely to respond to user requests and feedback and change their code. Our browser type should begin to show up in their web traffic reports, too. But I think it'll be a slow-going change because in the whole lineup of browsers, we're a minority. Personally, I'll be more apt to open Dolphin to view a page that isn't displaying in desktop mode, long before I would hunt down a webmaster email address and send a note. I'm not even sure exactly what to ask for in the note. If anybody would care to provide a post with some proper terminology, that might help the cause.
ChongoDroid said:
Why not just change the user agent? Am I missing something?
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
As I understand it, we can select "desktop" as our user agent, but that identifies our browser as "android" which a lot of sites interpret as "android mobile" and redirect us to mobile content anyway. I have also read where some folks can't get the setting to stick through a reboot.
nbowes said:
You make a very good point here. And I guess the sites in question are actually the better sites that redirect a user to alternative content (low-res video or non-Flash pages) based on the browser's signature. Since they already consider that, they may be more likely to respond to user requests and feedback and change their code. Our browser type should begin to show up in their web traffic reports, too. But I think it'll be a slow-going change because in the whole lineup of browsers, we're a minority. Personally, I'll be more apt to open Dolphin to view a page that isn't displaying in desktop mode, long before I would hunt down a webmaster email address and send a note. I'm not even sure exactly what to ask for in the note. If anybody would care to provide a post with some proper terminology, that might help the cause.
As I understand it, we can select "desktop" as our user agent, but that identifies our browser as "android" which a lot of sites interpret as "android mobile" and redirect us to mobile content anyway. I have also read where some folks can't get the setting to stick through a reboot.
Click to expand...
Click to collapse
Desktop is not android. Android is android just like iPhone emulates an iPhone... about:debug or dolphin browser? Cmon
Sent from my Nexus One using XDA App
ChongoDroid said:
Desktop is not android. Android is android just like iPhone emulates an iPhone... about:debug or dolphin browser? Cmon
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
When I select "desktop" in the stock browser, it gives me a very different experience than when I select it in another browser, such as Dolphin. I am under the impression that selecting "android" would tell a website that I am on an android phone, and it would render the mobile version of the site. I don't want that, so I selected "desktop" but still often get directed to mobile versions of sites. I thought I read that the reason for this is that selecting "desktop" identifies the browser as "android"...as opposed to "android mobile." I guess sites aren't coded to recognize "android" as being different than "android mobile" and render the mobile version.
The suggestion has been to notify site owners of the problem and ask them to update their code. I think to do that effectively, I need to fully understand the issue, and I'm sorry but your reply didn't help me with that.
Android user agent is for tablets. Desktop is for desktop. Not many sites are setup to render pages for a tablet that's why you get the mobile version when set to android.
Sent from my Xoom using XDA App
But...I'm getting mobile versions when I'm set to desktop.
Thank you for your replies. I think Chongo has made a pretty solid case for the Dolphin browser.
Dolphin is one of the best alternative.
I am using the Dolphin Mini on my Nexus S just because of this user-agent issue, plus tabbed browsing, quick bookmarks, etc.
It is not as fast as the stock one, but the speed is still fast enough to enjoy the experience.
I read that Dolphin is still not good enough on Honeycomb. They have updated it, but still choppy.
We can hope that the developers are hard work to bring it up to speed with Honeycomb, better stability, faster with hardware acceleration. Certainly, this will be realized quickly as I read Google developer posted detailed information about hardware acceleration on Honeycomb:
http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html
nbowes said:
But...I'm getting mobile versions when I'm set to desktop.
Thank you for your replies. I think Chongo has made a pretty solid case for the Dolphin browser.
Click to expand...
Click to collapse
Btw, anyone can really catch the stock browser user agent string?
I am interested to know "exactly", the exact string text, what is the user agent string of the stock browser, default setting and when set to desktop via about:debug.
And also from the Dolphin set to "desktop".
Thanks if you can do this for us.
nbowes said:
But...I'm getting mobile versions when I'm set to desktop.
Thank you for your replies. I think Chongo has made a pretty solid case for the Dolphin browser.
Click to expand...
Click to collapse
You need to type ' about:debug' every time you reboot and in some cases after clearing your browsing history or after the browser stops. In other words, 'about:debug' does not stick. But your settings are remembered, so you won't have to keep changing your user agent, you'll just need to keep typing 'about:debug' in your address bar. The easier way to tell if you're still in debug mode is by clicking the menu icon and seeing if you have expanded options or not.
Sent from my PC36100 using XDA App
gogol said:
Btw, anyone can really catch the stock browser user agent string?
I am interested to know "exactly", the exact string text, what is the user agent string of the stock browser, default setting and when set to desktop via about:debug.
And also from the Dolphin set to "desktop".
Thanks if you can do this for us.
Click to expand...
Click to collapse
http://my-addr.com/ua
For me, Safari is listed when in both desktop and android mode. When in android mode, platform shows as unknown.
With Dolphin in desktop mode, the agent is Chrome and the platform is Win7.
I don't have Xoom, so I cannot test that
But, I tested using my Nexus S, and here is the result:
Dolphin in Android mode:
Browser name: Default Browser
Platform: unknown
Operating System: Linux, Smart Move!!!
User Agent: Safari
Dolphin in desktop mode:
Browser branch name: Safari 3.1
Browser name: Safari
Browser version: 3.1
Platform: MacOSX
Operating System: Mac OS X
User Agent: Safari
Stock browser in Android (default) mode:
Browser name: Default Browser
Platform: unknown
Operating System: Linux, Smart Move!!!
User Agent: Safari
Stock browser in desktop mode:
Browser branch name: Safari 5.0
Browser name: Safari
Browser version: 5.0
Platform: MacOSX
Operating System: Mac OS X
User Agent: Safari
They are all using "Safari", no word "Android" mentioned.
nbowes said:
http://my-addr.com/ua
For me, Safari is listed when in both desktop and android mode. When in android mode, platform shows as unknown.
With Dolphin in desktop mode, the agent is Chrome and the platform is Win7.
Click to expand...
Click to collapse
One good thing about being automatically sent to the mobile version of a site?
Gizmodo.com
The mobile site is vanilla and plain but DAMN it's better to look at than that new mess of a website they've put up the last couple of months.
/rant
I think the issue here is why can't the Stock browser settings stick when you change the user agent. Dolphin seems to work perfectly fine after rebooting or after a browser crash. If the Stock browser did the same thing, after changing it to desktop, I don't think anyone would have an issue.
FYI Google addressed why this happens in their Android Blog:
http://android-developers.blogspot.com/2010/12/android-browser-user-agent-issues.html
Basically, the browser reports itself as Android, but not Android Mobile (as someone else suggested).
Websites currently sense if you are using Android and assume its a phone (because it always used to be), but now they should key of the word "Mobile" instead.
This does have drawbacks, but from an engineering perspective, it is the "correct" way to do it. Hacking the user agent is bad practice - its important for web admins to know if a lot of tablets are accessing their website, for example, so they can make sure the site works well for them. If Google set it to spoof a windows desktop, web admins would never know how many tablets were being used, and may be serving their users with a less than optimal page for tablets without realizing it.
So it will take some time for web admins to fix their sites, but unfortunately, this is the right way to do it. It would be great though if the about:debug settings were sticky. It might be bad practice for Google to design the tablet to spoof the user agent, but its fine if an individual user decides to.
-Taylor
It seems like the best option is to complain to webmasters who do not allow the option of leaving mobile mode on their sites.
If the option to view either mobile or full site is given then there is no need to spoof the user agent and the device would be properly tracked by whatever software the host is using. We need to complain more to the web admins if we will ever see the compatability that the ipad users currently have when browsing the web. At the same time the web admins need to know that enough of our devices are out there before they will see a need to create an alternative browsing experience. This is why I am against changing the user agent.
Edit: Perhaps Google had the same thought in mind and this is the reason the user agent setting does not hold after a reboot.
Sent from my Nexus One using XDA Premium App

Force websites to display Desktop Version

Call it a flaw or a design feature, but at this time Google, in Gingerbread, has not given us a robust way to confidently browse in Full site desktop mode as they did with the Mobile View settings option in earlier versions of Android. You can root your device and permanently alter the User Agent string, but if you don't want to root you are left with the about:debug work around but that solution has flaws.
It requires the user to put the browser into debug mode.
It does not survive a browser restart.
Now there is some debate as to whether the browser restart issue is a design feature or a bug, but getting into these types of debates is like trying to teach a pig to sing. It wastes your time and annoys the pig.
Until a permanent solution is found, there is another option. Use HTML switches to force the browser into full screen mode.
Most web sights that are aware of and serve platform specific content to mobile devices have a switch that can be used in the address to force a desktop presentation. Often this is not publicized or even visible through any direct link, but with a little digging you can work it out.
My web surfing patterns are not complex. Except the occasional random browsing, I seem to visit the same pages day after day. The trick is to find the switch required to force those mobile aware web sights to always serve you a desktop version.
I have 45 bookmarks set on my Xoom I only have problems with 10 of them, and have found solutions to 8. The holdouts are CNETTV and Chase
Starting in post #2 are the switches I have found that work for the sights I visit. I will continue to add to this list as I find others, or as others are provided to the thread in user posts. You'll find most web sights are not built from scratch from either native HTML, JAVA, VC++, C#, or asp, but are built from publishing packages like VBulletin which have common code conventions. As I find conventions that work, I use trial and error on a new problematic sight until I have found the right switch for that site.
Look at what has worked below and try to find others and share. . . . Happy Hunting.
P.S. if you're curious to what user agent string is being sent go to WhatsMyUserAgent. Here are the User Agent (UAString) returns reported by WhatsMyUserAgent on the Xoom by manipulation of the UAString selection within the Debug applet. Is "applet" what you call it in Android?
User Agent (UAString) when the browser is first loaded into memory:
Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13
Android selected as the User Agent (UAString):
Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13
Desktop selected as the User Agent (UAString):
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16
iPhone selected as the User Agent (UAString):
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
iPad selected as the User Agent (UAString):
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10
Froyo-N1 selected as the User Agent (UAString):
Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Google
http://www.google.com/webhp?hl=en&output=html&nomo=1
Yahoo News
http://news.yahoo.com/?desktop_view_default=true
Engadget
http://www.engadget.com/?m=false
Pocket Now
http://pocketnow.com/?mode=desktop
CNET
http://www.cnet.com/?qwr=FullSite
Business Insider
http://www.businessinsider.com/?unmobile=true
Wells Fargo Bank
https://www.wellsfargo.com/?fullsite=mba
Bank of America
https://www.bankofamerica.com/homepage/overview.go?MobileRedirect=false
Accursed Farms
http://www.accursedfarms.com/?m=false
Amazon
http://www.amazon.com/?force-full-site=1
Motorcyclist Magazine
http://www.motorcyclistonline.com/index.html?fullsite=true
Best Buy
http://www.bestbuy.com/?redirect=no
CBS
http://www.cbs.com/?nm=true
IMDB
www.imdb.com/?mode=desktop
RESERVED for future expansion
Thanks for the information! This, whether a design flaw, or a bug, is most definitely annoying. Hopefully there will be a permanent fix shortly.
There are a few permanent options if you have root. The simplest is to just change the default User Agent string in framework-res.apk, which is what I did.
sangreal06 said:
There are a few permanent options if you have root. The simplest is to just change the default User Agent string in framework-res.apk, which is what I did.
Click to expand...
Click to collapse
Could you please post how you did this?
Interesting ... How did you do it?
Please if you can explain in detail
sangreal06 said:
There are a few permanent options if you have root. The simplest is to just change the default User Agent string in framework-res.apk, which is what I did.
Click to expand...
Click to collapse
Instien said:
Thanks for the information! This, whether a design flaw, or a bug, is most definitely annoying. Hopefully there will be a permanent fix shortly.
Click to expand...
Click to collapse
There is nothing to fix, the UA string correctly says 'Android' in it. Its the fault of web designers assuming all android devices are phones.
Sent from my Xoom using XDA Premium App
Bauxite said:
There is nothing to fix, the UA string correctly says 'Android' in it. Its the fault of web designers assuming all android devices are phones.
Sent from my Xoom using XDA Premium App
Click to expand...
Click to collapse
So the fix is to start contacting web sites and pointing to Google's UA information in hopes that this is fixed server side. Does anyone have a link to UA definitions to be forwarded with the request? Or is this something that Google really needs to get out?
The Dolphin HD 4.5 browser lets you set various 'User Agent' types. I've had it crash at times, the icons/buttons are not 'optimized' for a tablet, but for the most part I'm happy with it...and I'm not rooted
Gorgonesh said:
So the fix is to start contacting web sites and pointing to Google's UA information in hopes that this is fixed server side. Does anyone have a link to UA definitions to be forwarded with the request? Or is this something that Google really needs to get out?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=12391549&postcount=23
--that's a suggested Email to send to website owners asking them to adjust their code to recognize "android" as a tablet capable of a desktop experience rather than relegating it to a mobile experience.
Also, for the OP:
Yahoo News
http://news.yahoo.com/?desktop_view_default=true
I think your idea of using these HTML directs is a good one, because that allows us to leave our browser agent settings intact--important because web owners need to see the increased number of Android tablets accessing their site in their traffic reports before they will feel motivated to accommodate them. If we are spoofing other browsers, the true nature of our devices won't be well represented in the traffic reports.
Bauxite said:
There is nothing to fix, the UA string correctly says 'Android' in it. Its the fault of web designers assuming all android devices are phones.
Sent from my Xoom using XDA Premium App
Click to expand...
Click to collapse
Actually it is not that they are assuming all Android are mobile. It's that they are assuming all Android phones are Mobile Safari instead of parsing the entire User Agent string. See the extractions in post 1. When we select 'Desktop' we are spoofing User Agent to report us as a Mac desktop. In Android 1.6 to 2.2 this spoofing could be made permanent by de-selecting 'Mobile View' in the browser settings.
Thanks for the information. I was getting to return my xoom because of this.
I started doing this (the OP's suggestion) a while back. Some sites are more difficult than others, but I've found the correct settings for the sites I frequent on the Xoom. Like the OP, my web browsing is fairly predictable, so it hasn't been a huge issue for me.
Here's another one:
IMDB
www.imdb.com/?mode=desktop
I was just gonna say... why not use Dolphin HD ...
MitchRapp said:
I was just gonna say... why not use Dolphin HD ...
Click to expand...
Click to collapse
Dolphin is an option, and it doesn't have the User Agent issue. I'm experimenting with Dolphin HD now and things look promising. The last time I tried Dolphin, about a month ago, it crashed constantly. I researched it today and found that in the last few weeks they have done several updates specifically to address the stability of the browser on the Xoom. It looks like they may have made good progress.
None the less the option presented by this thread is option to those who choose to continue with the stock Android browser.
I use firefox for sites with that issue. It has an add on, Phony, that allows you to change the user agent in the browser settings. Flash seems to be hit or miss though.
Sent from my Evo running myn's masterpiece
I use Skyfire, which has the toggle button at the top to easily switch between desktop and mobile view.
Just use Dolphin mini..it never force closes on me.You can set it to desktop too
Sent from my DROIDX using XDA App
From Motorola's web support:
Change default settings to view full web sites instead of mobile view
•In the browser address bar type "about:debug" without quotes.
•Click the browser's settings button in the upper right.
•Click settings.
•Click Debug.
•Click UAString and select Desktop, then back out to the browser.
Sites that you visit will now think you are a desktop. Change it back to Android for the normal experience.

Did T-Mo just catch me tethering?

I've just experienced something that's never happened in the last 8 months I've had T-Mobile. I have always used wifi tethering off and on every month, but never extensively. I've also never gone over 5gb of data in a month. This last billing cycle (ended yesterday) I nearly hit 5gb and tethered more than usual because I moved (no home net) and went on vacation (no wifi). Just a few minutes ago, after restarting my phone, my laptops browser redirected to a FAQ/Info page about adding wifi tethering to my plan. Opening the phones browser does the same. Even after rebooting etc., the phone browser always redirects...
I'm on CM7 nightlies, and have only tethered a few times on any type of stock ROM.
What the heck is going on? Did they really just find this out or do they spam people with this when they push 5gb in a month? Can I call and tell them this is an error? How will they look into this? Surely they can't actually know, especially on a custom ROM...
I would include screenshots but the xda app doesn't like png's apparently.
edit: here's a screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
martonikaj said:
What the heck is going on? Did they really just find this out or do they spam people with this when they push 5gb in a month? Can I call and tell them this is an error? How will they look into this? Surely they can't actually know, especially on a custom ROM...
Click to expand...
Click to collapse
Why would you think that? From what I understand, all the data packets being sent over the network are tagged differently when tethering, and its pretty easy for a carrier to tell when you do it. Rooted or custom ROM makes no difference.
redpoint73 said:
Why would you think that? From what I understand, all the data packets being sent over the network are tagged differently when tethering, and its pretty easy for a carrier to tell when you do it. Rooted or custom ROM makes no difference.
Click to expand...
Click to collapse
How could they tell though? Its not a T-mo proprietary tethering app, there's no tagging being done. Its just data.
Time to start https'ing everything ?
ohgood said:
Time to start https'ing everything ?
Click to expand...
Click to collapse
I guess so. Idk.
Other threads I found about this situation were quite old, and from the ones I saw they stopped spamming you with redirects after a day or so. I'm gonna wait it out a few days and if they don't stop I'm going to call them. My understanding is that they can't determine between tethered packets and just phone packets.
My personal feeling at this moment is they're spamming me with redirects because I hit like 4.95gb last month and I usually only do 2-3gb.
iirc, tethering and wifi-sharing is included with the data plan.
eneka said:
iirc, tethering and wifi-sharing is included with the data plan.
Click to expand...
Click to collapse
well they don't require you to get the plan in order to "unlock" the wifi tethering app like AT&T and Verizon do, but they DO offer a Tethering plan to buy.
Please my son, you are not that special that T-mobile would be able to spot your data packets out of the millions of users. It is something else. I would just call and say what's up.
Sent from my HTC Vision using xda premium
GetTargetedFans said:
Please my son, you are not that special that T-mobile would be able to spot your data packets out of the millions of users. It is something else. I would just call and say what's up.
Click to expand...
Click to collapse
That's my point. Why the hell would they ever take the time to solo out someone using 5gb data one month...
martonikaj said:
well they don't require you to get the plan in order to "unlock" the wifi tethering app like AT&T and Verizon do, but they DO offer a Tethering plan to buy.
Click to expand...
Click to collapse
from what i'm seeing, tethering and wifi-sharing seems to be included if you have a data plan that is $20+
http://support.t-mobile.com/docs/DOC-2384
edit:their info seems to be a bit confusing. I've tethered quite extensively and even went over the 5gig limit before. Try calling customer and see what they say? maybe it's a system error.
eneka said:
from what i'm seeing, tethering and wifi-sharing seems to be included if you have a data plan that is $20+
http://support.t-mobile.com/docs/DOC-2384
Click to expand...
Click to collapse
"Your account needs to have a Web add-on feature of $19.95 or higher to use Tethering and Wi-Fi Sharing."
I think this means that in order to add on a tethering plan, you need to have a plan of at least that price. Aka no tethering on a non-smartphone 250mb plan or something.
Why not try HoFo's T-mo section. They probably have some employees or ex-csa's there who can answer your question.
They use the browser agent to know if you're on a computer or not.
The best way to bypass this crappy system is to use a vpn solution.
You may try http://hotspotshield.com/, but I don't know if they patch the 64 bits problem (if you're on a Mac or on 32 bits it will works).
Maybe http://ultrasurf.us/ can help you too.
Max) said:
They use the browser agent to know if you're on a computer or not.
The best way to bypass this crappy system is to use a vpn solution.
You may try http://hotspotshield.com/, but I don't know if they patch the 64 bits problem (if you're on a Mac or on 32 bits it will works).
Maybe http://ultrasurf.us/ can help you too.
Click to expand...
Click to collapse
Yep it looks like that's whats happening. I changed my UA on my phone back to "android" and I stopped getting redirects on the phone. Still getting redirects if I tether to the laptop, of course.
This is absolutely ridiculous. Any mobile browser lets you change the UA string, checking UA doesn't mean that you are tethering. I'm going to give them a call and get them to drop this crap.
martonikaj said:
Yep it looks like that's whats happening. I changed my UA on my phone back to "android" and I stopped getting redirects on the phone. Still getting redirects if I tether to the laptop, of course.
This is absolutely ridiculous. Any mobile browser lets you change the UA string, checking UA doesn't mean that you are tethering. I'm going to give them a call and get them to drop this crap.
Click to expand...
Click to collapse
But try what I said for the tether on your computer (ultra surf or hotspot shield). I'm pretty sure they don't filter those VPN (then, once you're connected, they canno't see what you're doing).
On your Android Phone, you may want to try the orbot network.
Max) said:
But try what I said for the tether on your computer (ultra surf or hotspot shield). I'm pretty sure they don't filter those VPN (then, once you're connected, they canno't see what you're doing).
On your Android Phone, you may want to try the orbot network.
Click to expand...
Click to collapse
I've used orbot, and I'm very familiar with computer-side VPN solutions. Not really necessary considering T-mobile can't prove that I'm doing anything wrong when they simply filter based on my UA string.
I realize I could do this, but I think they're unnecessary hoops to jump through when I shouldn't be targeted in the first place.
Got an update for you guys.
I just spent about a half hour on the phone with a very nice CS rep at T-mobile. After going through the usual "did you reset your phone?" and all that jazz, and a few times being put on hold, she literally said she has never heard of this happening, and neither had her manager.
I've been instructed to get the URL that I'm being directed to, my IMEI number, and a few other things so that I can open up some form of advanced ticket with them when they call me tomorrow.
I've restored back to my stock rooted 2.3.4 build, and I'm having trouble getting it to do the same thing that it does when on CM7. Even on Firefox and Dolphin HD, which allow for UA switching to "desktop", I'm not getting redirects. I do still get them, however, when tethering from stock 2.3.4 to my MacBook in both Chrome and Firefox, but not in Safari...
So at this point I get redirects on the phone in CM7 with the UAstring "desktop"; and on the computer tethered using Chrome and Firefox.
I've got all the time in the world to fix this. I know that they can't tell I'm tethering, and they're only checking for UAstring and blocking those pages from loading. I'm not doing anything wrong by switching the UAstring on my browser. Just gotta keep on pushing them till they take this off my account.
It's been my understanding (both with the stuff you reported in this thread and in threads previously--both here and on other fora) that T-Mobile normally uses the User-Agent field in browsers to determine whether tethering is occuring.
More about this than you ever wanted to know:
Most browsers (Firefox and Chrome, for example) will send a User-Agent string to an HTTP host so that the host can send a version friendly towards that browser--this is used primarily for two things anymore, either:
a) Sending mobile-friendly webpages (used to be strictly for WAP back in the Bad Old Days, now it's mostly used for iPhone and Android-friendly pages)
b) Sending "IE6 friendly" pages to corporate users with ancient browsers
Where one gets into trouble with tethering on T-Mobile (and how T-Mobile can sniff this out)--your browser on your phone and the browser on the PC (as you discovered) send out different User-Agent strings. The site http://whatsmyuseragent.com/ actually is VERY useful for showing what's going on...
The User-Agent string on a PC is usually pretty blatant and flags it as a PC. For example, on Firefox on my PC (a WinXP box), the default User-Agent shows as "Mozilla/5.0 (Windows NT 5.1; rv:6.0.1) Gecko/20100101 Firefox/6.0.1", for instance; Safari on MacOS X identifies as "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.32011-09-04 01:38:54"; Opera for WinXP identifies as "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.7.62 Version/11.00"; and Chrome for WinXP identifies as "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127 Safari/534.16". (That Chrome one is going to be especially useful to us in a bit. )
Not surprisingly, most browsers for Android EXPLICITLY flag as being Android-specific; Dolphin HD sends its default User-Agent as "Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRJ40) AppleWebKit/533.1 (KHTML, like Gecho) Version/4.0 Mobile Safari/533.1" whilst the standard browser identifies identically--basically, the User-Agent identifies not only that you're using an Android phone but specific OS version (in my case, ILWT CW7) and apparently calls for iPhone-friendly pages (Mobile Safari and AppleWebKit flag for iPhone-friendly pages as Mobile Safari is the default browser for iPhone).
(And for direct comparison with the iPhone itself: its default User-Agent is "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16".)
Of note--as you've probably seen--the default User-Agent string for Androids is almost identical to that of Chrome--there's a reason for this; the default browser on Android phones is basically a mobile version of Chrome. This also makes User-Agent particularly easy to fix if you're using Chrome as a browser on your PC
This is also why VPN works (it obfuscates the connection altogether so that T-Mobile's servers can't sniff an offending User-Agent). It's pretty obvious that T-Mobile is sniffing for "foreign User-Agents" in determining whether tethering is taking place
For at least Firefox and Chrome, there are ways to change the User-Agent on the PC itself that have been reported to work to defeat "tethering blocks". On Chrome you can literally create a shortcut with a startup option to use whatever user agent you want (details at http://knol.google.com/k/warren-l/google-chrome-change-user-agent-to).
With Firefox, the relevant extension for Firefox is User Agent Switcher (https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/) which allows you to enter a custom User-Agent. Click on Tools/Default User Agent/Edit User Agents; click "New", use what I posted for the standard Android User-Agent and the existing iPhone User-Agent as templates for creating a new Android User-Agent.
Thanks for the info. Appreciate the big post. Going to look into changing the UA strings.
Won't changing the user agent in Chrome or Firefox (with an extension) then change my browsing experience when using those browsers on the computer? If I make the browser indicate to the websites I visit that I am on a mobile device, I'll start being served mobile views of pages...
Also, could you shed light on the reason why Safari works just fine on my laptop while tethering, right next to Firefox and Chrome which don't work? There must be some subtle things about it... or is T-mobile just not targeting Safari like they do Firefox and Chrome?
So I've downloaded that extension and created the custom user agent to make Firefox look like an iPhone browser. And as I expected I'm being served mobile versions of the sites.
So my real question is, can I create a user agent string that identifies the browser as mobile, but loads regular pages? As in... what Dolphin HD would do when you select "desktop" under the UA string settings? (I think I'll answer my own question in a minute...)
K, answered my own question. I loaded Dolphin HD on my phone, set the user agent in settings to "Desktop" then went to whatsmyuseragent.com and copied that to my "new user agent" I created on Firefox. Everything seems to be working fine...
its horribly annoying that I have to go with this. I REALLY prefer Chrome and wish there was a good extension to accomplish this on Chrome, but I guess I can deal with using Firefox when I tether. Still plan on talking to them tomorrow to get this flag off my account, but really glad I have something to fall back on.
+1,000,000 to you, good sir.
EDIT: Just as an aside, I found an extension for Chrome that does user agent switching: https://chrome.google.com/webstore/...kpdkbamkfgbofhgcj?hl=en-US&hc=search&hcp=main , but because of a lack of API-level support in Chrome, sites that use network-level user agent detection can see through the spoof. I checked it and it doesn't work properly in this case. Just a heads up for people
martonikaj said:
Thanks for the info. Appreciate the big post. Going to look into changing the UA strings.
Won't changing the user agent in Chrome or Firefox (with an extension) then change my browsing experience when using those browsers on the computer? If I make the browser indicate to the websites I visit that I am on a mobile device, I'll start being served mobile views of pages...
Click to expand...
Click to collapse
With a different user agent, it will optimise pages for mobile viewing--but IN PRACTICE this mostly means that unnecessary crap like Flash gets stripped (Javascript remains OK).
Also, could you shed light on the reason why Safari works just fine on my laptop while tethering, right next to Firefox and Chrome which don't work? There must be some subtle things about it... or is T-mobile just not targeting Safari like they do Firefox and Chrome?
Click to expand...
Click to collapse
One possible reason Safari might not be targeted--even with the "Mozilla/5.0" ID (which is so common even varieties of IE use it!), practically all mobile browsers identify as some variety of Safari or Safari-derivative (the iPhone notably so, but this also includes Chrome, the Android default browser, and Dolphin HD). It is entirely possible (depending on how smart or how dumb the sniffing T-Mobile does on HTTP GET requests is) that the software T-Mobile uses flags all "Safari"-labeled browsers as mobile browsers, possibly including Safari proper. (This isn't too far-fetched, as Mobile Safari is closer to Safari proper than (say) Pocket IE is to Internet Explorer or the Google default browser is to Chrome.)
A very interesting experiment, IMHO, to try would be to see if Opera Mobile is blocked as "tethering" and if it's possible to surf with the Windows version of Opera in tethering; Opera Mobile is (to my knowledge) the sole Android-based browser that does NOT identify as a Safari derivative. (Its User Agent, based on my G2 running ILWT CM7 185, is "Opera/9.80 (Android 2.3.5; Linux; Opera Mobi/ADR-1107051709; U; en) Presto/2.8.149 Version/11.10"; Opera 11.51 on WinXP identifies as "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.9.168 Version/11.51".
If Opera Mobile is blocked, it's a good indicator they're sniffing for the presence of "Safari" in the User-Agent somewhere--especially since Safari proper apparently makes it through.
If the "Desktop" mode of Dolphin HD makes it through, this pretty much proves they're filtering for "Safari"--it identifies as Safari for MacOS X Snow Leopard, as we'll see below. (This also makes workarounds MUCH easier.)
(One thing that would be helpful in this regard--hit http://whatsmyuseragent.com using Safari and cut and paste the User-Agent displayed. This would be VERY useful for comparison with existing iPhone and Android User-Agents, and could even be potentially used to make a custom User-Agent that mollifies T-Mobile but lets non-mobile content through.)
So I've downloaded that extension and created the custom user agent to make Firefox look like an iPhone browser. And as I expected I'm being served mobile versions of the sites.
So my real question is, can I create a user agent string that identifies the browser as mobile, but loads regular pages? As in... what Dolphin HD would do when you select "desktop" under the UA string settings? (I think I'll answer my own question in a minute...)
Click to expand...
Click to collapse
As you noted below , it should be possible--I'd probably suggest (since we know that Safari for Windows works) copying the User-Agent string from Windows Safari. (In fact, Dolphin's "Desktop" mode exactly clones the User-Agent from Safari for MacOS X "Snow Leopard" (10.6.x).)
K, answered my own question. I loaded Dolphin HD on my phone, set the user agent in settings to "Desktop" then went to whatsmyuseragent.com and copied that to my "new user agent" I created on Firefox. Everything seems to be working fine...
its horribly annoying that I have to go with this. I REALLY prefer Chrome and wish there was a good extension to accomplish this on Chrome, but I guess I can deal with using Firefox when I tether. Still plan on talking to them tomorrow to get this flag off my account, but really glad I have something to fall back on.
Click to expand...
Click to collapse
I'd say probably the ONE major kvetch I have about Chrome (as a browser) is that its APIs are very locked down--yes, I know, for purposes of security and all--but in a way that makes it less customisable where I'd LIKE it to be customisable
(A good example is how AdBlock Plus works on Firefox versus how AdBlock Plus works on Chrome. On Firefox, the extension works much more like a browser-specific host file or proxy, and prevents the adverts from even loading in the first place; Chrome's API doesn't allow this, and has to block the adverts AFTER loading them (basically comparing downloaded URLs to an internal blacklist). Not usually an issue with mere ad blocking, but if you use ad blocking software to prevent tracking (which I do) or to block known malware sites (which I do--I don't use the browser for pr0n or Illegal Activities but there have been notable cases where banner adverts on reputable sites have been compromised to send malware)...blocking after the fact is not as useful, alas.)
Probably the best way (if you're on Windows) to implement this sort of thing on Chrome is to copy your existing Chrome shortcut, rename it "Tethering Chrome", right-click and select "Properties", and add --user-agent="<user agent>" (with the stuff in brackets being whatever User Agent you want to use) to the "Target" section.
For example, the "Target" of my "tethering Chrome" shortcut would read something like "C:\Program Files\Google\Chrome\Application\chrome.exe" --useragent="Mozilla/5.0 (Macintosh; U; Intel MacOS X 10_6_3;en-us) AppleWebKit/155.16 (KHTML, like Gecko) Version/5.0 Safari/533.16" (the latter is the "Desktop" default User-Agent for Dolphin HD--which is also the EXACT User-Agent for the version of Safari shipping with MacOS X Snow Leopard).
As an aside, you can do this similarly in Linux, and PRESUMABLY in MacOS X (I don't muck with the latter too much, don't quote me on that).
+1,000,000 to you, good sir.
Click to expand...
Click to collapse
Glad to be useful now and again
EDIT: Just as an aside, I found an extension for Chrome that does user agent switching: https://chrome.google.com/webstore/...kpdkbamkfgbofhgcj?hl=en-US&hc=search&hcp=main , but because of a lack of API-level support in Chrome, sites that use network-level user agent detection can see through the spoof. I checked it and it doesn't work properly in this case. Just a heads up for people
Click to expand...
Click to collapse
Good on you to point that out (and that's part of why I didn't recommend extensions for Chrome--it's a wonderful browser that "just works", but its extensions are EXTREMELY sandboxed--for safety, but sometimes this breaks stuff like network-level user detection, preemptive ad-blocking (preventing the ads from downloading before being redacted from a website), etc. Different approaches between Chrome and Firefox as to how their extensions work--Firefox extensions will let you muck with the inner workings of the browser itself, but occasionally to one's detriment ; Chrome prefers sandboxed extensions which run safely but can't get "browser kernel access" when it needs it.
(A good parallel to how these work that is Very Relevant To Users' Interests here: Firefox's extension management works like a rooted phone, Chrome's like an unrooted stock G2 where system apps and network stuff are protected.)
The workaround (setting up an alternate shortcut to Chrome with an explicit user-agent defined on the command line) DOES seem to get around network detection (for things like testing browser functionality).

Getting apps without market via UserAgent spoof

Here's a trick that's work in progress.
Market doesn't work reliably I find. It loses my device and having it fully running seems to deplete the battery (?). It would be much nicer if we could just download the apk and push it over using `adb install foo.apk`.
Unfortunately most sites presume the ability to use a browser on the device and don't recognise Opera. Some try to use the browser agent ID to identify what device you have and use that to download, in the process trying to harvest a phone number or a email from you (probably which they later resell to spammers).
What we can do is pretend to be another 2.1 device. To do this:
Use user agent switcher for firefox.
And switch to the following user agents IDs:
http://www.gtrifonov.com/2011/04/15/google-android-user-agent-strings-2/
such as the Nexus:
Code:
Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
I haven't got it to work yet, is it javascript? You may have better luck on other sites. I've only tried AndroidZoom.
Let us know how you get on.
-j
Won't work. Android market only provides actual application files to the market application, which uses a series of encrypted authentications. You can't "spoof" it with a user-agent.
The only thing you CAN do with a browser, is BUY applications -- you still have to go through the market application to actually install them though.
Possibly another way could be using Android_x86 to grab a .ipk:
http://www.digital-car.co.uk/forum/showthread.php?12997-Android-Market-on-X86-Yay......
...or using virtualisation as that is x86 rather than arm

Samsung - Android 11 - java.net.UnknownHostException

Hi,
We have a rather large app but for some reason a sizeable amount of users on Samsung with Android 11 are getting java.net.UnknownHostException. For most people it helps with a reboot of their device but some users have to do a reinstall. It affects all domains so the app is unable to do any network calls.
Does anyone know of anything on a Samsung device on Android 11 that can restrict an app from reaching the network? I have such a phone myself but I can't see anywhere that it is possible to restrict access in such a way.
Due to an error we got removed from Google Play for 2 weeks but are back again now. I wonder if there is some security measures on Samsung that detected this and deemed the app unsafe maybe...? Sounds a bit far fetched but at this time I'm ready to believe anything.
Example from a log we got from a user:
Host: google.com
class java.net.UnknownHostException: [Unable to resolve host "google.com": No address associated with hostname].
https.nonProxyHosts=null
https.proxyHost=null
https.proxyPort=null
http.agent=Dalvik/2.1.0 (Linux; U; Android 11; SM-N975F Build/RP1A.200720.012)

Categories

Resources