-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
165 additions
and
41 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package com.chrxw.purenga.hook | ||
|
||
import com.chrxw.purenga.utils.Log | ||
import de.robv.android.xposed.XC_MethodReplacement | ||
import de.robv.android.xposed.XposedHelpers | ||
|
||
|
||
/** | ||
* 广告钩子 | ||
*/ | ||
class AdHook(classLoader: ClassLoader) : BaseHook(classLoader) { | ||
override fun startHook() { | ||
try { | ||
val clsB = XposedHelpers.findClass( | ||
"com.nga.admodule.AdManager\$b", | ||
mClassLoader | ||
) | ||
XposedHelpers.findAndHookMethod( | ||
clsB, | ||
"onAdLoad", | ||
object : XC_MethodReplacement() { | ||
@Throws(Throwable::class) | ||
override fun replaceHookedMethod(param: MethodHookParam) { | ||
Log.i("onAdLoad ") | ||
} | ||
} | ||
) | ||
XposedHelpers.findAndHookMethod( | ||
clsB, | ||
"onAdShow", | ||
object : XC_MethodReplacement() { | ||
@Throws(Throwable::class) | ||
override fun replaceHookedMethod(param: MethodHookParam) { | ||
Log.i("onAdShow ") | ||
} | ||
} | ||
) | ||
|
||
val clsD = XposedHelpers.findClass( | ||
"com.nga.admodule.AdManager\$d", | ||
mClassLoader | ||
) | ||
XposedHelpers.findAndHookMethod( | ||
clsD, | ||
"onAdLoad", | ||
object : XC_MethodReplacement() { | ||
@Throws(Throwable::class) | ||
override fun replaceHookedMethod(param: MethodHookParam) { | ||
Log.i("onAdLoad ") | ||
} | ||
} | ||
) | ||
XposedHelpers.findAndHookMethod( | ||
clsD, | ||
"onAdShow", | ||
object : XC_MethodReplacement() { | ||
@Throws(Throwable::class) | ||
override fun replaceHookedMethod(param: MethodHookParam) { | ||
Log.i("onAdShow ") | ||
} | ||
} | ||
) | ||
|
||
|
||
} catch (e: Exception) { | ||
Log.e(e) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.chrxw.purenga.hook | ||
|
||
import com.chrxw.purenga.utils.Log | ||
import de.robv.android.xposed.XC_MethodHook | ||
import de.robv.android.xposed.XposedHelpers | ||
|
||
/** | ||
* Vip钩子 | ||
*/ | ||
class VipHook(classLoader: ClassLoader) : BaseHook(classLoader) { | ||
override fun startHook() { | ||
try { | ||
// Hook getIsVip 方法 | ||
XposedHelpers.findAndHookMethod( | ||
"com.donews.nga.vip.entitys.VipStatus", | ||
mClassLoader, | ||
"getIsVip", | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun beforeHookedMethod(param: MethodHookParam?) { | ||
Log.d("getIsVip") | ||
super.beforeHookedMethod(param) | ||
} | ||
|
||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam?) { | ||
Log.d("getIsVip " + param?.result.toString()) | ||
param?.result = true | ||
super.afterHookedMethod(param) | ||
} | ||
} | ||
) | ||
|
||
XposedHelpers.findAndHookMethod( | ||
"gov.pianzong.androidnga.model.UserInfoDataBean", | ||
mClassLoader, | ||
"getAdfree", | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun beforeHookedMethod(param: MethodHookParam) { | ||
Log.d("getAdfree") | ||
super.beforeHookedMethod(param) | ||
} | ||
|
||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
Log.d("getAdfree " + param.result.toString()) | ||
super.afterHookedMethod(param) | ||
} | ||
} | ||
) | ||
|
||
|
||
} catch (e: Exception) { | ||
Log.e(e) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
plugins { | ||
id 'com.android.application' version '7.4.0' apply false | ||
id 'com.android.library' version '7.4.0' apply false | ||
id 'com.android.application' version '8.0.2' apply false | ||
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Jan 19 10:26:43 CST 2023 | ||
#Mon Jul 03 10:04:11 CST 2023 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |