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
a524ee3f
Commit
a524ee3f
authored
Mar 16, 2022
by
steve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增-Hook登入前資料與登入後資料
parent
1ad269b2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
31 deletions
+75
-31
build.gradle
app/build.gradle
+2
-0
HookSimBoxNotify.java
...main/java/com/go/hookNotify/xp/code/HookSimBoxNotify.java
+73
-31
No files found.
app/build.gradle
View file @
a524ee3f
...
@@ -46,4 +46,6 @@ dependencies {
...
@@ -46,4 +46,6 @@ dependencies {
implementation
"androidx.core:core-ktx:+"
implementation
"androidx.core:core-ktx:+"
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
'com.google.code.gson:gson:2.9.0'
}
}
app/src/main/java/com/go/hookNotify/xp/code/HookSimBoxNotify.java
View file @
a524ee3f
...
@@ -8,7 +8,11 @@ import com.go.hookNotify.units.DateUnit;
...
@@ -8,7 +8,11 @@ import com.go.hookNotify.units.DateUnit;
import
com.go.hookNotify.units.LogSaveUnit
;
import
com.go.hookNotify.units.LogSaveUnit
;
import
com.go.hookNotify.units.XPoseDebugUnit
;
import
com.go.hookNotify.units.XPoseDebugUnit
;
import
com.go.hookNotify.xp.Constants
;
import
com.go.hookNotify.xp.Constants
;
import
com.google.gson.Gson
;
import
org.json.JSONObject
;
import
java.util.FormatFlagsConversionMismatchException
;
import
java.util.Map
;
import
java.util.Map
;
import
de.robv.android.xposed.IXposedHookLoadPackage
;
import
de.robv.android.xposed.IXposedHookLoadPackage
;
...
@@ -18,9 +22,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage;
...
@@ -18,9 +22,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage;
public
class
HookSimBoxNotify
implements
IXposedHookLoadPackage
{
public
class
HookSimBoxNotify
implements
IXposedHookLoadPackage
{
private
final
String
CLASS_HTTP_UTIL
=
"com.ucloudlink.simbox.http.HttpUtil"
;
private
final
String
CLASS_SIP_PHONE_UTIL
=
"com.ucloudlink.simbox.util.SipPhoneUtil"
;
private
final
String
CLASS_SIP_PHONE_UTIL
=
"com.ucloudlink.simbox.util.SipPhoneUtil"
;
private
final
String
CLASS_DEVICE_UTIL
=
"com.ucloudlink.simbox.util.DeviceUtil"
;
private
final
String
CLASS_DEVICE_UTIL
=
"com.ucloudlink.simbox.util.DeviceUtil"
;
private
final
String
CLASS_HTTP_SERVICE
=
"com.ucloudlink.sdk.http.HttpService"
;
private
final
String
CLASS_HTTP_UTIL_LOGIN_SDK_1
=
"com.ucloudlink.simbox.http.HttpUtil$loginSDK$1"
;
private
final
String
mNumber
=
"number"
;
private
final
String
mNumber
=
"number"
;
private
final
String
mImsi
=
"imsi"
;
private
final
String
mImsi
=
"imsi"
;
...
@@ -46,6 +51,73 @@ public class HookSimBoxNotify implements IXposedHookLoadPackage {
...
@@ -46,6 +51,73 @@ public class HookSimBoxNotify implements IXposedHookLoadPackage {
XPoseDebugUnit
.
xPoseLogInfo
(
"simBox start init!!"
);
XPoseDebugUnit
.
xPoseLogInfo
(
"simBox start init!!"
);
/*
* 登入前所帶入的參數
*/
XposedHelpers
.
findAndHookMethod
(
XposedHelpers
.
findClass
(
CLASS_HTTP_SERVICE
,
lpparam
.
classLoader
),
"loginV2"
,
"com.ucloudlink.sdk.http.request.LoginReq"
,
new
XC_MethodHook
()
{
@Override
protected
void
beforeHookedMethod
(
MethodHookParam
param
)
throws
Throwable
{
String
resultJson
=
new
Gson
().
toJson
(
param
.
args
[
0
]);
JSONObject
jsonObject
=
new
JSONObject
(
resultJson
);
//可能會用到
String
deviceType
=
jsonObject
.
getString
(
"deviceType"
);
//因為是 android 所以字串為 ANDROID
String
devsn
=
jsonObject
.
getString
(
"devsn"
);
//手機裝置本身的 唯一碼
String
imei
=
jsonObject
.
getString
(
"imei"
);
//跟imei一樣
String
userCode
=
jsonObject
.
getString
(
"userCode"
);
//使用者的手機號碼
String
partnerCode
=
jsonObject
.
getString
(
"partnerCode"
);
//幾乎每個api都會帶到, 都是一樣的
String
streamNo
=
jsonObject
.
getString
(
"streamNo"
);
//這個最好是寫成程式碼, 打api時取得當下的時間形成字串
//可能不會用到或看不懂的
String
autoLogin
=
jsonObject
.
getString
(
"autoLogin"
);
String
channelType
=
jsonObject
.
getString
(
"channelType"
);
String
clientId
=
jsonObject
.
getString
(
"clientId"
);
String
clientSecret
=
jsonObject
.
getString
(
"clientSecret"
);
String
countryCode
=
jsonObject
.
getString
(
"countryCode"
);
String
enterpriseCode
=
jsonObject
.
getString
(
"enterpriseCode"
);
String
ext
=
jsonObject
.
getString
(
"ext"
);
String
golcalmeAccount
=
jsonObject
.
getString
(
"golcalmeAccount"
);
String
hardwareVersion
=
jsonObject
.
getString
(
"hardwareVersion"
);
String
loginType
=
jsonObject
.
getString
(
"loginType"
);
String
mobileBrand
=
jsonObject
.
getString
(
"mobileBrand"
);
String
num
=
jsonObject
.
getString
(
"num"
);
String
password
=
jsonObject
.
getString
(
"password"
);
String
pushPlatform
=
jsonObject
.
getString
(
"pushPlatform"
);
String
sipType
=
jsonObject
.
getString
(
"sipType"
);
String
softVersion
=
jsonObject
.
getString
(
"softVersion"
);
String
systemVersion
=
jsonObject
.
getString
(
"systemVersion"
);
String
timestamp
=
jsonObject
.
getString
(
"timestamp"
);
String
token
=
jsonObject
.
getString
(
"token"
);
String
tokenType
=
jsonObject
.
getString
(
"tokenType"
);
XPoseDebugUnit
.
xPoseLogInfo
(
"resultJson="
+
resultJson
);
super
.
beforeHookedMethod
(
param
);
}
});
/*
* 登入成功後 取得的結果
*/
XposedHelpers
.
findAndHookMethod
(
XposedHelpers
.
findClass
(
CLASS_HTTP_UTIL_LOGIN_SDK_1
,
lpparam
.
classLoader
),
"onSuccess"
,
"com.ucloudlink.sdk.http.base.BSSResult"
,
new
XC_MethodHook
()
{
@Override
protected
void
beforeHookedMethod
(
MethodHookParam
param
)
throws
Throwable
{
String
resultJson
=
new
Gson
().
toJson
(
param
.
args
[
0
]);
JSONObject
data
=
new
JSONObject
(
resultJson
).
getJSONObject
(
"data"
);
JSONObject
userLoginVO
=
data
.
getJSONObject
(
"userLoginVO"
);
JSONObject
sipUserVO
=
data
.
getJSONObject
(
"sipUserVO"
);
String
userID
=
userLoginVO
.
getString
(
"userId"
);
//就是 loginCustomId
String
accessToken
=
userLoginVO
.
getString
(
"accessToken"
);
String
sipCode
=
sipUserVO
.
getString
(
"sipCode"
);
//就是 voipId
XPoseDebugUnit
.
xPoseLogInfo
(
"\n userId(loginCustomId)="
+
userID
+
"\n accessToken="
+
accessToken
+
"\n sipCode(voipId)="
+
sipCode
);
super
.
beforeHookedMethod
(
param
);
}
});
/*
/*
* 因为还有其他的api在使用同一组UUID, 所以替换位置更改为更上游的地方
* 因为还有其他的api在使用同一组UUID, 所以替换位置更改为更上游的地方
*/
*/
...
@@ -60,36 +132,6 @@ public class HookSimBoxNotify implements IXposedHookLoadPackage {
...
@@ -60,36 +132,6 @@ public class HookSimBoxNotify implements IXposedHookLoadPackage {
}
}
});
});
// /*
// * 解決 imei或是 deviceID 綁定手機設備問題
// */
// XposedHelpers.findAndHookMethod(XposedHelpers.findClass(CLASS_HTTP_UTIL, lpparam.classLoader), "loginSDK",
// String.class, String.class, String.class, String.class, String.class, String.class, "com.ucloudlink.sdk.http.callback.UKCallBack", new XC_MethodHook() {
// @Override
// protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
// String countryCode = param.args[0].toString();
// String userCode = param.args[1].toString();
// String passWord = param.args[2].toString();
// String deviceId = param.args[3].toString();
// String loginType = param.args[4].toString();
//
//
// XPoseDebugUnit.xPoseLogInfo(
// "countryCode=" + countryCode + "\n"
// + "userCode=" + userCode + "\n"
// + "passWord=" + passWord + "\n"
// + "deviceId=" + deviceId + "\n"
// + "loginType=" + loginType + "\n"
// );
//
// String replaceDeviceID = "ffffffff-f64a-fc73-ffff-ffffca01fdf4";
// XPoseDebugUnit.xPoseLogInfo("replaceDeiceID=" + replaceDeviceID);
// param.args[3] = replaceDeviceID;
//
// super.beforeHookedMethod(param);
// }
// });
/*
/*
* Hook 多卡寶通知推送的通知
* Hook 多卡寶通知推送的通知
*/
*/
...
...
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