-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit f76a957
Showing
43 changed files
with
915 additions
and
0 deletions.
There are no files selected for viewing
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,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
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 @@ | ||
/build |
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,45 @@ | ||
plugins { | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.jetbrains.kotlin.android) | ||
} | ||
|
||
android { | ||
namespace 'com.xp.fxckvip' | ||
compileSdk 34 | ||
|
||
defaultConfig { | ||
applicationId "com.xp.fxckvip" | ||
minSdk 22 | ||
targetSdk 34 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
buildToolsVersion '34.0.0' | ||
} | ||
|
||
dependencies { | ||
compileOnly 'de.robv.android.xposed:api:82' | ||
// implementation libs.androidx.core.ktx | ||
// implementation libs.androidx.appcompat | ||
// implementation libs.material | ||
// testImplementation libs.junit | ||
// androidTestImplementation libs.androidx.junit | ||
// androidTestImplementation libs.androidx.espresso.core | ||
|
||
} |
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/java/com/xp/fxckvip/ExampleInstrumentedTest.kt
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,24 @@ | ||
package com.xp.fxckvip | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.xp.fxckvip", appContext.packageName) | ||
} | ||
} |
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,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:dataExtractionRules="@xml/data_extraction_rules" | ||
android:fullBackupContent="@xml/backup_rules" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
tools:targetApi="31"> | ||
<meta-data | ||
android:name="FxckVip" | ||
android:value="true"/> | ||
<!-- 模块的简介(在框架中显示) --> | ||
<meta-data | ||
android:name="xposeddescription" | ||
android:value="获取部分应用的VIP权限或去除广告(已适配:某茄小说、某猫小说)" /> | ||
<!-- 模块最低支持的Api版本 一般填54即可 --> | ||
<meta-data | ||
android:name="xposedminversion" | ||
android:value="54"/> | ||
<!-- 模块作用域 --> | ||
<meta-data | ||
android:name="xposedscope" | ||
android:resource="@array/xposedscope"/> | ||
</application> | ||
|
||
|
||
</manifest> |
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 @@ | ||
com.xp.fxckvip.MainHook |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,169 @@ | ||
package com.xp.fxckvip | ||
|
||
import android.widget.Toast | ||
import de.robv.android.xposed.XC_MethodHook | ||
import de.robv.android.xposed.XposedBridge | ||
import de.robv.android.xposed.XposedHelpers | ||
|
||
|
||
class DragonRead { | ||
fun hook(classLoader: ClassLoader) { | ||
hookCreate(classLoader) | ||
hookAd(classLoader) | ||
hookVip(classLoader) | ||
hookUpdate(classLoader) | ||
|
||
} | ||
|
||
private fun hookCreate(classLoader: ClassLoader) { | ||
XposedHelpers.findAndHookMethod( | ||
"com.dragon.read.pages.main.MainFragmentActivity", | ||
classLoader, | ||
"onCreate", | ||
android.os.Bundle::class.java, | ||
object : XC_MethodHook() { | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
//调用原方法 | ||
super.afterHookedMethod(param) | ||
//获取当前的Activity | ||
val activity = param.thisObject as android.app.Activity | ||
//调用showToast方法 | ||
Toast.makeText(activity, "番茄FxckVip模块加载成功!", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
) | ||
// XposedHelpers.findAndHookMethod( | ||
// "com.dragon.read.reader.ui.ReaderActivity", | ||
// classLoader, | ||
// "onCreate", | ||
// android.os.Bundle::class.java, | ||
// object : XC_MethodHook() { | ||
// override fun afterHookedMethod(param: MethodHookParam) { | ||
// //调用原方法 | ||
// super.afterHookedMethod(param) | ||
// //获取当前的Activity | ||
// val activity = param.thisObject as android.app.Activity | ||
// //调用showToast方法 | ||
// Toast.makeText(activity, "FxckVip去广告已启用", Toast.LENGTH_SHORT).show() | ||
// } | ||
// } | ||
// ) | ||
} | ||
|
||
|
||
private fun hookAd(classLoader: ClassLoader) { | ||
try { | ||
classLoader.loadClass("com.dragon.read.component.biz.impl.g.e") | ||
XposedHelpers.findAndHookMethod("com.dragon.read.component.biz.impl.g.e", | ||
classLoader, | ||
"isNoAd", | ||
String::class.java, | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
super.afterHookedMethod(param) | ||
param.result = true | ||
} | ||
}) | ||
classLoader.loadClass("com.dragon.read.component.biz.impl.h.e") | ||
XposedHelpers.findAndHookMethod("com.dragon.read.component.biz.impl.h.e", | ||
classLoader, | ||
"isNoAd", | ||
String::class.java, | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
super.afterHookedMethod(param) | ||
param.result = true | ||
} | ||
}) | ||
classLoader.loadClass("com.dragon.read.component.biz.impl.i.e") | ||
XposedHelpers.findAndHookMethod("com.dragon.read.component.biz.impl.i.e", | ||
classLoader, | ||
"isNoAd", | ||
String::class.java, | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
super.afterHookedMethod(param) | ||
} | ||
}) | ||
XposedHelpers.findAndHookMethod( | ||
"com.dragon.read.component.biz.impl.i.e", | ||
classLoader, | ||
"hasNoAdFollAllScene", | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
super.afterHookedMethod(param) | ||
param.result = true | ||
} | ||
}) | ||
} catch (e: Exception) { | ||
XposedBridge.log("com.dragon.read.component.biz.impl.g.e:${e.message}") | ||
} | ||
|
||
} | ||
|
||
private fun hookVip(classLoader: ClassLoader) { | ||
val vipSubTypeClass = Class.forName("com.dragon.read.rpc.model.VipSubType", false, classLoader) | ||
XposedHelpers.findAndHookConstructor("com.dragon.read.user.model.VipInfoModel", | ||
classLoader, | ||
String::class.java, | ||
String::class.java, | ||
String::class.java, | ||
Boolean::class.java, | ||
Boolean::class.java, | ||
Int::class.java, | ||
Boolean::class.java, | ||
vipSubTypeClass, | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun beforeHookedMethod(param: MethodHookParam) { | ||
val args = param.args | ||
// this.expireTime = str; | ||
// this.isVip = str2; | ||
// this.leftTime = str3; | ||
// this.isAutoCharge = z; | ||
// this.isUnionVip = z2; | ||
// this.unionSource = i2; | ||
// this.isAdVip = z3; | ||
// this.subType = vipSubType; | ||
args[0] = "3743662698" | ||
args[1] = "1" | ||
args[2] = "999999" | ||
args[3] = false | ||
args[4] = true | ||
args[5] = 1 | ||
args[6] = true | ||
} | ||
|
||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
super.afterHookedMethod(param) | ||
val args = param.args | ||
val expireTime = args[0] as String | ||
val isVip = args[1] as String | ||
val leftTime = args[2] as String | ||
val isAutoCharge = args[3] as Boolean | ||
} | ||
}) | ||
} | ||
|
||
private fun hookUpdate(classLoader: ClassLoader) { | ||
try { | ||
XposedHelpers.findAndHookMethod( | ||
"com.dragon.read.update.b", | ||
classLoader, | ||
"b", | ||
object : XC_MethodHook() { | ||
@Throws(Throwable::class) | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
param.result = false | ||
} | ||
}) | ||
} catch (e: Throwable) { | ||
XposedBridge.log("Error occurred calling hooker on $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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.xp.fxckvip | ||
|
||
import android.widget.Toast | ||
import de.robv.android.xposed.IXposedHookLoadPackage | ||
import de.robv.android.xposed.XC_MethodHook | ||
import de.robv.android.xposed.XposedBridge | ||
import de.robv.android.xposed.XposedHelpers | ||
import de.robv.android.xposed.callbacks.XC_LoadPackage | ||
class MainHook : IXposedHookLoadPackage { | ||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { | ||
//创建包名列表 | ||
val packageList = arrayOf( | ||
"com.dragon.read", | ||
"com.kmxs.reader" | ||
) | ||
//匹配包名 不存在则return | ||
if (!packageList.contains(lpparam.packageName)) return | ||
// 执行Hook | ||
XposedBridge.log("FxckVip模块加载成功!") | ||
hook(lpparam) | ||
|
||
} | ||
|
||
private fun hook(lpparam: XC_LoadPackage.LoadPackageParam) { | ||
//遍历lpparam的packageName分配给对应的处理类 | ||
when (lpparam.packageName) { | ||
"com.dragon.read" -> { | ||
val dragonRead = DragonRead() | ||
dragonRead.hook(lpparam.classLoader) | ||
} | ||
"com.kmxs.reader" -> { | ||
val qimao = Qimao() | ||
qimao.hook(lpparam.classLoader) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.