Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
fix: black screen on my page
Browse files Browse the repository at this point in the history
  • Loading branch information
mkx173 committed Aug 5, 2024
1 parent 63dec61 commit 171186e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/src/main/java/gm/tieba/tabswitch/hooker/eliminate/PurgeMy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import gm.tieba.tabswitch.hooker.deobfuscation.Matcher
import gm.tieba.tabswitch.hooker.deobfuscation.SmaliMatcher
import gm.tieba.tabswitch.util.getDimen
import gm.tieba.tabswitch.util.getObjectField
import org.json.JSONArray
import org.luckypray.dexkit.query.matchers.ClassMatcher

class PurgeMy : XposedContext(), IHooker, Obfuscated {
Expand Down Expand Up @@ -87,5 +88,22 @@ class PurgeMy : XposedContext(), IHooker, Obfuscated {
(mView?.parent as? ViewGroup)?.removeView(mView)
}
}

// 我的页面 AB test
hookBeforeMethod(
"com.baidu.tbadk.abtest.UbsABTestDataManager",
"parseJSONArray",
JSONArray::class.java
) { param ->
val currentABTestJson = param.args[0] as JSONArray
val newABTestJson = JSONArray()
for (i in 0 until currentABTestJson.length()) {
val currTest = currentABTestJson.getJSONObject(i)
if (!currTest.getString("sid").startsWith("12_64_my_tab_new")) {
newABTestJson.put(currTest)
}
}
param.args[0] = newABTestJson
}
}
}

0 comments on commit 171186e

Please sign in to comment.