ex 3 flag 1,2,4 done
This commit is contained in:
@@ -3,6 +3,7 @@ package com.example.justask;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@@ -12,10 +13,10 @@ import java.util.ArrayList;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
// FLAG 1:
|
||||
// FLAG 1: FLAG{Gutta_cavat_
|
||||
// FLAG 2: lapidem_non_vi
|
||||
// FLAG 3:
|
||||
// FLAG 4:
|
||||
// FLAG 4: _cadendo}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -23,8 +24,21 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// "com.example.victimapp/.PartOne"
|
||||
Intent callIntent = new Intent("com.example.victimapp.intent.action.JUSTASK");
|
||||
startActivityForResult(callIntent, 0);
|
||||
|
||||
Intent callIntent1 = new Intent();
|
||||
callIntent1.setComponent(ComponentName.unflattenFromString("com.example.victimapp/.PartOne"));
|
||||
startActivityForResult(callIntent1, 1);
|
||||
|
||||
|
||||
Intent callIntent2 = new Intent("com.example.victimapp.intent.action.JUSTASK");
|
||||
startActivityForResult(callIntent2, 2);
|
||||
|
||||
Intent callIntent3 = new Intent();
|
||||
callIntent3.setComponent(ComponentName.unflattenFromString("com.example.victimapp/.PartThree"));
|
||||
startActivityForResult(callIntent3, 1);
|
||||
|
||||
Intent callIntent4 = new Intent("com.example.victimapp.intent.action.JUSTASKBUTNOTSOSIMPLE");
|
||||
startActivityForResult(callIntent4, 4);
|
||||
|
||||
// Intent resultIntent = new Intent();
|
||||
// setResult(Activity.RESULT_OK, resultIntent);
|
||||
@@ -40,30 +54,30 @@ public class MainActivity extends AppCompatActivity {
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
Log.d("MOBIOTSEC", "code: "+ resultCode);
|
||||
if (requestCode == 0) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
Log.d("MOBIOTSEC", "> Part Code: "+ resultCode);
|
||||
|
||||
Log.d("MOBIOTSEC", "res: " + data.getExtras().toString());
|
||||
// do your task
|
||||
|
||||
} else if (resultCode == RESULT_CANCELED) {
|
||||
// do your task
|
||||
Log.d("MOBIOTSEC", "error");
|
||||
}
|
||||
else
|
||||
{
|
||||
Bundle extra = data.getExtras();
|
||||
|
||||
/*for (String key: extra.keySet())
|
||||
/*
|
||||
for (String key: extra.keySet())
|
||||
{
|
||||
Log.d ("MOBIOTSEC", key + " is a key in the bundle");
|
||||
}*/
|
||||
|
||||
Log.d("MOBIOTSEC", "Last");
|
||||
Log.d("MOBIOTSEC", "res: " + extra.getString("flag"));
|
||||
}
|
||||
if(resultCode == 4) {
|
||||
|
||||
int count = 1;
|
||||
String currentVar = "follow";
|
||||
while(!currentVar.equals("never ending story")) {
|
||||
extra = extra.getBundle(currentVar);
|
||||
currentVar = extra.keySet().iterator().next();
|
||||
count++;
|
||||
Log.d ("MOBIOTSEC", currentVar + " is a key in the bundle "+count);
|
||||
}
|
||||
|
||||
Log.d("MOBIOTSEC", ">> FLAG (follow the value... 6 TIMES RLY?): " + extra.getString("never ending story"));
|
||||
} else {
|
||||
Log.d("MOBIOTSEC", ">> FLAG: " + extra.getString("flag"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,2 @@
|
||||
--------- beginning of system
|
||||
--------- beginning of main
|
||||
03-11 09:46:22.771 12254 12254 D MOBIOTSEC: code: 2
|
||||
03-11 09:46:22.771 12254 12254 D MOBIOTSEC: Last
|
||||
03-11 09:46:22.771 12254 12254 D MOBIOTSEC: res: lapidem_non_vi
|
||||
--------- beginning of system
|
||||
|
||||
Reference in New Issue
Block a user