How to manipulate HTTP header ?? - Android Q&A, Help & Troubleshooting

anyone know how to manipulate HTTP header on Android??

would you like to elaborate what you mean by "manipulate HTTP header "

Hello,
Same question, is there any way to customise HTTP Headers using an Androphone?
Using Chrome Beta, Firefox or any other way.
For exemple, to set a custom "user-agent" string
Regards,

Yes you can set custom user agent strings.
http://bit.ly/GSWLxU
hehe noobs.

Phrack said:
Yes you can set custom user agent strings.
(url removed because i am newbie)
hehe noobs.
Click to expand...
Click to collapse
Arf! So simple, thank you, i am feeling so noob

Related

[APK][Xposed] resOverloader - Overload applications res files

Hello community,
I'm very glad to share my first trial of development which ran successfully for me and hope this will be useful for the rest.
I'm a big fan of a few chinese apps (baidu cloud, weiyun). Previously I was able to decompose and translate these apks to english until vendors injected apk signature validations into their apps. I even used these apps in foreign language but the experience were annoying. So I decided to translate these apps with some development. Eventually I came across resXploit by WisdomSky which give me a clue and I started this and it works :good:.
Basically resOverloader overloads strings.xml file for any apk (application). Source code is hosted on github for other devs to incorporate other resources as well. I'm not experienced dev and sharing this here for others and further development.
How to setup
Extract strings.xml from your target apk using apktool. read more
Translate strings.xml to your language. (I had developed a tool for it and would share it later)
Now create resOverloader folder in sdcard.
Find your app full qualified name in applications under settings and create a folder with app full name. (eg. com.baidu.netdisk)
Now copy the translated strings.xml to app folder inside resOverloader.
Restart your phone and it is done.
Hope this will help starters and requesting experience devs to add arrays.xml to this.
Github: https://github.com/babuilyas/resOverloader
Change log:
2.0 : rebuilt with targetSDK 14 and it should work for 2.2+ now. pls confirm.
Thank you for reading... Cheers.
reserved
Thanks all for praising my work. Here is my translation utility which can help you translate any xml file with auto fixing of literals and escapes within source text.
How it works!
The first step is, hand your xml file (strings.xml). Read OP
Run XML_translator.exe and select the file to translate. (language selectors are not working now and hardcoded to CN->EN)
Click Start translating.
The utility will take time and depends on source file length. At the end you will see strings-new.xml file. Rename it to strings.xml and use it with resOverloader.
I would soon remove the hardcoded part to enable multilingual translations.
Thank you very much.
I made a request for this feature in the request thread sometime back, but no developer was interested. . I will try it now and report back.
Edit: IT WORKS. My translated texts show up.
However, I would like only to see the translated texts when the system language is switched to that language only. So I could see original English texts when the system language is set to English.
nqk said:
Thank you very much.
I made a request for this feature in the request thread sometime back, but no developer was interested. . I will try it now and report back.
Edit: IT WORKS. My translated texts show up.
However, I would like only to see the translated texts when the system language is switched to that language only. So I could see original English texts when the system language is set to English.
Click to expand...
Click to collapse
OP could add localized string switching by checking filename suffix against Locale.getDefault().getLanguage(). So if you wanted to add multiple languages to an app, you'd just need strings-en.xml, strings-it.xml, etc etc
Yay , now yunpan/tencent/baidu drive shall all become translated
I was thinking about it latest two weeks and someone made it! Impressive!
nice work.. i'm waiting the translate strings tool..
This is really impressive.
Thank you very much for you work m8.
I'm on stock N4, and can't get this module to work. I decompiled and translated strings.xml, but there's no change in app. Should be translated strings.xml compiled back, before putting it to sdcard?
Great module, thx for your work. Also very interested in your translation tool. Also been thinking a lot about how to automate APK translation but to no avail.
Some features that i was thinking that can be added BUT not sure if they can be implemented:
- Load list of installed apps via GUI;
- Decompile the apk and extract the strings to a full app name folder (No idea if apk can be decompile from within an app)
- Tell user to edit the strings.xml
- Check if strings.xml was edited and in case it was prompt for reboot.
joluke said:
Some features that i was thinking that can be added BUT not sure if they can be implemented:
- Load list of installed apps via GUI;
- Decompile the apk and extract the strings to a full app name folder (No idea if apk can be decompile from within an app)
- Tell user to edit the strings.xml
- Check if strings.xml was edited and in case it was prompt for reboot.
Click to expand...
Click to collapse
I'm new and still learning android development. Im planning to integrate translating utility inside this app and would allow users to translate any app on the fly on the device.
geekon said:
I'm on stock N4, and can't get this module to work. I decompiled and translated strings.xml, but there's no change in app. Should be translated strings.xml compiled back, before putting it to sdcard?
Click to expand...
Click to collapse
make sure, you have copied translated xml in resOverloader\[your app full name]\strings.xml in internal memory (sdcard).
Bug: translated apps show an escaping slash-chars.
Can you add a possibility:
- to download and update of translation resources from github for all installed apps? In such case you should only define a resource location URL.
- for localization of res/layout/*.xml & res/xml/*.xml & etc
Is there a opportunity to use also preferences.xml?
babuilyas said:
make sure, you have copied translated xml in resOverloader\[your app full name]\strings.xml in internal memory (sdcard).
Click to expand...
Click to collapse
I tried with 4 apps, the results are as follows:
- AppSetting (xposed module): OK
- Nova Launcher: Partially OK, many strings remain in English
- Omniswitch (OmniRom): Not working (all texts are still in English)
- Transdroid: OK
:highfive:
nqk said:
I tried with 4 apps, the results are as follows:
- AppSetting (xposed module): OK
- Nova Launcher: Partially OK, many strings remain in English
- Omniswitch (OmniRom): Not working (all texts are still in English)
- Transdroid: OK
:highfive:
Click to expand...
Click to collapse
Share Xposed log and thanks for testing this app.
I saw the log, but didn't find any FC. See if there is anything in translated xml.
Benko111 said:
Great module, thx for your work. Also very interested in your translation tool. Also been thinking a lot about how to automate APK translation but to no avail.
Click to expand...
Click to collapse
i have some more ideas, so i will fork your module and add my ideas.
babuilyas said:
Share Xposed log.
Click to expand...
Click to collapse
Please have a look
https://m.app.box.com/view/f_16953900439
Sent from my Nexus 4
Very pleased.. Share it with all..
Sent from my LG-GEEB using Tapatalk

Override the strings.xml on the fly

Hi,
I want to change the string displayed for an app on the fly. I will download the new strings.xml from a server and would now like to change the strings of the app accordingly.
Could anyone please help as to how to achieve this in android.
Thanks in advance.

Parcing from xml or mysql (your recomendation)

Hi programmer,
I would like to do quiz application for android. i need you suggestions to do proper appl.
Let me generally explain what I would like to do:
• first page will be school subjects like biology physic and so on
• after will be quizzes packages
• and after selecting one of then it will start checking knowledge by showing question and 4 answers
generally it will be so.
My question is what is recommended to use parsing all data from xml or MYSQL DB from server OR add data to local SD card?
What is secure?
thanks in advance

[XPOSED] PoGo Ivy [RELEASE 2016-09-09 v1.5]

PoGo Ivy based on the work of elfinlazz & chuparCh0pper (special thanks to you guys!)
You can see your monsters iv and other stats as their nickname in the pgo app.
It doesn't actually change pokemon's nickname, only showing on app.
This does not use API, MITM or what ever red flagging action to server.
Feel free to use it.
I'm not responsible for any banned accounts or damaged devices, use at your own risk!
(Currently) not working with pgo v0.37.0, do NOT update until you are not forced to!
Features:
Can see IV, Level, localized Names and other stats in their nickname
Customizable string format(%NICK%, %NICK.#%, %LEV%, %LEV.#%, %IV%, %IV.P%, %IV.#%, %ATK%, %DEF%, %STA%)
Preview evolved CP/HP(nickname to evolving monster will show evolved CP/HP)
example: change nickname of Pikachu to Raichu and Pikachu's CP & HP values will change to evolved values
example2: change nickname of Bulbasaur to "EVO NEXT" and it shows Ivysaur stats, change to "EVO LAST" and it shows Venusaur stats
Optionally rename only favored monsters
Formats:
Nickname: %NICK% (shows the monsters name)
Nickname trimmed to # characters: %NICK.#% (eg. Bulbasaur: %NICK.5% -> Bulba)
Level: %LEV%
Level with # digits: %LEV.#% (eg. %LEV.2% -> 12.45 / %LEV.4% -> 12.4578)
IV: %IV%
IV left padded: %IV.P% (eg. 5 -> 005 / 78 -> 078)
IV with # digits: %IV.#% (eg. %IV.1% -> 89.3 / %IV.3% -> 89.361)
Attack (decimal): %ATK%
Attack (hex): %ATK.H% (eg. 15 -> F)
Defence (decimal): %DEF%
Defence (hex): %DEF.H% (eg. 15 -> F)
Stamina (decimal): %STA%
Stamina (hex): %STA.H% (eg. 15 -> F)
Candies needed to evolve: %CDY%
Fast move type: %FAST% (eg: Dragon, Normal...)
Fast move type abbreviation: %FAST.A% (eg: Dr, Ic ... Details)
Fast move typewith # digits:: %FAST.#% (eg. %FAST.3% -> Dra / %FAST.5% -> Drago)
Charge move type: %CHRG% (eg. Dragon, Normal...)
Charge move type abbreviation: %CHRG.A% (eg. Dr, Ic ... Details)
Charge move typewith # digits:: %CHRG.#% (eg. %CHRG.3% -> Dra / %CHRG.5% -> Drago)
Contribute your localized monster names
Feel free to contribute localized names for your language based on this pastebin, so i can add them in the next release.
Monster names currently implemented:
english
french
german
traditional chinese
Version History:
v1.0: Initial release
v1.1: Added formats %ATK.H%, %DEF.H%, %STA.H%
v1.2: Fix enable/disable functionality
v1.3: Fix unreadable preferences in MM (thanks to SGS5H @ xda for testing)
"Set custom format" now shows your format instead of default format
Add preview evolved monsters by manually changing nickname to "EVO NEXT" & "EVO LAST" (eg. Bulbasaur: EVO NEXT -> Ivysaur, EVO LAST -> Venusaur)
v1.4: Fix incorrect monster levels
Add feature to rename favored monsters only
Add formats %CDY%, %FAST%, %FAST.A%, %FAST.#%, %CHRG%, %CHRG.A%, %CHRG.#%
Switch to javalite protos (reduces apk size, multidex not needed anymore)
v1.5: Add missing movesets (should fix issues with %FAST... & %CHRG...)
Add traditional chinese localization (for monster names) (thanks to jerryh001 @ xda)
Download from xposed module repo:
http://repo.xposed.info/module/info.xposed.mirosz.pogoivy
Steps:
Install the module
Activate it in Xposed
Reboot
Run official pokemongo app
Enjoy
.
Can we have atk/def/sta available in hex as well as dec?
MrGodMan said:
Can we have atk/def/sta available in hex as well as dec?
Click to expand...
Click to collapse
show me an example please
mirosz said:
show me an example please
Click to expand...
Click to collapse
Instead of the atk using numbers 1 to 15 (decimal) it uses 1 to F (hexadecimal). This keeps the individual IVs as single characters for easier formatting.
eg a 15/12/5 Pokemon would show as F/C/5. This also has the advantage that you can remove the spacer character between each part.
PS, just installed app and it works good for me Thanks for keeping the app updated since elfinlazz seems to have stopped development.
mirosz said:
feel free to try my version and respond if its working for u or not, maybe we can fix it together
Click to expand...
Click to collapse
Hey, glad to see you are picking this project up. Unfortunately, the custom format still doesn't seem to do anything for me. Also, the preview text below "Set custom format" never changes to reflect the format I entered (it does change in the previous version of this module).
What's differences can you see between "ignore nicknamed pokemon" option when it's actived or not ?
Envoyé de mon SM-G935F en utilisant Tapatalk
crafty35a said:
Hey, glad to see you are picking this project up. Unfortunately, the custom format still doesn't seem to do anything for me. Also, the preview text below "Set custom format" never changes to reflect the format I entered (it does change in the previous version of this module).
Click to expand...
Click to collapse
The displayed text doesn't reflect what you have entered. Your changes are only visible in the edit field (after clicking "Set custom format")
What language and device are u using? please post the exact custom format u used.
nnrs1 said:
What's differences can you see between "ignore nicknamed pokemon" option when it's actived or not ?
Click to expand...
Click to collapse
if this option is enabled, the monsters you rename by hand on your own will not get overwritten by pogo ivy
MrGodMan said:
Instead of the atk using numbers 1 to 15 (decimal) it uses 1 to F (hexadecimal). This keeps the individual IVs as single characters for easier formatting.
eg a 15/12/5 Pokemon would show as F/C/5. This also has the advantage that you can remove the spacer character between each part.
PS, just installed app and it works good for me Thanks for keeping the app updated since elfinlazz seems to have stopped development.
Click to expand...
Click to collapse
thx, good to hear its working for u.
want upper or lower case?
mirosz said:
What language and device are u using? please post the exact custom format u used.
Click to expand...
Click to collapse
English, Nexus 5x, Pure Nexus rom. I even tried just setting the custom format to "%NICK%" but I still just get the default format in game.
mirosz said:
thx, good to hear its working for u.
want upper or lower case?
Click to expand...
Click to collapse
uppercase please
crafty35a said:
English, Nexus 5x, Pure Nexus rom. I even tried just setting the custom format to "%NICK%" but I still just get the default format in game.
Click to expand...
Click to collapse
which xposed version u using?
try to change devices language to french just to test if its language problem
edit:
ahh i think ive found the problem: https://github.com/rovo89/XposedBridge/issues/102
edit2:
try changing permissions like this using root browser:
/data/data/info.xposed.mirosz.pogoivy/shared_prefs/info.xposed.mirosz.pogoivy_preferences.xml -> 664
and
/data/data/info.xposed.mirosz.pogoivy/shared_prefs/ -> 755
mirosz said:
which xposed version u using?
try to change devices language to french just to test if its language problem
Click to expand...
Click to collapse
v86 -- French doesn't seem to help.
crafty35a said:
v86 -- French doesn't seem to help.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=68483222&postcount=10
^^ edit2
Doesn't seem to work. The file was already set to 664. I changed the folder to 755 and rebooted but still no luck.
crafty35a said:
Doesn't seem to work. The file was already set to 664. I changed the folder to 755 and rebooted but still no luck.
Click to expand...
Click to collapse
damn got a bootloop while testing a workaround
ok the last solution is to manually change the format in the preferences file :/
maybe there's a fix comming soon for xposed
Great Module so far. Thanks for your work!
mirosz said:
damn got a bootloop while testing a workaround
ok the last solution is to manually change the format in the preferences file :/
maybe there's a fix comming soon for xposed
Click to expand...
Click to collapse
The prefs file actually does contain my custom format, so I don't think that is the issue.
Thanks for updating this module I was wondering if the original was ever going to get updated again. I have one problem though when I disable the module within the POGO Ivy app it doesn't actually disable it for me. I can still see my IVs when I disable it.
TheJakee said:
Thanks for updating this module I was wondering if the original was ever going to get updated again. I have one problem though when I disable the module within the POGO Ivy app it doesn't actually disable it for me. I can still see my IVs when I disable it.
Click to expand...
Click to collapse
u need to restart pgo app, its not chnaged on-the-fly
mirosz said:
u need to restart pgo app, its not chnaged on-the-fly
Click to expand...
Click to collapse
I did restart it and nothing happened. Heck, I even restarted my whole phone and nothing happened. The Pokémon still had their IVs next to them.
I'm using the OnePlus 3 and everything worked fine in the old version.
TheJakee said:
I did restart it and nothing happened. Heck, I even restarted my whole phone and nothing happened. The Pokémon still had their IVs next to them.
I'm using the OnePlus 3 and everything worked fine in the old version.
Click to expand...
Click to collapse
Maybe you still have the old module active?

Google Chrome User Agent Android 7.x

Hi,
how can i Set Chrome User Agent to Desktop or chromebook on Android 7.x ?
Old User Agent Apps won't work on 7.x
I need to Set Chrome to Desktop view always on
Put a file in Data/Local called 'chrome-command-line', put this text in
chrome --user-agent="Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36" -force-device-scale-factor=2
Permissions 644, you can change the scale-factor to suit.
Sorry but this is Not working anymore on 7.x
Nobody ?
Just wanted to bump this as I'm also looking for a solution.
This has been bugging me for for a few days, very frustrating, seems like Chrome doesn't read the command line files in Nougat no matter where they are located, what they are called, or how you invoke the application. So I did the next best thing...
I grabbed the latest Chromium source code and modified user_agent.cc so it spits out a desktop UA instead. Cross compiling was a bit of a lengthy process, around 4 hours, but it works perfectly. The code alteration was quite trivial, I know this doesn't really help anyone here with a quick fix, and I really can't see Google adding a permanent desktop mode any time ever.
To make the change, just edit the following and rebuild:
<path>/src/content/common/user_agent.cc
PHP:
std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
const std::string& product) {
// Derived from Safari's UA string.
// This is done to expose our product name in a manner that is maximally
// compatible with Safari, we hope!!
std::string user_agent;
// base::StringAppendF(
// &user_agent,
// "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) %s Safari/%d.%d",
// os_info.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR,
// product.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR);
// return user_agent;
return "<Insert desired user agent here>";
}
dtchky said:
This has been bugging me for for a few days, very frustrating, seems like Chrome doesn't read the command line files in Nougat no matter where they are located, what they are called, or how you invoke the application. So I did the next best thing...
I grabbed the latest Chromium source code and modified user_agent.cc so it spits out a desktop UA instead. Cross compiling was a bit of a lengthy process, around 4 hours, but it works perfectly. The code alteration was quite trivial, I know this doesn't really help anyone here with a quick fix, and I really can't see Google adding a permanent desktop mode any time ever.
To make the change, just edit the following and rebuild:
<path>/src/content/common/user_agent.cc
PHP:
std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
const std::string& product) {
// Derived from Safari's UA string.
// This is done to expose our product name in a manner that is maximally
// compatible with Safari, we hope!!
std::string user_agent;
// base::StringAppendF(
// &user_agent,
// "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) %s Safari/%d.%d",
// os_info.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR,
// product.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR);
// return user_agent;
return "<Insert desired user agent here>";
}
Click to expand...
Click to collapse
Would it be possible for you to share the apk? This is frustrating me beyond belief after I moved to Nougat.
Found a solution for this problem, it was caused by a SELinux context which blocked read access to the command line file.
Download this script and copy it on the SDCard.
Install Android Terminal Emulator, then enter:
Code:
su
sh /sdcard/chrome.sh
- Testing 7.x fix. https://play.google.com/store/apps/details?id=com.linuxjet.apps.ChromeUA
jpeterson said:
- Testing 7.x fix. https://play.google.com/store/apps/details?id=com.linuxjet.apps.ChromeUA
Click to expand...
Click to collapse
Thank you. Is this working for anyone?
cobram3 said:
Thank you. Is this working for anyone?
Click to expand...
Click to collapse
It is available on the play store. I can not guarantee this will work, but I have tested it on my 7.x devices and 8.x devices and it is working on them.
Does not work on my OnePlus 5T on Android 8.0 rooted with Magisk.
Neither does the script posted above.
Any other ideas? I'm sick of manually selecting "view non crippled site" every time I open any webpage.
"Mobile" sites need to die!
EDIT: I figured it out, I needed to set the /data/local directory to be readable by all. (The script above already got the file permissions right for the chrome-command-line file, just not the directory it lived in). After that the user agent string seems to be working as it should and I can actually view useful webpages again!
Well, so much for that.
I wiped my phone and started over, and the same steps I used last time have no effect this time. I'm stuck in mobile website hell.
Anyone with any idea how to fix this?
EDIT: This seems to be related to the file permissions issue still, but I'm not sure how to fix it. When I'm not root, I get permission denied when I do an ls on the /data/local directory, despite that directory, and all the ones above it, being set 755. So whatever is blocking me from being able to ls that directory is also likely blocking the ability for chrome to read that file and behave like a useful web browser instead of a completely crippled one.
ve6rah said:
Does not work on my OnePlus 5T on Android 8.0 rooted with Magisk.
Neither does the script posted above.
Any other ideas? I'm sick of manually selecting "view non crippled site" every time I open any webpage.
"Mobile" sites need to die!
EDIT: I figured it out, I needed to set the /data/local directory to be readable by all. (The script above already got the file permissions right for the chrome-command-line file, just not the directory it lived in). After that the user agent string seems to be working as it should and I can actually view useful webpages again!
Click to expand...
Click to collapse
You can create a "chrome desktop"widget with that app,only by this way,it seems to work.
Unfortunately that only works for opening the browser and does nothing for links clicked in our applications.
Why do developers of websites hate mobile users? This isn't 1998 anymore, people want to access websites from their phones! We shouldn't have to resort to such ridiculous lengths to enable such basic functionality as a working web browser!
https://forum.xda-developers.com/showthread.php?t=1811101&page=13 #128
That helps quite a bit.
Now of course I've run in to another problem. AMP. google assistant and related products love to push AMP pages instead of websites, and chrome won't open them in desktop mode, only in mobile mode. I wonder if there's some way to convince Google assistant to behave and link to real webpages?
*sigh* it's amazing how far companies are willing to go to cripple their websites!
EDIT: Found it! DeAMPify in the play store translates all those external programs (like the google feed) to non amp versions before passing them to the browser.
With enough steps and work-arounds you too can have a functioning web-browser on your smartphone!
I'm here to confirm Wootever's script working on [ROM][8.1.0][STABLE][OFFICIAL][TREBLE] AospExtended ROM V5.4 [Z2 PRO]. I had already created the chrome-command-line file via file explorer and set permissions to 755, but it wasn't working. Customized the UA string to my liking, btw (X11; Linux Arm64).
The way G00gl€ is developing Chrome is fLIck1ng annoying, this is basic functionality being set aside because fLIck you. Latest Android Chrome versions (63 to 66) are a piece of sh1t imho.
Cheers
Wootever said:
Found a solution for this problem, it was caused by a SELinux context which blocked read access to the command line file.
Download this script and copy it on the SDCard.
Install Android Terminal Emulator, then enter:
Code:
su
sh /sdcard/chrome.sh
Click to expand...
Click to collapse
Does anyone still have this file?
Reupload
Reupload ulozto.sk/file/R55e4UbG3ppA/chrome-sh

Categories

Resources