Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
R
ratelvirtuallocation
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ratel-modules
ratelvirtuallocation
Commits
b27b4934
Commit
b27b4934
authored
Apr 20, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.3 强制定位成功
parent
681838b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
build.gradle
app/build.gradle
+2
-2
XPosedPlugin.java
...ain/java/top/littlerich/virtuallocation/XPosedPlugin.java
+24
-0
No files found.
app/build.gradle
View file @
b27b4934
...
...
@@ -8,8 +8,8 @@ android {
applicationId
"com.virjar.ratel.virtuallocation"
minSdkVersion
19
targetSdkVersion
28
versionCode
202104
19
versionName
"v1.
2
"
versionCode
202104
20
versionName
"v1.
3
"
archivesBaseName
=
"JDY_${versionName}"
.
replace
(
' '
,
'_'
)
ndk
{
abiFilters
"armeabi-v7a"
,
"arm64-v8a"
//, "x86","arm64-v8a","x86_64"
...
...
app/src/main/java/top/littlerich/virtuallocation/XPosedPlugin.java
View file @
b27b4934
...
...
@@ -20,6 +20,7 @@ import org.json.JSONObject;
import
java.io.File
;
import
java.io.IOException
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Proxy
;
...
...
@@ -367,12 +368,35 @@ public class XPosedPlugin implements IRposedHookLoadPackage {
// public void setAddress(String var1) {
try
{
RposedHelpers
.
callMethod
(
obj
,
"setAddress"
,
AppApplication
.
mockGPS
.
address
);
Integer
errorCode
=
(
Integer
)
RposedHelpers
.
callMethod
(
obj
,
"getErrorCode"
);
if
(
errorCode
!=
0
)
{
// 高德返回了错误,我们这里把他覆盖为成功
RposedHelpers
.
callMethod
(
obj
,
"setErrorInfo"
,
""
);
// 比较麻烦,这里看如果写如果,第二次写入无法生效,但是由于混淆,属性名称不定,无法直接反射
for
(
Field
field
:
obj
.
getClass
().
getDeclaredFields
())
{
if
(!
field
.
getType
().
equals
(
int
.
class
))
{
continue
;
}
field
.
setAccessible
(
true
);
int
anInt
=
field
.
getInt
(
obj
);
if
(
anInt
==
errorCode
)
{
Log
.
i
(
TAG
,
"find int field: "
+
field
);
field
.
set
(
obj
,
0
);
}
}
RposedHelpers
.
callMethod
(
obj
,
"setErrorCode"
,
0
);
}
}
catch
(
Throwable
throwable
)
{
Log
.
w
(
TAG
,
"error"
,
throwable
);
throwable
.
printStackTrace
();
}
}
}
Log
.
i
(
TAG
,
"call method: "
+
method
+
" param: "
+
args
[
0
]);
return
RposedHelpers
.
callMethod
(
originListener
,
method
.
getName
(),
args
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment