Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
H
HookNotify
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
steve
HookNotify
Commits
e5396cd1
Commit
e5396cd1
authored
Feb 24, 2022
by
steve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增取得 context 方式
parent
07480384
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
5 deletions
+23
-5
vcs.xml
.idea/vcs.xml
+7
-0
LogSaveUnit.kt
app/src/main/java/com/go/hookNotify/units/LogSaveUnit.kt
+0
-1
HookGlobalNotify.java
...main/java/com/go/hookNotify/xp/code/HookGlobalNotify.java
+15
-4
HookSimBoxNotify.java
...main/java/com/go/hookNotify/xp/code/HookSimBoxNotify.java
+1
-0
No files found.
.idea/vcs.xml
0 → 100644
View file @
e5396cd1
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
app/src/main/java/com/go/hookNotify/units/LogSaveUnit.kt
View file @
e5396cd1
...
...
@@ -34,7 +34,6 @@ object LogSaveUnit {
}
/**
* android 版本 0..28(小於29)
* 檢查文件是否存在
...
...
app/src/main/java/com/go/hookNotify/xp/code/HookGlobalNotify.java
View file @
e5396cd1
package
com
.
go
.
hookNotify
.
xp
.
code
;
import
android.app.AndroidAppHelper
;
import
android.app.Notification
;
import
android.content.Context
;
import
android.os.Bundle
;
import
com.go.hookNotify.units.LogSaveUnit
;
...
...
@@ -16,24 +18,33 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage;
public
class
HookGlobalNotify
implements
IXposedHookLoadPackage
{
private
final
String
[]
mAryStrBlackList
=
new
String
[]{
"com.ucloudlink.simbox"
};
private
Context
mContext
=
null
;
@Override
public
void
handleLoadPackage
(
XC_LoadPackage
.
LoadPackageParam
lpparam
)
throws
Throwable
{
final
Class
clazz
=
XposedHelpers
.
findClass
(
"android.app.NotificationManager"
,
lpparam
.
classLoader
);
XPoseDebugUnit
.
xPoseLogInfo
(
"android hook NotificationManager start init!!"
+
clazz
.
getName
());
XposedHelpers
.
findAndHookMethod
(
clazz
,
"notify"
,
String
.
class
,
int
.
class
,
Notification
.
class
,
new
XC_MethodHook
()
{
@Override
protected
void
beforeHookedMethod
(
MethodHookParam
param
)
throws
Throwable
{
mContext
=
AndroidAppHelper
.
currentApplication
();
XPoseDebugUnit
.
xPoseLogInfo
(
mContext
.
toString
());
super
.
beforeHookedMethod
(
param
);
}
@Override
protected
void
afterHookedMethod
(
MethodHookParam
param
)
throws
Throwable
{
super
.
afterHookedMethod
(
param
);
if
(
lpparam
==
null
)
return
;
if
(
checkBlackList
(
lpparam
.
packageName
))
{
XPoseDebugUnit
.
xPoseLogInfo
(
"黑名单
的
: "
+
lpparam
.
packageName
);
XPoseDebugUnit
.
xPoseLogInfo
(
"黑名单: "
+
lpparam
.
packageName
);
return
;
}
XPoseDebugUnit
.
xPoseLogInfo
(
"非黑名单
的
: "
+
lpparam
.
packageName
);
XPoseDebugUnit
.
xPoseLogInfo
(
"非黑名单: "
+
lpparam
.
packageName
);
Notification
notification
=
(
Notification
)
param
.
args
[
2
];
StringBuilder
sb
=
new
StringBuilder
();
...
...
@@ -53,7 +64,7 @@ public class HookGlobalNotify implements IXposedHookLoadPackage {
// String content = notification.extras.getString("android.text", "");
String
documentName
=
"log/"
+
title
;
LogSaveUnit
.
INSTANCE
.
saveLogFile
(
documentName
,
sb
.
toString
());
//
LogSaveUnit.INSTANCE.saveLogFile(documentName, sb.toString());
}
});
}
...
...
app/src/main/java/com/go/hookNotify/xp/code/HookSimBoxNotify.java
View file @
e5396cd1
package
com
.
go
.
hookNotify
.
xp
.
code
;
import
android.app.AndroidAppHelper
;
import
android.content.ContentValues
;
import
com.go.hookNotify.units.LogSaveUnit
;
...
...
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