
Now, let’s create a new class with the name BypassLogin. MS.hookMethod can be used to make desired changes to our target method.įor more details about what these methods do and how they work, please refer here and here. MS.hookClassLoad can be used to detect the classes of our interested when loaded. There are two important functions that we are going to use to achieve this. We need to write the actual implementation to hook into our target method that is responsible for validating the user credentials and then modify its definition. We need to add meta-data element within the application section.First, we need to request permission.We need to add two entries in AndroidManifest.xml file as highlighted in the code below. That’s a perfect test bed for us to write a Cydia extension in a way that the app always returns true regardless of the user input.Ĭlass name: Īs shown in the Cydia Substrate documentation here, lets first set up our AndroidManifest.xml file. If the user entered credentials are matching, the app is returning a boolean value true and then redirecting the user to a private activity. If(ntentEquals(uname) & ntentEquals(pass))Īs you can see in the above code snippet, the app is getting the username and password from the user and then comparing it against the values stored in SharedPreferences. String pass=pref.getString(“password”,null) String uname=pref.getString(“username”,null)

Public boolean isValidLogin(String username, String password) Toast.makeText(getApplicationContext(), “Invalid Username or password”, Toast.LENGTH_LONG).show()

Intent in=new Intent(getApplicationContext(),Welcome.class)
#Gmail hack cydia how to
To keep the things simple, I am showing the original source as the idea here is to understand how to write Cydia Substrate extension assuming that we have access to the application’s logic.įollowing is the code snippet for Login.java
#Gmail hack cydia apk
We can decompile the APK and get the Java version of the code to understand the logic. Obviously, we first need to understand the application’s logic before proceeding with the Substrate extension. Our goal is to bypass this login by writing a Cydia Substrate extension. When the user enters invalid credentials, an error will be thrown as shown in the figure below. Following is our target app’s first activity. Like every other article of mine, we will have a vulnerable app here and then we will exploit it using this Cydia Substrate extension. Now, Let’s start writing the Substrate extension.
#Gmail hack cydia android
