[Technical Guide] Hide tethering on H830 - T-Mobile LG G5 Guides, News, & Discussion

I am not going to provide a pre-built apk.
If you want to hide tethering, you have to learn and know the basics of xposed and compiling an apk.
I would prefer that no one provides a pre-built APK either, but I obviously can't demand/enforce this
Requirements: H830 T-mobile LG G5, root, xposed
May or may not work with other LG G5 variants
Technical details:
Tethering app verifies permission with T-mobile before starting
When you enable tethering, there is a popup saying something like "Please wait, verifing...".
The "whichurl" backdoor bypasses this check/popup.​
Tethered data gets diverted into separate tethering APN
T-mobile monitors this separate APN. The initZygote stuff attempts to stop this from happening. I have not tested this throughly, but it seems to work​
Rest of the hooks, probably not important
Code
Code:
package com.xposed.lgg5.tethering;
import android.content.Context;
import android.content.res.XResources;
import android.util.Log;
import android.widget.Toast;
import de.robv.android.xposed.*;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import static de.robv.android.xposed.XposedHelpers.setIntField;
public class XposedTetheringH830 implements IXposedHookLoadPackage, IXposedHookZygoteInit{
public void initZygote(IXposedHookZygoteInit.StartupParam var1) throws Throwable {
Log.i("XposedTetheringH830", "Updating systemwide arrays to stop tethering data being diverted into tethering APNs");
XResources.setSystemWideReplacement("android", "array", "config_mobile_hotspot_provision_app", new String[0]);
// If we override the three items below, tethering is completely disabled on device
/*XResources.setSystemWideReplacement("android", "array", "config_tether_usb_regexs", new String[0]);
XResources.setSystemWideReplacement("android", "array", "config_tether_wifi_regexs", new String[0]);
XResources.setSystemWideReplacement("android", "array", "config_tether_bluetooth_regexs", new String[0]);*/
// don't know if this is necessary
XResources.setSystemWideReplacement("android", "array", "config_tether_upstream_types", new int[0]);
// necessary, otherwise phone diverts tethered data into separate APNs
XResources.setSystemWideReplacement("android", "array", "config_tether_apndata", new String[0]);
}
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
if(lpparam.packageName == null || lpparam.appInfo == null || lpparam.appInfo.packageName == null) {
return;
}
if(lpparam.packageName.equals("com.lge.upsell")) {
// stops tethering APK from checking with Tmobile on tethering permissions on your account
findAndHookMethod("com.lge.upsell.UpsellUtil", lpparam.classLoader, "getSettingInt", Context.class, String.class, int.class,
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Context context = (Context) param.args[0];
if (param.args[1].equals("whichurl")) {
Toast.makeText(context, "Upsell whichurl override = 4", Toast.LENGTH_SHORT).show();
Log.i("XposedTetheringH830", "Nice LG backdoor, Upsell whichurl override = 4");
param.setResult(4);
}
}
}
);
}
// rest of these hooks probably not needed... the whichurl backdoor above is most important
if(lpparam.packageName.equals("com.lge.wifihotspotwidget")) {
findAndHookMethod("com.lge.wifihotspotwidget.MDMWifiSettingsAdapter", lpparam.classLoader, "checkDisallowHotspot", new XC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
Log.i("XposedTetheringH830", "checkDisallowHotspot = false");
return false;
}
});
findAndHookMethod("com.lge.wifihotspotwidget.WidgetPopup", lpparam.classLoader, "isTmusSimCard", new XC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
Log.i("XposedTetheringH830", "widgetPopup isTmusSimCard = false");
return false;
}
});
findAndHookMethod("com.lge.wifihotspotwidget.HotspotWidgetProvider", lpparam.classLoader, "isTmusSimCard", new XC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
Log.i("XposedTetheringH830", "HotspotWidgetProvider isTmusSimCard = false");
return false;
}
});
findAndHookMethod("android.os.UserManager", lpparam.classLoader, "hasUserRestriction", String.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if(param.args[0].equals("no_config_tethering")){
Log.i("XposedTetheringH830", "no_config_tethering = false");
param.setResult(false);
}
}
});
}
}
}

Thank you for the info; however, why can't you provide an apk? It would be great if you could. ?
I'd like to do it but don't have a clue.
Sent from my LG-H830 using XDA-Developers mobile app

Yes? No? Please?
Sent from my LG-H830 using XDA-Developers mobile app

Does this mean this tethers without using data from tethering?
Sent from my LG-H830 using Tapatalk

gamepr said:
Yes? No? Please?
Sent from my LG-H830 using XDA-Developers mobile app
Click to expand...
Click to collapse
He literally just said he won't do it and doesn't want others to do it either. If someone does it then i guess it's fine but do not flat out disregard the OP's request by asking him to do it for you.
I am grateful to the OP for detailing what needs to be in an apk. I don't have the know how either to build this but I'm sure there are many that do.
Sent from my LG-H830 using XDA-Developers mobile app

arjuna_ said:
He literally just said he won't do it and doesn't want others to do it either. If someone does it then i guess it's fine but do not flat out disregard the OP's request by asking him to do it for you.
I am grateful to the OP for detailing what needs to be in an apk. I don't have the know how either to build this but I'm sure there are many that do.
Sent from my LG-H830 using XDA-Developers mobile app
Click to expand...
Click to collapse
Arjuna,
You are not bringing anything to the table as far as this subject is concerned. The op stated that he will not provide a pre built apk and that he prefers no one doing so either. I help out forum members as much as I can and encourage others to do so as well.
The op opposes a pre built apk..... I'm trying to encourage him to provide a compiled apk (not a pre built one) so that other members, like me and you, can benefit from a tethering "mask" mod/patch.
Encouraging him to compile such mod/patch for all of us is not unreasonable; moreover, I am not asking him to do anything illegal. We are all part of this community. We collaborate and help each other out whether it's through technical data collaboration, offering personal phone reviews, or answering questions.
I regret to inform you that your personal interpretation is not helping the cause. I have to constantly take my Sim card out of the LG g5 and into the nexus 5 to tether.
Sent from my LG-H830 using XDA-Developers mobile app

There is literally no difference between a pre-built apk and a compiled apk. They're synonymous with each other. I think the only warped interpretation here is your expectations of what this site offers. This is a community that promotes the combined effort towards the developmental aspect of android, where you can share your progress on projects, get technical insight on how to overcome whatever obstacles youre facing, but most importantly find all the guides and documentation you need to teach YOURSELF, not to demand others share their personal work with you. If you're simply looking to swap apps with other users, there are a plethora of file sharing websites out there, but if you want to actually contribute to this community, crack a book or go read a guide.

I successfully created an Xposed module that was installed with the Android Studio. However I can't get it to function in the manner it is supposed to: blocking the tethering usage statistics. I don't know how I go about debugging it to make sure I did it correctly. If you can PM to take a look at what I did and where I can improve it that would be very beneficial. This was quite an interesting endeavor for me honestly and I feel like I learned a tiny bit of what it is like to be a developer.

Make sure you aren't trying to tether to a Windows computer, T-Mobile can still track that.
Sent from my SM-T320 using Tapatalk

DualSportDad said:
Make sure you aren't trying to tether to a Windows computer, T-Mobile can still track that.
Sent from my SM-T320 using Tapatalk
Click to expand...
Click to collapse
I'm assuming they couldn't track it if you use a VPN, right?
P.S. I wonder how convoluted a personal connection can get. A laptop tethered to a mobile device feeding a connection through a VPN is starting to seem pretty up there. Add in a proxy through TOR and you are probably maxing out your ridiculosity.

Has anyone had success with this? I will gladly buy an APK off of somebody haha, name your price (within reason). Apologies if this irks you OP.

Related

[REQ] Need some info on MDIs in Smart device applications using C#.net

