Last active
July 11, 2019 10:07
-
-
Save Areizen/c1a50417606e8aaafa0c48b6eeba4dcc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceFinaleField(object, fieldName, value){ | |
var field = object.class.getDeclaredField(fieldName) | |
field.setAccessible(true) | |
field.set(null, value) | |
} | |
Java.perform(function(){ | |
// Class containing const that we want to modify | |
const Build = Java.use("android.os.Build") | |
// reflection class for changing const | |
const Field = Java.use('java.lang.reflect.Field') | |
const Class = Java.use('java.lang.Class') | |
// Replacing Build static fields | |
replaceFinaleField(Build, "FINGERPRINT", "abcd/C1505:4.1.1/11.3.A.2.13:user/release-keys") | |
replaceFinaleField(Build, "MODEL", "C1505") | |
replaceFinaleField(Build, "MANUFACTURER", "Sony") | |
replaceFinaleField(Build, "BRAND", "Xperia") | |
replaceFinaleField(Build, "BOARD", "7x27") | |
replaceFinaleField(Build, "ID", "11.3.A.2.13") | |
replaceFinaleField(Build, "SERIAL", "abcdef123") | |
replaceFinaleField(Build, "TAGS", "release-keys") | |
replaceFinaleField(Build, "USER", "administrator") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment