Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save theblackturtle/3a053729c2ef2575fcc7c02f81acfef4 to your computer and use it in GitHub Desktop.
Save theblackturtle/3a053729c2ef2575fcc7c02f81acfef4 to your computer and use it in GitHub Desktop.

Revisions

  1. Areizen revised this gist Jul 10, 2019. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions change_build_information.js
    Original file line number Diff line number Diff line change
    @@ -12,9 +12,6 @@ Java.perform(function(){
    // reflection class for changing const
    const Field = Java.use('java.lang.reflect.Field')
    const Class = Java.use('java.lang.Class')
    const Boolean = Java.use("java.lang.Boolean")
    const True = Boolean.$new("True")
    const False = Boolean.$new("False")

    // Replacing Build static fields
    replaceFinaleField(Build, "FINGERPRINT", "abcd/C1505:4.1.1/11.3.A.2.13:user/release-keys")
  2. Areizen created this gist Jul 10, 2019.
    30 changes: 30 additions & 0 deletions change_build_information.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    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')
    const Boolean = Java.use("java.lang.Boolean")
    const True = Boolean.$new("True")
    const False = Boolean.$new("False")

    // 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")
    })