Book Image

Hacking Android

By : Mohammed A. Imran, Rao Kotipalli
Book Image

Hacking Android

By: Mohammed A. Imran, Rao Kotipalli

Overview of this book

With the mass explosion of Android mobile phones in the world, mobile devices have become an integral part of our everyday lives. Security of Android devices is a broad subject that should be part of our everyday lives to defend against ever-growing smartphone attacks. Everyone, starting with end users all the way up to developers and security professionals should care about android security. Hacking Android is a step-by-step guide that will get you started with Android security. You’ll begin your journey at the absolute basics, and then will slowly gear up to the concepts of Android rooting, application security assessments, malware, infecting APK files, and fuzzing. On this journey you’ll get to grips with various tools and techniques that can be used in your everyday pentests. You’ll gain the skills necessary to perform Android application vulnerability assessment and penetration testing and will create an Android pentesting lab.
Table of Contents (12 chapters)
11
Index

Shared preferences

Let's launch the FourGoats app and register a new user using the register option. Once created, login using the credentials, I have used username as test and test as its password, as shown following:

Shared preferences

Shared Preferences are created using the SharedPreferences class. Below is the piece of code used to store the username and password in the credentials.xml file:

public void saveCredentials(String paramString1, String paramString2)
  {
    SharedPreferences.Editor localEditor = getSharedPreferences("credentials", 1).edit();
    localEditor.putString("username", paramString1);
    localEditor.putString("password", paramString2);
    localEditor.putBoolean("remember", true);
    localEditor.commit();
  }

As discussed earlier, the app directory stores the shared preferences:

/data/data/<package name>/shared_prefs/<filename.xml>

So, let's browse and inspect the above path to see if there are any shared preferences created...