mirror of
https://github.com/PaiGramTeam/GetToken.git
synced 2024-11-21 14:38:24 +00:00
fix: get device id
This commit is contained in:
parent
aadb4e38b2
commit
e00ea6f28c
@ -48,7 +48,6 @@ class ModuleMain : IXposedHookLoadPackage, IXposedHookZygoteInit {
|
|||||||
override fun afterHookedMethod(p: MethodHookParam) {
|
override fun afterHookedMethod(p: MethodHookParam) {
|
||||||
val app = p.args[0] as Application
|
val app = p.args[0] as Application
|
||||||
AppUtils.init(classLoader)
|
AppUtils.init(classLoader)
|
||||||
DeviceManager.init(classLoader, app.applicationContext)
|
|
||||||
AccountManager.init(classLoader)
|
AccountManager.init(classLoader)
|
||||||
appendToClassPath(app.applicationContext)
|
appendToClassPath(app.applicationContext)
|
||||||
}
|
}
|
||||||
@ -68,6 +67,7 @@ class ModuleMain : IXposedHookLoadPackage, IXposedHookZygoteInit {
|
|||||||
tokenBtn.scaleType = ImageView.ScaleType.FIT_XY
|
tokenBtn.scaleType = ImageView.ScaleType.FIT_XY
|
||||||
tokenBtn.setOnClickListener {
|
tokenBtn.setOnClickListener {
|
||||||
if (AccountManager.isLogin) {
|
if (AccountManager.isLogin) {
|
||||||
|
DeviceManager.init(classLoader, ctx)
|
||||||
if (isPatch) {
|
if (isPatch) {
|
||||||
val intent = Intent(ctx, LoaderActivity::class.java)
|
val intent = Intent(ctx, LoaderActivity::class.java)
|
||||||
intent.putExtra("accountInfo", AccountManager.accountInfo)
|
intent.putExtra("accountInfo", AccountManager.accountInfo)
|
||||||
|
@ -10,22 +10,19 @@ object DeviceManager {
|
|||||||
|
|
||||||
private lateinit var context: Context
|
private lateinit var context: Context
|
||||||
private lateinit var riskManager: Any
|
private lateinit var riskManager: Any
|
||||||
private lateinit var deviceUtils: Any
|
private lateinit var deviceId: String
|
||||||
|
|
||||||
fun init(cl: ClassLoader, ctx: Context) {
|
fun init(cl: ClassLoader, ctx: Context) {
|
||||||
context = ctx
|
context = ctx
|
||||||
riskManager = cl
|
riskManager = cl
|
||||||
.loadClass("com.mihoyo.platform.account.sdk.risk.RiskManager")
|
.loadClass("com.mihoyo.platform.account.sdk.risk.RiskManager")
|
||||||
.visitStaticField<Any>("INSTANCE")
|
.visitStaticField<Any>("INSTANCE")
|
||||||
deviceUtils = cl
|
val preDevice = ctx.getSharedPreferences("pre_device.xml", 0)
|
||||||
.loadClass("com.mihoyo.platform.account.sdk.utils.DeviceUtils")
|
deviceId = preDevice.getString("device_id", "").toString()
|
||||||
.visitStaticField<Any>("INSTANCE")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val deviceFp get() = riskManager.invokeMethod<String>("getDeviceFp")
|
val deviceFp get() = riskManager.invokeMethod<String>("getDeviceFp")
|
||||||
|
|
||||||
val deviceId get() = deviceUtils.invokeMethod<Context, String>("getDeviceID", context)
|
|
||||||
|
|
||||||
val deviceInfo get() = DeviceInfo(deviceId, deviceFp)
|
val deviceInfo get() = DeviceInfo(deviceId, deviceFp)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user