Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Introduction
- While testing some android apps on an emulator it shows that the app is not compatible with CPU or getting some error while installing the app on your emulator
- i will show you how to bypass that easily
- Notice
- This may not working with some apps and you will have to use another technic … this is just the common way… be smart
- Getting Ready
- Ok now you should decompile your android app to the source code using (jadx or jd-gui) and smali byte code using (apktool)
- Start
- First you need to check the the pre-decompiled source code and check for functions that contains strings like “generic | emulator | google_sdk” and functions like “isEmulator | emulatorDetection…etc” … use your searching skills and read the code well!
- As you can see there is a method called “checkIfDeviceIsEmulator” that checks for “finger print | model | brand” and strings like “genymotion | emulator”
- If you notice … this function return true statement if it detects the emulator and return false if not emulator :face_with_raised_eyebrow:
- Ok i think you get it now
- The Fun Part
- Now we should change these value from true to false to bypass this detection… but we can’t edit the source code… Actually you can’t recompile and use this source code again… but you can do this in the smali code :upside_down_face:
- ok lets do this…
- Go to the same file name in smali code and search for the same strings you found in the source code till you get the line num!
- As you can see the strings we saw in the source code before
- scroll down until you get this instruction (“const/4 v0, 0x1”)
- which mean that return true statement to the method (explained it in easy way) … and hex value 0x1 in smali byte code means true so we will change it from 0x1 to 0x0!
- Now we are done and you can recompile the smali byte code and use test the app on your emulator.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement