change if-lt to if-ge

Active 1 Reply 415 Views 2019-11-20 11:59:01 Questions

I tried to make an application's custom path to pass the mock location check and find 4 classes. I work on classes4.dex, there is a code that will check the status of the mock location in it. 

.method public static d(Landroid/content/Context;)Z

   .registers 3


   .line 109

   sget v0, Landroid/os/Build$VERSION;->SDK_INT:I


   const/16 v1, 0x17


   if-lt v0, v1, :cond_8


   const/4 p0, 0x0


   return p0


   .line 113

   :cond_8

   invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;


   move-result-object p0


   const-string v0, "mock_location"


   invoke-static {p0, v0}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;


   move-result-object p0


   const-string v0, "1"


   invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z


   move-result p0


   return p0

.end method

I want to change if-lt to if-ge. how do I find the original parrent bytes (if-lt) and byte parrent replaced (if-ge) in these classes4.dex? can someone give me understanding to do it


Sharing is caring, show love and share the thread with your friends.


parax0ta replied
4 Years
You should try to use IDA 6.1+ to dissasemble .dex file (dalvik code) press Options -> General and you will see an option to type how many bytes you want too see from instruction and IDA pro will show you.. Then go for patching, change 5B to 5C (this is example lol)


Good luck

loading...