0

I'm trying to modify an existing App. Currently this is one action of this App which when chosen will bring out the Wireless & Network setting page. I used APKTOOL to get the smali and located the code:

.line 238
new-instance p5, Landroid/content/Intent;

const-string p7, "android.settings.WIRELESS_SETTINGS"

.end local p7
invoke-direct {p5, p7}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

I'm trying to make it instead of calling the setting page it would call my own app. Unfortunately I couldn't disassemble the whole class, but I got the following

var10_10.bitmap = WidgetItem.loadFunctionIcon((Context)var1_1, (String)var8_8, (boolean)var6_6, (boolean)var7_7);
var10_10.pendingIntent = PendingIntent.getActivity((Context)var1_1, (int)0, (Intent)new Intent("android.settings.WIRELESS_SETTINGS"), (int)134217728);
var11_11 = true;

I tried to replace the smali code from

const-string p7, "android.settings.WIRELESS_SETTINGS"

to

const-string p7, "com.mycompany.myapp"

or

const-string p7, "com.mycompany.myapp@com.mycompany.myapp.MainActivity"

but both did not work. What should I put there for it to call my app?

ByteHamster
  • 4,884
  • 9
  • 38
  • 53
dohanin
  • 11
  • 6
  • whatever the string u put, have u tried to have an intent filter/receiver for that action? never mind the package, just put there "tweedledeedle" and listen for that – eduyayo Mar 11 '15 at 14:26
  • thanks for your hint. now i look at the other part of the code and found: var26_23 = new Intent("android.intent.action.MAIN"); var26_23.addCategory("android.intent.category.LAUNCHER"); var26_23.setFlags(270532608); var26_23.setComponent(new ComponentName(var8_8, var9_9)); } else { var26_23 = var0.getLaunchIntentForPackage(var8_8); } var10_10.pendingIntent = PendingIntent.getActivity((Context)var1_1, (int)0, (Intent)var26_23, (int)134217728); i think i need to replicate this.... – dohanin Mar 11 '15 at 16:12

1 Answers1

0

After modifying the following, it works!

From

var10_10.pendingIntent = PendingIntent.getActivity((Context)var1_1, (int)0, (Intent)new Intent("android.settings.WIRELESS_SETTINGS"), (int)134217728);

To

var53_15 = new Intent("android.intent.action.MAIN");
var53_15.addCategory("android.intent.category.LAUNCHER");
var53_15.setFlags(270532608);
var8_8 = "com.mycompany.myapp";
var9_9 = "com.mycompany.myapp.MainActivity";
var53_15.setComponent(new ComponentName(var8_8, var9_9));
var10_10.pendingIntent = PendingIntent.getActivity((Context)var1_1, (int)0, (Intent)var53_15, (int)134217728);
dohanin
  • 11
  • 6