Skip to content

Commit

Permalink
fix: light app crash
Browse files Browse the repository at this point in the history
  • Loading branch information
fuqiuluo committed Jul 28, 2024
1 parent 8c1abc4 commit 14ed5b9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 50 deletions.
7 changes: 0 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,12 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$serializationVersion")
implementation("com.google.protobuf:protobuf-java:4.26.1")
implementation("androidx.core:core-ktx:1.13.1")

implementation(ktor("client", "core"))
implementation(ktor("client", "content-negotiation"))
implementation(ktor("client", "cio"))
implementation(ktor("serialization", "kotlinx-json"))
implementation(ktor("network", "tls-certificates"))

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test:core:1.5.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test:rules:1.5.0")
}

fun ktor(target: String, name: String): String {
Expand Down
32 changes: 3 additions & 29 deletions app/src/main/java/moe/qwq/miko/hooks/DefaultPacketHijacker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.tencent.qphone.base.util.CodecWarpper
import moe.fuqiuluo.processor.HookAction
import moe.qwq.miko.actions.ActionProcess
import moe.qwq.miko.actions.IAction
import moe.qwq.miko.ext.EMPTY_BYTE_ARRAY
import moe.qwq.miko.ext.hookMethod
import moe.qwq.miko.internals.setting.QwQSetting
import moe.qwq.miko.utils.PlatformTools
Expand All @@ -19,36 +20,10 @@ class DefaultPacketHijacker: IAction {
val cmd = it.args[5] as? String
?: return@before
if (cmd in TRASH_PACKET) {
it.result = Unit
it.result = EMPTY_BYTE_ARRAY
} else if (cmd == "ProfileService.CheckUpdateReq") {
it.result = Unit
it.result = EMPTY_BYTE_ARRAY
}

/* 仅为测试
else if (cmd in TEST_PACKET) {
log("[QwQ 已拦截发送包] cmd: $cmd")
it.result = Unit
} */

/* 协议一键赞 问题多多
else if (QwQSetting.oneClickLike && toServiceMsg.serviceCmd == "VisitorSvc.ReqFavorite" &&
!toServiceMsg.extraData.getBoolean("qwq", false)
) {
toServiceMsg.extraData.putBoolean("qwq", true)
GlobalScope.launch {
var total = 0
while (total < 20) {
var random = Random.nextInt(1 .. 10)
if (20 - total < random) {
random = 20 - total
}
toServiceMsg.extraData.putInt("iCount", random)
app.sendToService(toServiceMsg)
total += random
}
}
it.result = Unit
}*/
}
}

Expand All @@ -60,7 +35,6 @@ class DefaultPacketHijacker: IAction {
"QQClubComm.getNewFlag",
"LightAppSvc.mini_app_ad.GetAd",
"TianShu.GetAds", // noteworthy
"LightAppSvc.mini_app_info.GetAppInfoByLink",
"trpc.qqshop.adpush.PushService.GetAd"
)
}
Expand Down
7 changes: 0 additions & 7 deletions maple/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,4 @@ android {

dependencies {
compileOnly(project(":qqinterface")) // oicq common interface

implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}
7 changes: 0 additions & 7 deletions processor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,4 @@ android {
}

dependencies {

implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package androidx.lifecycle;

public interface LifecycleOwner {
}

0 comments on commit 14ed5b9

Please sign in to comment.