I have a somewhat strange problem and trying to describe it.
Currently I am on stock ROM 9.1.0.132
I am using Outlook and O365. When I log in to O365 account, the webview sends the useragent:
Browser: Mozilla/5.0 (Linux; Android 12; ANE-LX1 Build/HUAWEIANE-L21; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/107.0.5304.105 Mobile Safari/537.36 PKeyAuth/1.0
If Android "9" or if HUAWEI is in the text of the useragent my company blocks the access.
Some time ago I was using an EMUI ROM greater than 9.1.0.132 and I was able to change the text entry "HUAWEIANE-L21" in one of the build.props
Android "9" I was able to change to "12" (ro.build.version.release=12).
In Stock ROM 9.1.0.132, unfortunately I can't find "HUAWEIANE-L21" in the biuld.props anymore and I don't remember how I changed it back then.
Can someone please look in the build.props in /system and /vendor at Stock ROM > 9.1.0.132
Or does anyone have a tip, where the webview takes the useragent information from.
I'm on Magisk root and i dont want to update > 9.1.0.132
I found the solution in Magisk Module MagiskHideProps. If this module installed, the default /system/build.props will ignored.
Set "ro.build.id" by MagiskHideProps command in terminal -> "props ro.build.id Samsung" (Usage: props NAME VALUE)
https://github.com/Magisk-Modules-Repo/MagiskHidePropsConf/blob/master/README.md
This will change the default "ro.build.id=HUAWEIANE-L21" to ""ro.build.id=Samsung"
Can check by "getprop | grep ro.build.id
UserAgent is changed now.
Related
Hope this is the right place to post this, but I wanted to know if I could get people to post their UI Strings from Various ROM's for a Web Development project I am working on.
Need:
Device:
Carrier:
ROM Name and Version:
UA String:
To get your UA String, just use your device and browse to: http://whatsmyuseragent.com/
You will see your User Agent at the top of the page, Copy/Paste that if you can.
Any help would be appreciated.
Mine:
Device: Nexus One (T-Mobile)
Carrier: T-Mobile
ROM Name and Version: Eclair 2.1-update1 Build ERE27
UA String: Mozilla/5.0 (Linux; U; Android 2.1-update1; en-us; Nexus One Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
Mines the default for CM506, there is an option to modify it.
HTTP_USER_AGENT:Mozilla/5.0 (Linux Android 2.1-update1; en-us; Nexus O EPE54B) AppleWebKit/530.17 (KHTML Gecko) Version/4.0 Mobile Safari/530. HTTP_X_VIA:Harmony proxy
Opera/9.80 (12ME/MIDp; Opera Mini/5.0.18302/812; U; en) Presto/2.4.15
britoso said:
Mines the default for CM506, there is an option to modify it.
HTTP_USER_AGENT:Mozilla/5.0 (Linux Android 2.1-update1; en-us; Nexus O EPE54B) AppleWebKit/530.17 (KHTML Gecko) Version/4.0 Mobile Safari/530. HTTP_X_VIA:Harmony proxy
Click to expand...
Click to collapse
In the option to edit it, would it allow you to put in the stock UA String and be identified as that?
Talderon said:
In the option to edit it, would it allow you to put in the stock UA String and be identified as that?
Click to expand...
Click to collapse
Cant easily edit it, It has four options: Android,Desktop,iPhone,IE6
Hi,
I've been trying to change Streak's stock browser's default UA (as I know a lot of people have been trying for a while). I went and pulled Browser.apk from the /system/app and extracted the files inside.
(/system/app/Browser.apk/classes.dex)
I then went through each of the files and found the following in classes.dex:
At data offset:
0x00030DD1 to 0x00030E4A
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
and
0x00030E4D to 0x00030EDA
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17
These are the exact same UA strings I get when I switch to the Iphone and Desktop user agent through about:debug in the browser.
I assume changing these strings will change the UA of the respective settings under about:debug settings mode in the default browser. However, I haven't tried as the actual ua string I am looking for is the default.
The default user agent string on my Dell Streak is:
Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Dell Streak Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
(currently using DJ_Steve's 1.4.6 Froyo rom)
Ultimately, I have these few questions, and am hoping someone out there can help:
1. I can't seem to find it in the Browser.apk, and am just wondering if it is a shared UA in webview for all the different network accessing applications?
2. If I change the default UA, would it affect all applications that uses the network?
3. Where is the default UA string kept?
4. For the about:debug method of changing the user agent string, is there a way to force the settings to persist after exit and restart of the browser application?
I apologize if I sound like I don't know what I am talking about, as this is my first android device, and my knowledge of linux/computers is generally quite limited.
Thanks ahead of time to anyone who can help out.
Android 2.2 sets the default hostname to android_dfhjkahdjksf or something equally useless.
To override this in Cyanogen 6.1 you need to set the net.hostname property with setprop Eg:
# setprop net.hostname mickey
My problem is when I try to set this up at boot, something always overwrites my change with the default. I have tried putting it in my init.rc, /etc/init.d and /data/local/userinit.sh and it is always reset to default by the time the phone has booted.
Does anyone have any more ideas about how to permanently set the hostname? It would be a good option to have in cyanogenmod.
UP. I'm very interesting too.
The root filesystem is stored in the boot.img and is expanded to a ramdisk every time you reboot. For changes to be permenant, you need to extract the boot.img file, extract the kernel and ramdisk sections, modify the ramdisk image with your changes, then recombine the kernel and ramdisk to a new boot.img and reflash it. You'll probably need to do this on a linux machine that understands unix permissions and ramdisk/cpio filesystems as well as having a good knowledge of linux and unix commands. See this thread:
http://forum.xda-developers.com/showthread.php?t=551711
note: your kernel may use a different "--base 0x19200000" option when building the kernel boot image.
Is there not a way to add a correlating line to the build.prop file?
EDIT: This doesn't work - whatever is setting the net.hostname writes out after build.prop is read.
I'm looking...
I did a search in the /system/etc directory for any file doing setprop (I'm using a miui rom) and found the following script. I did the setprop for net.hostname in there and it too is being overwritten.
search command:
grep -H -r setprop /system/etc
/system/etc/init.goldfish.sh
I'm running out of ideas other than using autostart to set it after reboot.
EDIT2: doh. I think I already knew this but it dawned on me that the default net.hostname comes from concatenating the "android_id" (found in the secure database table) to the end of "android_".
So seems more likely to reset it after reboot using a script (gscript to launch it manually or use autostart to launch it automatically at the end of reboot cycle).
Property net.hostname originate from services.jar (ConnectivityServices.java):
Code:
// setup our unique device name
String id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
if (id != null && id.length() > 0) {
String name = new String("android_").concat(id);
SystemProperties.set("net.hostname", name);
}
Maybe CM guys would change this to add another "if /proc/sys/kernel/hostname is different than localhost, use it for net.hostname too" condition.
I'm not using CM so it is up to you guys to make a feature request.
Another approach would be to set service in init.rc that would start your net.hostname changing script on some property being set just after net.hostname is set. You could use also:
Code:
on property:net.hostname=android_blahblah
...but that wouldn't be so handy since you will have to change that line in init.rc every time you make a factory reset.
Really interesting, thx !
BlaY0 said:
Property net.hostname originate from services.jar (ConnectivityServices.java):
Code:
// setup our unique device name
String id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
if (id != null && id.length() > 0) {
String name = new String("android_").concat(id);
SystemProperties.set("net.hostname", name);
}
Maybe CM guys would change this to add another "if /proc/sys/kernel/hostname is different than localhost, use it for net.hostname too" condition.
I'm not using CM so it is up to you guys to make a feature request.
Another approach would be to set service in init.rc that would start your net.hostname changing script on some property being set just after net.hostname is set. You could use also:
Code:
on property:net.hostname=android_blahblah
...but that wouldn't be so handy since you will have to change that line in init.rc every time you make a factory reset.
Click to expand...
Click to collapse
Thanks a lot. I've been looking for this for the past hour or so. Traditional linux methods to set the hostname don't work... I think I'll add an option in cyanogenmod settings for this and submit it to Gerrit. Look for it to show up within the next day or two.
That's great m8! Cheers
Sent from my HTC Legend
underscores in hostnames are bad
The main thing I want to do is get rid of that underscore. Several of the places I hook up with with WiFi attempt to enter the hostname supplied during the DHCP conversation into a DNS. But underscore is illegal for this purpose.
Numbat.
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
Note: This is for CM 10.1. For ICS/JB users try my other tutorial: http://forum.xda-developers.com/showthread.php?t=2201062
Here are instructions on how to get tethering working on all of my wifi devices without any special Proxies or VPNs.
This does work for other operating systems/protocols/ports/ and all browsers(Windows,OSX, other tablets etc..) :
The original idea is provided by a google code user in post #122 here: https://code.google.com/p/android/issues/detail?id=38563
*** Root is required ***
*** CM 10.1 is required *** Here is the version I have tested on: http://forum.xda-developers.com/showthread.php?t=2216542 (Other JB and L9 hardware versions may work)
Test Wifi NAT
1.) Backup Rom via CWM recovery.
2.) Enable the built-in wifi tethering from here: Settings --> More... --> Tethering & portable hotspot --> Portable Wi-Fi hotspot(Check this box)
3.) Launch "Terminal Emulator" and figure out your Radio Device Names and IP addresses (Install it from the market if you don't have this app).
a.) `su -`
b.) `netcfg`
***Look for the 3 lines that say "UP" and that also have non-zero IP addresses(0.0.0.000).
***Keep note of the device name(first column) and Subnet(last column).
ex.
wlan0 UP 192.168.43.1/24
rmnet0 UP 22.111.46.111/24
4.) Disable the built-in wifi tethering.
5.) Enable NAT routing of tethered device traffic so that data requests look as though they are coming from the phone instead of your tethered device.
a.) `iptables -tnat -A natctrl_nat_POSTROUTING -s 192.168.43.0/16 -o rmnet0 -j MASQUERADE`
***Note: You will need to change the strings in "Red" to match the subnet of your wifi IP address & device name of your cellular device.
Ex:
If your wifi device(mine is wlan0) IP is 192.168.20.1 you will use subnet 192.168.20.0/16
Update: 2/15/2014
6.) Change the user agent on your browser:
User agent strings:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24
Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0
Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.73.11 (KHTML, like Gecko) Version/7.0.1 Safari/537.73.11
a.) Chrome:
Select menu
Select tools
Select extensions
Select "Get more extensions"
Search for "user agent switcher"
Pick the one you want and set the user agent.
b.) Firefox:
Select "Tools"
Select "Add-ons"
Select "Get Add-ons"
Search "user agent switcher"
Pick the one you want and set the user agent.
c.) IE:
http://www.iegallery.com/
Search for "user agent switcher"
Pick the one you want and set the user agent.
7.) Enable the built-in wifi tethering and see if everything works.
Enable Wifi NAT at boot:
1.) Install script:
a.) If you are on a JB based ROM that can utilize init scripts in /etc/init.d/ you can place the attached script in this directory(Remove ".txt" from the file name).
b.) Set the permissions on the file to 755(rwx-rx-rx).
Or
a.) If you are on a version of JB that does not unilize init scripts you can use a script manager app to run the script when the phone boots(SManager from the play store is an option).
2.) Reboot the device and try tethering to be sure everything is working.
Click to expand...
Click to collapse
It looks like T-Mobile is blocking this now. This tutorial currently does not work.
Update: Working again. I have updated the original post with more information.
Hello,
I rooted my Nextbook Ares 8, NXA8QC116, so I could change the MAC address and host name, as I hate personal data mining and user behavior monitoring.
Device specifics: Model NXA8QC116S, Android Version : 5.1.1, Build # : V3.0.?
Rooted with the binary "Nextbook Ares 8 Stock 5.1.1 Rom modified boot.img" from another thread here.
I tried two apps I downloaded, and they both failed to change the MAC, so I tried to change the MAC manually.
I installed this terminal emulator - "Material Terminal" : yarolegovich.materialterminal_2.1.0-8_minAPI14(armeabi,armeabi-v7a,mips,x86)(nodpi)_apkmirror.com
I can't find any lists of recommended apps for this device, so I just picked a random terminal emulator. (This one is a "Google" emulator, whatever that means.)
Commands:
[email protected]:/ $: su
[email protected]:/ #: busybox iplink show wlan0
[reports the MAC address]
[email protected]:/ #: busybox ifconfig wlan0 hw ether 00:09:XX:XX:XX:XX (all hex, no "X's" - no errors reported)
[email protected]:/ #: busybox iplink show wlan0
[reports the original, unchanged MAC address]
I tried this with the WiFi both on and off.
BusyBox is the latest version. (BusyBox Apk installer Version: 60)
The above steps are given on many different websites, and I don't see any alternatives. (Except for "eth0" instead of "wlan0.")
Has the manufacturer disabled this for this device? If so, can someone recommend an 8" tablet, that is easily rooted, that will run an available app that randomly changes the MAC with each boot?
Thanks for any help.
I finally figured out how to change the MAC on my rooted Nextbook Ares 8, NXA8QC116.
There's a text file, max.txt, in /config/wifi, which contains the MAC address.
Changing this value, and then enabling the wifi adapter results in a new MAC address. This survives a reboot.