0

I tried to edit source code of an app which is used to locate servants It has a function or parameter "isFromMockProvider()" I guess this one is the culprit I want to bypass it So that App could not know that I am using Mock location I am a python dev not know enough about Smali Please Help.. Thank You..

    .line 106
invoke-virtual {p0}, Landroid/location/Location;->isFromMockProvider()Z

move-result p0

const-string v1, "mocked"

invoke-interface {v0, v1, p0}, Lcom/facebook/react/bridge/WritableMap;->putBoolean(Ljava/lang/String;Z)V

:cond_61
return-object v0

.end method

Ninja
  • 11
  • 1

2 Answers2

0

Try replacing your lines with this

line 106
invoke-virtual {p0}, Landroid/location/Location;->isFromMockProvider()Z

move-result p0

const-string v1, "mocked"

const/4 v2, 0x0

invoke-interface {v0, v1, v2}, Lcom/facebook/react/bridge/WritableMap;->putBoolean(Ljava/lang/String;Z)V

:cond_61
return-object v0

Here I initialised another boolean (Z) variable v2 with false (0x0) and put it instead of p0 in putBoolean function call.

But I don't know if your original function has space for another register (v2). So check if .locals or .registers is more then 3.

Usually .locals N is first line in your function. Where N means that you can use N-1 registers name.

.method public static contains(Ljava/lang/String;)Z
    .locals 1

    const/4 v0, 0x0  # - GOOD
    const/4 v1, 0x0  # - BAD. WE NEED TO WRITE .locals 2 to use v1 register
    const/4 v2, 0x0  # - BAD. WE NEED TO WRITE .locals 3 to use v1 register

0

You should delete some lines related to isFromMockProvider()Z, just like this:

.line 106

sget-object p0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;

invoke-interface {v0, v1, p0}, Lcom/fa. . . . . . .

:cond_61 . . . . . . . .

leon
  • 1
  • 1