aber meine Frage ist, was hier der Unterschied zwischen intent und getIntent() in onActivityResult ist Die Absicht in onActivityResult ist mein intent_result_flag12, das die Ergebnisdaten sendet, wenn die Absicht aufgerufen wird. aber was ist getIntent() in onActivityResult?
Dekompilierte Challenge-App:
Code: Select all
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.f = new LogHelper(this);
if (getIntent().getAction() == null) {
Toast.makeText(this, "Sending implicit intent to\nio.hextree.attacksurface.ATTACK_ME", 1).show();
Intent intent = new Intent("io.hextree.attacksurface.ATTACK_ME");
intent.addFlags(8);
try {
startActivityForResult(intent, 42);
} catch (RuntimeException e) {
e.printStackTrace();
Toast.makeText(this, "No app found to handle the intent\nio.hextree.attacksurface.ATTACK_ME", 1).show();
finish();
}
}
}
@Override
protected void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (intent == null || getIntent() == null || !getIntent().getBooleanExtra("LOGIN", false)) {
return;
}
this.f.addTag("LOGIN");
if (intent.getIntExtra("token", -1) == 1094795585) {
this.f.addTag(1094795585);
success(this);
}
}
Code: Select all
Intent intent = getIntent();
Intent intent_result_flag12 = new Intent();
Intent intent_extra = new Intent();
intent_extra.putExtra("LOGIN", false);
intent_result_flag12.putExtra("token", 1094795585);
intent_result_flag12.putExtras(intent_extra);
setResult(RESULT_OK, intent_result_flag12);
finish();
Code: Select all