Hi all guys
i am new to C# and .net stuff as i was working with C++ for many years
i want to know that is it possibhle that i can have an MDI Child Form on my main Form and want it to return me some data
like for example i have my main Form has a "settings" button
when i click on "settings" button it should show a small MDI child form which has all the settings and return some data (i'll take care of data but i dont know how to return through a form)
thnx in advance
Well...as far as 'returning' data from the Form, you can't do that as a "return" call because Forms are objects, so the constructor cannot have a return type, however you can have a method that will set a variable in another class (that is public) to the data you want to return ... You can call this method when the form is closing.
I am not entirely sure if you can achieve the 'small form INSIDE another form' without creating your own control. I am not sure how practical/possible this would be, but you can try 1 of the following: extend the Control class (to make a control) or override the OnPaint of a new Form. This way you can define where stuff goes, and what gets drawn onto the screen.
I have used this piece of code in the past, which worked great.
in my example frmA was an MDIchildform of the main (MDIparent)
frmA()
{
public int a=0;
private btn_click(blabla)
{
frmOptions options = new frmOptions(this);
dialog.ShowDialog();
if(dialog.DialogResult == DialogResult.Yes)
{
dosomethingwith(a);
}
else
{
donothingwith(a);
}
}
}
public partial class frmOptions : Form
{
frmA callingform = null;
public frmOptions(frmA x)
{
callingform = x;
}
private void dosomething()
{
callingform.a = value;
}
private void btnSaveSettings_click()
{
this.DialogResult = DialogResult.Yes;
}
private void btnCancelSettings_click()
{
this.DialogResult = DialogResult.No;
}
}
good luck

EM app in DVP

Hi guys, using the Webserver app by davux (thanks heaps!) I found Dell's EM diagnostic program in the Windows directory with the license file (not that its of much use)
Unfortunately my programming skills aren't up to scratch (java 2.0...i know its old) and I'm not very good with VS2010
maybe someone can pick apart the DLLs in the XAP file and hopefully figure out how to SIM unlock the DVP and gain access to other password protected parts of the diagnostic program
do i see...native??? Someone drop a PM to xbox asap
Some real good code you got here, able to get:
App.EMInterface.polling("EM:RESET_SCREENLOCK_TIMER;", new PollingDataHandler(this.handler), 25000);
App.EMInterface.sync("EM:COMPASS_GET;", 1);
App.EMInterface.sync("EM:LCD_OFF", 1, false);
public const string ValidComAssemblyName = "OurCOM.dll"; (the native)
public const string ValidComGuid = "E2A22F82-0E6A-4ee9-A56D-2677EBE81F2E";
Code:
case "#CIT_END":
page.changeContent(new Cit_end());
return;
case "#SDCARD":
page.changeContent(new SDCard());
return;
case "#FM_RADIO":
page.changeContent(new CITFMRadio());
return;
case "#AUDIO_LOOP":
page.changeContent(new AudioLoopEarphone());
return;
case "#KEYPAD":
page.changeContent(new Keypad());
return;
case "#KEYPAD_NOFOCUS":
page.changeContent(new Keypad_nofocus());
return;
case "#LCD_DISPLAY":
page.changeContent(new LCDDisplayTest());
return;
case "#CAMERA":
page.changeContent(new Cameratest());
return;
case "#TOUCH_PAD":
page.changeContent(new SingleFingerTest());
return;
case "#LED_TEST":
page.changeContent(new LED());
return;
case "#VIBRATOR":
page.changeContent(new Vibrator());
return;
case "#BACKLIGHT":
page.changeContent(new Backlight());
return;
case "#SIMCARD":
page.changeContent(new simcard());
return;
case "#BATTERY":
if (str.Length > 1)
{
rootVisual.DataContext = str;
}
page.changeContent(new Battery(str));
return;
case "#CHARGING":
page.changeContent(new charging());
return;
case "#ECOMPASS":
page.changeContent(new CITECompassTest());
return;
case "#GSENSOR":
page.changeContent(new CITGsensorTest());
return;
case "#L/PSENSOR":
page.changeContent(new CITLightProximityTest());
return;
case "#SLIDER":
page.changeContent(new slider());
return;
more to come.
bigger question beyond code
anything useful for registry backdoors or native dll like htc?
OH YEAH! this.IEmToCom.sync("EM:REGISTRY_GET:" HKEY > etc
Code:
this.sync_result = this.IEmToCom.sync("EM:FILE_COPY:" + this.TB_file_path.Text + ";", 1, false);
if (this.sync_result.IsSuccessed == 0)
{
this.TB_result.Text = this.sync_result.content;
}
else
{
this.TB_result.Text = this.sync_result.IsSuccessed.ToString();
}
fiinix said:
OH YEAH! this.IEmToCom.sync("EM:REGISTRY_GET:" HKEY > etc
Click to expand...
Click to collapse
THAT'S WHAT I WANTED TO SEE
so unlike provxml that string gets direct registry access?
domineus said:
THAT'S WHAT I WANTED TO SEE
so unlike provxml that string gets direct registry access?
Click to expand...
Click to collapse
looks like it
this.sync_result = this.IEmToCom.sync("EM:REGISTRY_SET:"
also:
this.IEmToCom.polling(@"EM:REGISTRY_GET:System\Platform\DeviceTargetingInfo,MODeviceName,REG_SZ,2;"
...I just came...and hard...
wow okay that's hot
but it looks like to make changes we may have to uninstall and reinstall em.xap no?
dont you just make your own app and use the dlls? no need to reinstall EM?
The EM:Registry Set only works for new entries. It doesn't work for updating current entries..Still deep diving.
There is also a app /page within EM called EM_2010_03_24..Has anyone gotten around invoking it?
Those hacks for windows phone is based om COM wrappers that are microsoft signed with public methods to the c++ dll's.
Just copy the signed dll+com wrapper in to a new project, not harder than that (add reference to com wrapper).
Good explanation for u?
Did some digging in reflector, here are the about pages you can get to from within EM and what they do:
RD Test > *#6336#
RD Test > About EM > *#301#
Bootloader Composite / Zune
Teleport Mode Enable / Disable
Unlock Sensor Key
CIT Order
Cold Boot
EM [Clickable]
DRIVER
UISOCKET
RD Test > About EM > *#684#
NV Read/Write Page
RD Test > About EM > 6814
EM in EM
Run 'EM:' commands
Sync OR Polling calls
File Copy
Just wires up the EM:FILE_COPY command to a UI
RD Test > About EM > *#734#
Registry Read/Write [Write only works for new values?]
can verify register does not work for old values...only for new values
domineus said:
can verify register does not work for old values...only for new values
Click to expand...
Click to collapse
Can you give an example for a new value working? I tried the 'enabling wireless N' and nothing happened.
notebookgrail said:
Can you give an example for a new value working? I tried the 'enabling wireless N' and nothing happened.
Click to expand...
Click to collapse
I think it has more to do with where you're writing to, it doesn't seem that EM has rights to change or add keys that require privileges.
Any new information on this one? Has anyone gotten a new/changed entry to work?
Can we use this app on DVP?
http://forum.xda-developers.com/showthread.php?t=1238519
Ephez said:
Can we use this app on DVP?
http://forum.xda-developers.com/showthread.php?t=1238519
Click to expand...
Click to collapse
No.. This is samsung specific as HTC phones have easier workarounds to use provxmls. It uses the GPRS Manager within the Samsung Focus/Omnia's Diagnosis App which isn't available for the DVP.

Legal Text and Code Sample for WP7 Application Eula

I am learning programming and trying to finish off my first WP7 application.
My day job is a corporate commercial attorney in Montreal, Quebec Canada but I like to experiment with programming as a hobby.
I was surprised that no easy mechanism was provided for an End User Licence Agreement so I drafted one using precedents.
This EULA not only protects your ip but it provides for updates, additional services and, most importantly, limitation of liability and warranty.
I want the user to be presented with the usual "I agree" button when loading the application so I set up a key in the application settings entitled licence with a bool variable that stores false if the user has not accepted the EULA and true if the user has accepted this. I then check this key on app startup to determine the page I present to the user, whether it be the EULA page or the 1st page of the application. Once the user clicks the I agree, the key is set to true and the EULA is not presented again.
On mainpage I use the following code to test if the licence was accepted (it is basic, but works):
public Classes.AppSettings appsettings = new Classes.AppSettings();
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
// Display Message box for licence
if (!appsettings.getsettings("licence"))
{
this.NavigationService.Navigate(new Uri("/EULA.xaml", UriKind.Relative));
}
}
As you can see, if licence is false, there is a navigation to the eula page.
Here is the function I use to store key in the application settings. It works for bool variables and can be re-used.
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.IO.IsolatedStorage;
namespace Car_Mileage_Tracker_2.Classes
{
public class AppSettings
{
// This class is used to store setting in application settings
// SETTINGS
// FIRSTUSE bool TRUE is not first use FALSE is first use
// LICENCE bool TRUE is licence accepted FALSE is licence not accepted
// HELP bool TRUE is help messaged displayed FALSE is help message not displayed
// UNITS bool TRUE is km and FALSE is miles
public AppSettings(){}
public bool getsettings(string key)
{
var store = IsolatedStorageSettings.ApplicationSettings;
bool value = true;
if (store.Contains(key))
{
try
{
store.TryGetValue(key, out value);
return value;
}
catch
{
MessageBox.Show("Could not retrieve setting " + key + " from Application Settings");
return false;
}
}
else { return false; }
}
public void setsettings(string key, bool value)
{
var store = IsolatedStorageSettings.ApplicationSettings;
if (store.Contains(key))
{
try { store[key] = value; }
catch
{
MessageBox.Show("Could not save " + key + " setting in Application Settings");
}
}
else { store.Add(key, value); }
}
}
}
I have attached the EULA xaml page as well as the EULA cs page and a word document containing my sample EULA. To circumvent upload restrictions I have added txt to the xaml and cs files, you simply need to rename them. You will need to fill in the info for your company and edit section 13 to provide for your local court district and state/province/country. Also, I have not yet implemented the code for clicking on the I disagree button. This seems to be a touchy issue in WP7 Silverlight as there is no way to cause an application to terminate except by raising an exception which may be against marketplace rules. I probably will show another page explaining to the user that he/she cannot use the application without agreeing to the EULA but I am not there yet
I feel that this EULA affords me sufficient protection as a developer of an application but make no warranties to this effect and it is always recommended to have it verified by your lawyer.
I hope this may be of use to some of you developing apps.
If you have comments or suggestions, let me know or send me a pm. If you appreciate and use this, then you can, but are not obligated to send me some coffee money or a copy of your app
I will eventually translate the EULA in French, but if would be great if we could get a Spanish, Italian and German version of this.
Have fun.
Message to thread Moderator: If this is not posted in the proper thread/forum, please feel free to move it to the correct one.

Advice on strategy

I'm developing a WP7 app, working alongside a Windows (server) application. They are talking with each other using sockets.
As soon as the WP7 app opens, I wish to perform a network scan to find the server application.
I already found out how to get the IP address of the WP7. So let's say I know the server should be somewhere at 192.168.0.*. How do I go about scanning this network?
I tried many things, the last of which is the code below. The problem here is that somehow the TIMEOUT_MILLISECONDS parameter seems to be like playing roulette (tried everything in the range of 100-2000 with different success). In addition, if I sweep the whole subnet like in the code below the phone cannot seem to handle the work. I only get it to work if I set the timeout to 2000 (which is way to long) and by scanning up to 5 IP's in the for-loop, instead of the whole subnet.
Is there anyone that knows a better and much more efficient(!) way to do this?
Code:
string thisIP = "192.168.0.101"; // I normally get this from some other function
string[] arrIP = thisIP.ToString().Split('.');
string IPBase = arrIP[0] + "." + arrIP[1] + "." + arrIP[2] + ".";
//MessageBox.Show(address.ToString());
for (int i = 2; i < 254; i++) {
string IP = IPBase + i;
CheckConnection CheckConn = new CheckConnection();
string resultConnect = CheckConn.Connect(IP, int.Parse(Resource1.port));
if (resultConnect == "Success") {
CheckConn.Send("isAlive");
string result = CheckConn.Receive();
if (result.Contains("yes")) {
// We have found the server
break;
}
}
CheckConn.Close();
}
Code:
public class CheckConnection
{
// Cached Socket object that will be used by each call for the lifetime of this class
Socket _socket = null;
static ManualResetEvent _clientDone = new ManualResetEvent(false);
const int TIMEOUT_MILLISECONDS = 100;
const int MAX_BUFFER_SIZE = 2048;
public string Connect(string hostName, int portNumber) {
string result = string.Empty;
DnsEndPoint hostEntry = new DnsEndPoint(hostName, portNumber);
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs();
socketEventArg.RemoteEndPoint = hostEntry;
socketEventArg.Completed += new EventHandler<SocketAsyncEventArgs>(delegate(object s, SocketAsyncEventArgs e) {
result = e.SocketError.ToString();
_clientDone.Set();
});
_clientDone.Reset();
_socket.ConnectAsync(socketEventArg);
_clientDone.WaitOne(TIMEOUT_MILLISECONDS);
return result;
}
public string Send(string data) {
string response = "Operation Timeout";
if (_socket != null) {
SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs();
socketEventArg.RemoteEndPoint = _socket.RemoteEndPoint;
socketEventArg.UserToken = null;
socketEventArg.Completed += new EventHandler<SocketAsyncEventArgs>(delegate(object s, SocketAsyncEventArgs e) {
response = e.SocketError.ToString();
_clientDone.Set();
});
byte[] payload = Encoding.UTF8.GetBytes(data);
socketEventArg.SetBuffer(payload, 0, payload.Length);
_clientDone.Reset();
_socket.SendAsync(socketEventArg);
// Block the UI thread for a maximum of TIMEOUT_MILLISECONDS seconds.
// If no response comes back within this time then proceed
_clientDone.WaitOne(TIMEOUT_MILLISECONDS);
}
else {
response = "Socket is not initialized";
}
return response;
}
public string Receive() {
string response = "Operation Timeout";
if (_socket != null) {
SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs();
socketEventArg.RemoteEndPoint = _socket.RemoteEndPoint;
socketEventArg.SetBuffer(new Byte[MAX_BUFFER_SIZE], 0, MAX_BUFFER_SIZE);
socketEventArg.Completed += new EventHandler<SocketAsyncEventArgs>(delegate(object s, SocketAsyncEventArgs e) {
if (e.SocketError == SocketError.Success) {
response = Encoding.UTF8.GetString(e.Buffer, e.Offset, e.BytesTransferred);
response = response.Trim('\0');
}
else {
response = e.SocketError.ToString();
}
_clientDone.Set();
});
_clientDone.Reset();
_socket.ReceiveAsync(socketEventArg);
_clientDone.WaitOne(TIMEOUT_MILLISECONDS);
}
else {
response = "Socket is not initialized";
}
return response;
}
public void Close() {
if (_socket != null) {
_socket.Close();
}
}
}
Why you don't know the server IP?
I can't help you with your subnet scanning problem, don't have experience with that corner of WP7 programming.
But I do wonder what kind of arrangement leads to the problem that your app does not know the server address and therefore has to scan for it. Is neither a fixed IP available for your server nor some kind of DNS service up to tell you the current IP?
Even if there are multiple servers running and the phone has the job to somehow decide which one of those is responsible for it, you still could set up some kind of super-server that the phones could ask first which server they should address.
In any way, phones scanning subnets to find servers as some routine app startup action is a bad idea, if you ask me.
Please note that by 'server' I'm just revering to a software that accepts socket connections. This software is installed into a Windows computer that most likely has it's IP from DHCP.
The server software itself could present it's IP address so the end-user can type this address into the client on their WP7. Nice for tech-savvy folks, but that's not how software should be designed in my opinion. People don't need to know what an IP address is and shouldn't be force into typing 'weird numbers'. Properly designed software just have to work instantly and developers (again in my opinion) need to take care of a good design and that includes making things plug-and-play where they can.
Take a look at 'PC Remote' and you will see the kind of easy plug-and-play experience I'm looking for.
Did you check broadcast?
I'm really not network guy, but from Googling I got the impression that people use broadcast instead of IP range scanning for such IP number discovery tasks, and there seems to be a way to do broadcast on WP7 (albeit only using some tricks / hardly documented functionalilty):
E.g. see this thread:
http://stackoverflow.com/questions/8533471/udp-broadcasting-in-windows-phone-7
Which links to this:
http://forums.create.msdn.com/forums/t/88975.aspx
This makes sense to me after reading that broadcast is also the method how a client finds its DHCP server - isn't that the exact same scenario like yours?
Did you already check this way of looking at the problem, or maybe rule it out already for some reason?
It's better if you use a multicast group to send/receive packages. I had way better experience with it than using the Broadcast IP.
You need to join the multicast group with the phone and with the server app. I know there are multicast classes but I found it easier and mor convient to implement it with a socket...
And after you found the server, I'd use a persistent tcp connection which should improve your network performance (udp and wp7 is sometimes really strange...)
Thanks rbrunner7 and chabun for your comments, I appreciate your input!
rbrunner7 said:
Did you already check this way of looking at the problem, or maybe rule it out already for some reason?
Click to expand...
Click to collapse
I did, briefly, but abandoned this path after reading about the physical network equipment (switches etc.) having the need to support broadcasting which might not always be the case.
Anyway, your mentioned post describes 'limited broadcasting', which might be exactly what I should be looking for. Hopefully hardware limitations will not be applicable; I will look into this method further and will let you know how it works out!
roady001 said:
the physical network equipment (switches etc.) having the need to support broadcasting which might not always be the case.
Click to expand...
Click to collapse
I had the same doubts about that as it's also the case for multicasting. Most modern equipement supports it though and you can always provide the possibility to manually enter the server ip if you can't discover one via multicast/broadcast

Interesting things in APKs in our phones...

So in my digging around on garbage to remove... I started digging in ConnectionManager.apk. Several things kind of set me off a bit (code below). I don't claim to know exactly what it does but I can read enough of it to figure I don't want it running on my phone. EdmSysScopeService also had some interesting things in it(third block of code below). So I removed the connectionmanager.apk from the phone since I was reflashing some zips. Apparently that's not a good idea. If you do that, it breaks the Mobile Networks settings menu. So I put it back and just froze it in Titanium Backup for now. Looks like that works and it simply greys out the ConnectionsOptimizer section. I don't need that running on my phone anyways as I can turn on and turn off wifi myself.
Anyone know what the EdmSysScopeService does?
Code:
private boolean isDeviceRooted()
{
boolean bool1 = true;
String str = Build.TAGS;
if ((str != null) && (str.contains("test-keys")));
while (true)
{
return bool1;
try
{
boolean bool2 = new File("/system/app/Superuser.apk").exists();
if (bool2)
continue;
label40: bool1 = false;
}
catch (Throwable localThrowable)
{
break label40;
}
}
}
Code:
package com.birdstep.android.cm.sms;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.util.Log;
import com.birdstep.android.cm.ESLog;
import com.birdstep.android.cm.UpdaterService;
import com.birdstep.android.cm.config.ConfigXmlParser;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class OperatorMessage extends BroadcastReceiver
{
private static final String ANDROID_PERMISSION_READ_SMS = "android.permission.READ_SMS";
public void onReceive(Context paramContext, Intent paramIntent)
{
if (ESLog.on)
Log.i("EasySmart", "on Receive OperatorMessage OperatorMessage OperatorMessage " + paramIntent.getAction());
ConfigXmlParser localConfigXmlParser = ConfigXmlParser.getConfigXmlParser(paramContext);
if (("android.provider.Telephony.SMS_RECEIVED".equals(paramIntent.getAction())) && (paramContext.getPackageManager().checkPermission("android.permission.READ_SMS", "com.birdstep.android.cm") == 0))
{
Bundle localBundle = paramIntent.getExtras();
if (localBundle != null)
{
Object[] arrayOfObject = (Object[])localBundle.get("pdus");
if (arrayOfObject != null)
{
SmsMessage[] arrayOfSmsMessage = new SmsMessage[arrayOfObject.length];
HashMap localHashMap = new HashMap(arrayOfObject.length);
int i = 0;
if (i < arrayOfSmsMessage.length)
{
arrayOfSmsMessage[i] = SmsMessage.createFromPdu((byte[])(byte[])arrayOfObject[i]);
if (!localHashMap.containsKey(arrayOfSmsMessage[i].getOriginatingAddress()))
localHashMap.put(arrayOfSmsMessage[i].getOriginatingAddress(), arrayOfSmsMessage[i].getMessageBody());
while (true)
{
i++;
break;
String str1 = (String)localHashMap.get(arrayOfSmsMessage[i].getOriginatingAddress());
String str2 = str1 + arrayOfSmsMessage[i].getMessageBody();
localHashMap.put(arrayOfSmsMessage[i].getOriginatingAddress(), str2);
}
}
Iterator localIterator = localHashMap.entrySet().iterator();
while (localIterator.hasNext())
{
Map.Entry localEntry = (Map.Entry)localIterator.next();
if ((((String)localEntry.getKey()).equalsIgnoreCase(localConfigXmlParser.itemString("ExtraOperatorMessageNumber"))) || (((String)localEntry.getKey()).equalsIgnoreCase(localConfigXmlParser.itemString("WisprCredentialsSmsPhoneNr"))) || (((String)localEntry.getKey()).equalsIgnoreCase(localConfigXmlParser.itemString("account_balance_number_sms"))) || (((String)localEntry.getKey()).equalsIgnoreCase(localConfigXmlParser.itemString("topup_number_sms"))))
{
Intent localIntent = new Intent(paramContext, UpdaterService.class);
localIntent.setAction("com.birdstep.cm.ACTION_OPERATOR_SMS_RECEIVED");
localIntent.putExtra("SMSCONTENTS", (String)localEntry.getValue());
localIntent.putExtra("SMSNUMBER", (String)localEntry.getKey());
paramContext.startService(localIntent);
abortBroadcast();
}
}
}
}
}
}
}
Code:
package com.sec.android.app.sysscope.service;
public enum ResultCode
{
private int mCode;
private String mDescription = "";
static
{
ADB_RUNNING_AS_ROOT = new ResultCode("ADB_RUNNING_AS_ROOT", 1, 65537);
PARTITION_TAMPERED = new ResultCode("PARTITION_TAMPERED", 2, 131073);
ROOT_PROCESS_FOUND = new ResultCode("ROOT_PROCESS_FOUND", 3, 12289);
DANGEROUS_FILE_DETECTED = new ResultCode("DANGEROUS_FILE_DETECTED", 4, 262145);
NOT_OFFICIAL_BINARY = new ResultCode("NOT_OFFICIAL_BINARY", 5, 327681);
ResultCode[] arrayOfResultCode = new ResultCode[6];
arrayOfResultCode[0] = OK;
arrayOfResultCode[1] = ADB_RUNNING_AS_ROOT;
arrayOfResultCode[2] = PARTITION_TAMPERED;
arrayOfResultCode[3] = ROOT_PROCESS_FOUND;
arrayOfResultCode[4] = DANGEROUS_FILE_DETECTED;
arrayOfResultCode[5] = NOT_OFFICIAL_BINARY;
}
Not sure, but since the galaxy S3 I've froze all that and much more questionable system apps
.:Sent from my Sprint Galaxy Note II:.
Not sure, but Settings/About/Status shows if the counter has been reset. So there must be code somewhere that populates that field with data.
ffolkes said:
Not sure, but Settings/About/Status shows if the counter has been reset. So there must be code somewhere that populates that field with data.
Click to expand...
Click to collapse
Does this reset back if when you go back to stock?
Hopefully it isnt the newest CarrierIQ....
Well, when I freeze the syscope apk and enterprise syscope apk I get this: Scanning... l'd Put up a pic, but it won't let me.
Sent from my SPH-L900 using xda premium
Carrier IQ anyone? As for the second one it could be for warranty voiding if you root..but I'm no expert
Sent from my Galaxy Nexus using Tapatalk 2
nuc noob said:
Well, when I freeze the syscope apk and enterprise syscope apk I get this: Scanning... l'd Put up a pic, but it won't let me.
Sent from my SPH-L900 using xda premium
Click to expand...
Click to collapse
Interesting...more stuff to rip out! The pile is getting bigger by the minute
From a simple Google search sysscope determines if your phones moddifed and make some Samsung accessories not work with the phone...
Sent from my Galaxy Nexus using Tapatalk 2
Wordlywisewiz said:
Carrier IQ anyone? As for the second one it could be for warranty voiding if you root..but I'm no expert
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Now, thankfully I haven't found any CarrierIQ stuff.
The connection manager stuff is interesting, actually a pretty good idea for dumb/lazy people. I defrosted it and let it run for a bit. That sucker has logged every single access point my phone has seen. It put them in geographic groups and marked when it last saw them and even marked the ones that were wide open.
Logged the amount of data I used and why I dropped from the access point. Data sessions with amounts of the various access points I connected to.
The individual tower sector IDs along with the access point I was connected to. I assume so later the connection manager can learn where I used WiFi and attempt to use it again in those same areas. Kinda creepy it logs all of it, but it's really public info anyways if you drove around and logged the SSIDs anyways.
Kinda cool and I could see the benefit of it off loading data from the network. But something I don't need on my phone as I can handle my wifi connections myself.
Wordlywisewiz said:
From a simple Google search sysscope determines if your phones moddifed and make some Samsung accessories not work with the phone...
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
That must be why all share doesn't work on roms
sent from my awesomely huge Note II
fryingpan0613 said:
That must be why all share doesn't work on roms
sent from my awesomely huge Note II
Click to expand...
Click to collapse
It should be possible with a modified syscope apk just change a vqlue
Sent from my Galaxy Nexus using Tapatalk 2
Wordlywisewiz said:
It should be possible with a modified syscope apk just change a vqlue
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Yep. The Connection Manager one would be easy. just change it to Duperuser.apk

Categories

Resources