[Q] Need help at Coding - Android Software Development

Hey!
I finished 50% of my Code and now i need help.
My Question is, how can change the network settings? (Proxy and Port only).
Can i do it in Java, or do i need to edit com config files (root, su)?
I hope, someone here can help me.
thx in advance

Well, it all depends. If you are working on a windows mobile application, I don't think you can do much (if anything) in Java. But that's because you have .net Compact Framework.
What kind of application are you working on? And what do you need to modify in the network connection? What is the scope of the modification (are you just wanting to modify the network settings for the one app or will this affect the whole system?)
Also, are you wanting to utilize the raw TCP sockets? Or are you doing HTTP type stuff? With HTTP, look into the HttpWebRequest object, specifically the Port and the Proxy member variables.
EDIT: lol, I must have not gotten enough sleep! I thought I was in the WinMo section Anyways, try this:
Code:
SchemeRegistry schemeRegistry = new SchemeRegistry ();
schemeRegistry.register (new Scheme ("http",
PlainSocketFactory.getSocketFactory (), 80));
schemeRegistry.register (new Scheme ("https",
new CustomSSLSocketFactory (), 443));
ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager (
params, schemeRegistry);
return new DefaultHttpClient (cm, params);
Source

I am developing for Android, an app that changes the proxy and port for the whole system.
I am coding in java, and it must change the proxy and the port only, nothing other, only the Setting that is at : Menu -> Settings -> Network -> Wlan -> [Menu] -> More -> and the proxy ant port setting there.
please help

can you explain me how to use it?
EDIT: Doesn't work.

Is it possible to do this in Java?
If not, how can i do it with su?

Related

[Released] The Settings Creator

