Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RatelExtension
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
RatelExtension
Commits
bd6e59e9
Commit
bd6e59e9
authored
Aug 15, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
3719a922
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
JustTrustMe.java
...main/java/com/virjar/ratel/api/extension/JustTrustMe.java
+13
-17
No files found.
src/main/java/com/virjar/ratel/api/extension/JustTrustMe.java
View file @
bd6e59e9
...
...
@@ -117,31 +117,27 @@ public class JustTrustMe {
}
}
private
static
boolean
hasAndroidRootTrustManager
=
false
;
private
static
void
trustAndroidRootTrustManager
()
{
Class
<?>
rootTrustManagerClass
;
try
{
Class
.
forName
(
"android.security.net.config.RootTrustManager"
,
false
,
RatelToolKit
.
hostClassLoader
);
rootTrustManagerClass
=
ClassLoader
.
getSystemClassLoader
().
loadClass
(
"android.security.net.config.RootTrustManager"
);
}
catch
(
Throwable
throwable
)
{
return
;
}
hasAndroidRootTrustManager
=
true
;
hookIfClassExist
(
"android.security.net.config.RootTrustManager"
,
new
ClassExistEvent
()
{
@Override
public
void
onClassFind
(
Class
clazz
)
{
for
(
Method
method
:
clazz
.
getDeclaredMethods
())
{
if
(
method
.
getName
().
equals
(
"checkServerTrusted"
)
&&
method
.
getReturnType
().
equals
(
Void
.
class
))
{
RposedBridge
.
hookMethod
(
method
,
new
RC_MethodReplacement
()
{
@Override
protected
Object
replaceHookedMethod
(
MethodHookParam
param
)
throws
Throwable
{
return
null
;
}
});
for
(
Method
method
:
rootTrustManagerClass
.
getDeclaredMethods
())
{
if
(
method
.
getName
().
equals
(
"checkServerTrusted"
)
&&
method
.
getReturnType
().
equals
(
Void
.
TYPE
))
{
RposedBridge
.
hookMethod
(
method
,
new
RC_MethodReplacement
()
{
@Override
protected
Object
replaceHookedMethod
(
MethodHookParam
param
)
throws
Throwable
{
Log
.
i
(
"weijia"
,
"checkServerTrusted"
,
new
Throwable
());
return
null
;
}
}
}
);
}
}
);
}
}
private
static
void
trustApache
()
{
...
...
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