A lot of people seem to want to change their mobile browser’s User Agent header. The subject comes up all the time on the Opera Mini MyOpera forum. The complaint is always the same, some web site is redirecting Opera Mini users to a limited mobile version of the site when the user wants the full site. This happens because every browser sends a User Agent header which identifies it. Web developers often use the User Agent to direct browsers to what the developer believes is the most appropriate version of the site’s content. Well designed sites offer a Full Site link on their mobile pages to allow users to override the browser detection if desired but many sites do not.
You can see your browser’s User Agent by visiting ua.yeswap.com. Bolt 2.0’s normal User Agent is:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; BOLT/2.001) AppleWebKit/530+ (KHTML, like Gecko) Version/4.0 Safari/530.17
While their isn’t any way to change Opera Mini’s user agent, it quite easy to change Bolt’s. If you want to impersonate a desktop browser like Firefox, for example, download Bolt to your PC using that browser. To download Bolt with a PC you have to visit boltbrowser.com/betadownload.html and fill out a web form that asks for your name and email address. As soon as you submit the form you should get an email containing download links for all the various signed and unsigned versions of Bolt. Download any version of Bolt and side-load it on your phone using your something like Nokia’s PC Suite or Bluetooth. When you need to have Bolt impersonate Firefox, go into Bolt’s Preference menu and select “Mobile Layout”
This works because when you download Bolt, the User Agent of the browser you use for downloading gets stored in the Bolt jad file. Normally Bolt is downloaded with a phone browser so its user agent is stored in the jad. When you switch to Mobile Layout Bolt uses the User Agent in the jad file instead of its own which makes requests coming from Bolt look like they came from the native phone browser.
If you want to impersonate a different browser, edit the jad file on your PC and change the last line which starts with “BOLT-UA: “. When I downloaded Bolt with Firefox the last line of the jad file was:
BOLT-UA: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 GTB6
Changing it to:
BOLT-UA: Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A400 Safari/528.16
causes Bolt to impersonate an iPhone when Mobile Layout is selected. With the iPhone User Agent sites will give you their iPhone version instead of the desktop or mobile one. This is a fun hack that sounds cooler than it actually is because most iPhone sites don’t look or work all that great with Bolt. The screenshot above shows Bolt reporting the iPhone User Agent at ua.yeswap.com.
What if u are doing it on a java phone?
I don’t understand your question. This post is about Bolt for Java phones so you will always be “doing it on a java phone”
Plz change my certificate
Sorry, I don’t know how to do that.
how can i edit a jad file on my PC?
Wordpad works, or you can use any text editor like Textpad, Notepad++, Notetab Lite. Avoid Windows Notepad as it will run all the lines together making editing difficult.
there is a new version of the beta . Can.t see any change, better caching?
Another problem with opera mini is that the certificated jad is something of a mess – ie the info and the certs are sort of mixed together – this possibly a security precaution but it makes it difficult for basic and mid range phones to read. For instance, I can install Bolts dual certificated browser in my mid-range wp-s1 amoi but not om. However, even if I ‘tidy up’ oms’ jad it still won’t install – possibly because it breaches the said security? I feel a bug report coming on!
Modifying the jad doesn’t break security as there’s no checksum on it.
Thanks for the info – I know something about Nokia’s but I didn’t know about the checksum in the certs – though I should have realised it. About opera minis’ user agent _ I noticed the jad doesn’t supply one nor is there one in the manifest, so I wonder how it supplies it – possibly on install? And, if one add-ended a ua to the jad, would that work? One wonders!
I believe Opera Mini’s user agent is added by the server, so there’s no way for a user to change it.
Sorry, to make my experiment clear: I have installed one instance of Bolt with the Nexus One ua. I then edited the jar of a second Bolt to be named ‘Bolt iphone’, edited a signed jad with the said name and adjusted jar size and tried to install that alongside the first bolt but it said ‘authentication failed’, I tried different solutions but the only one so far that has succeeded is this:
re-edit the manifest.mf as before ( you can use 7zip without unpacking ), re-edit the jad, including the new jar size, delete all certificates, save and install. You then have two (or more) instances of bolt with different user agents, unfortunately, only one of which is signed.
Sorry for the longueurs, Dennis – maybe someone could solve the signing issue?
The signature, which is stored in the jad, contains an encrypted checksum based on the contents of the jar. If you modify the jar the checksum is no longer correct and the signed app validation fails.
The solution would be to re-sign the app after changing the jar. To do that would need a Verisign or Thawte code signing certificate, which requires verification as business developing Java apps costs about $500.
There are ways around this on some phones. Most older Symbian phones and certain older Motorola GSM and Motorola and Samasung CDMA feature phones can be hacked to treat unsigned apps as though they were signed. On some Sony Ericsson phones you can install a Halmer root certificate and then sign the app with a Halmer code signing certificate. The Halmer certificates are free.
Forgot to say, you must adjust jar-size in the (unsigned) jad but this still doesn’t help with signed jads – must be something to do with the certificates?
Yes and no. I managed to install jar only renamed Bolt iphone, with iphone ua, but can’t use (signed) jad – say’s authentication failed! Still, now have two instance of Bolt, a nexus one ua signed and an iphone ua, unsigned. Useful!?
Actually, I’ve just thought, if one renames the bolt.jar in the manner of om 4.2, one could have multiple instances with different user agents of bolt, no?!
That should work.
Thanks for the tip, Dennis. I’m trying out the nexus one ua in bolt, which is:
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
And it seems to show some sites better than iphone ua, even though everyone (ie Americans!) is designing for that damned phone!
Ya, its a nice way to get site as you like. Thanks for this.
We always do this change UA in UC browser.
Article above makes perfect sense, but im really only leaving a comment here becuase I wanted to say well played on your portal list. Ive been wondering if anyone would ever go ahead and list a decent amount of portals out there, and then I find this with 2d barcodes attached! Ill be using this one! thanks to you guys for the great job!