Howdy all. Do you flash your phone a lot? Don’t you hate it having to put in your WIFI and Exchange settings all the time? Well now you don’t have to with the Settings Creator. I started off creating a XML for just myself but then I decided to give back to the community that has helped me so much with my flashing and cooking needs.
To run the program all that is required is the .NET framework 2.0 (See below for link). After you input the information that is required a nice CAB file will be created, just pop that on your phone and viola settings are all done. In the words of my Cousin Vinny "Make once, use a bunch".
Known Issues:
1. WEP 128bit does not work (I think this is a limitation of the Hermes because even manually I cannot get it to work)
2. E-mail is for Exchange Direct Push Only
Help requested:
1. I don’t have access to a AP/Router that does WPA2 therefore I have no idea if this works with that level on authentication works (Also try manually to see if it is a limitation of the device)
2. I don’t have access to a AP/Router that does WPA with AES Encryption therefore I have no idea if this works with that level on authentication works (Also try manually to see if it is a limitation of the device)
Please provide any feedback you may have. Thanks guys.
-UllSang
Program requires .NET 2.0 Framework. (Download at http://www.microsoft.com/downloads/...CB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en
Also required is Visual J#)
Attachment 1: The binary release
Attachment 2: Source code.
Licensed under: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Change log:
---0.1
-----First Release
Running this on the desktop complained at first - you need to install the Visual J# Redistributable to make it work, as it doesn't seem to be part of the .NET framework by default.
Hope that helps.
Ah thanks for the heads up, I had no idea that it wasn't a part of the .NET framework by default. Did you instal the J# package and try the program? Thanks.
UllSang said:
Known Issues:
1. WEP 128bit does not work (I think this is a limitation of the Hermes because even manually I cannot get it to work)
Click to expand...
Click to collapse
A humble suggestion - this may be worth looking at again as I use wep 128bit and do not find any problem when entered as hex key.
Mike
Hmm.. intresting... I can not get it to work. I am inputting it as an ASCII though and it only works for 64 bit. After i saw your post i tried it entering as hex and it still does not work, it could be my cheap piece of crap router. Any chance you tried it out with the program? Thanks

[Q] [WIFI Monitoring] Toolchain and Linking

Hi everybody,
It's my first post on XDA, because I always got my answer on the differents topics I found.
I'm actually working on monitoring network. I use the firmware provide by these brillant guys :
http bcmon blogspot ie/.
I want to developp an native code to write a easy airodump-ng like, to monitoring the traffic close to my device.
I need to use radiotap headers to do what I want, and of course a monitoring access to my wireless card.
So I reverse the bcmon.apk provided by bcmon team, to look how they lauch airodump-ng in a term. I noticed they use LD_SHARED=`pwd`/libs LD_PRELOAD=`pwd`/fakedriver.so.
My first problems : my toolchain (provided by NDK) don't have radiotap header access, and I really don't know how to add these last one to it.
My second problems : how to compile my code with the LD_SHARED/ LD_PRELOAD libraries used by bcmon drivers to ensure I'll be able to execute my code with the monitor mode activated. I think that I will have to add the libs contained on /data/data/com.bcmon.bcmon/files/libs
on these of my toolchains, but I really don't know.
I read a lot papers to understand how linking works in C, but I'm probably still missing something.
I really don't know how to improve my toolchain, and I'm quite anoyed because I haven't progressed in my work for days...
Any help will be really appreciated.
Thanks a Million
Ant.
I found a solution few weeks ago.
I had linking erros.
I reserved the .apk provided by bcmon guys.
For those that want to develop using monitoring functionnalities, there is the way to do :
LD_PRELOAD=/data/data/com.bcmon.bcmon/files/libs/libfake_driver.so LD_LIBRARY_PATH=/data/data/com.bcmon.bcmon/files/libs ./yourprog
If you want to comiple your code using some of their libraries, for example pcap libraries I have done the fellowing stuffs :
1- found radiotap headers, and pcap headers on github likes websites.
2- try to cross compile with the headers
3- Correct the erros (like typedef missing ...)
4- Build your make file adding name of the libraries :
GCC={your toolchain}
FLAGS={your flags}
LIBS=libfake_driver.so \
libpacap.so.1
OBJ = {your obj}
output :
$(GCC) $(OBJ) -c {yoursrcfile) -o {output} $(FLAGS) $(LIBS)
Hope it 'll help.
Ant.

[Q] Reverse engineering app communication

Hello there,
i would like to get informations about the communication of an app, as it is using a VERY big amount of bandwith. And I'm curious.. I want to understand the complete communication.
I tried mitmproxy but it seems, that it is using a hardcoded proxy internally. So i thought about a different approch:
Adding Logging to the app itself.
The App is using a stripped down version of the okhttp lib (github.com:square/okHttp), that contains (in versions 1.5.0 to 1.6.0) the Request class. The constructor seems to not be changed in the app.
github.com/square/okhttp/blob/parent-1.5.0/okhttp/src/main/java/com/squareup/okhttp/internal/http/Request.java
I would like to add logging capability to the constructor in th compiled .class . Something like
Log.d("AppTarget",url.getProtocol()+"://"+url.getHost()+":"+url.getPort()+url.getPath()+" "+method);
at the end of the constructor.
1) Is this a good idea? (Or are there better ways? )
2) How to do this? Of course: I have to edit the bytecode. But more like: how to do this.
3) I have attached a compiled version of the lib
A wonderfull day
Mimoja
Well decompiling the app, adding the logging lines and recompiling wont work i suppose, because apktool etc dont return working code.
If you have another rooted android phone by chance, you should try intercepter-ng app found here on xda, works great as mitm tool to get other wifi device's traffic
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
stock Recovery

changing Android parameters on OP6T

Hi I'm new to this forum and wanted to inquire about Changing parameters of Android system like Android id and Mac IDs
I'm rooted with majisk and also running exposed with Android pie
The modules that claim to change these parameters dont work with Android pie
1: is there any way to change these parameters without interfering with systems integrity.
2: how does changing parameters like Android id makes change to Android system and daily usage.
Thanks in advance for your assistance.

Accessing hidden methods of TrafficStats

I need some help accessing the hidden API.
Well i have to access the getRxBytes(String iface) method of TrafficStats.
I want to make a wrapper to pass a name of the interface and get the RX and TX bytes of it.
Current public are
TrafficStats.getMobileRxBytes();
TrafficStats.getMobileTxBytes();
and
TrafficStats.getTotalRxBytes(); TrafficStats.getTotalTxBytes();
I need
TrafficStats.getRxBytes(String iface);
TrafficStats.getTxBytes(String iface);
i need a wrapper like
public long getInterfaceTxBytes(String interface) {
// hidden API getter
TrafficStats.getTxBytes(interface);
}

Categories

Resources