commit 7854b167dde4a6ed0f56dfa6c8c4af642742e8e6
parent 8a19f27d96ecf51d559225c40b32e89846451d1a
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Sat, 19 Aug 2023 12:09:33 +0200
Merge branch 'main' into refactor_2_0_0
- fix(media_downloader): download from topics
- fix: anonymous story viewing
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt b/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt
@@ -254,7 +254,7 @@ class MediaDownloader : Feature("MediaDownloader", loadParams = FeatureLoadParam
}?.let { playlistGroup ->
val playlistGroupString = playlistGroup.toString()
- val storyUserId = if (playlistGroupString.contains("storyUserId=")) {
+ val storyUserId = paramMap["TOPIC_SNAP_CREATOR_USER_ID"]?.toString() ?: if (playlistGroupString.contains("storyUserId=")) {
(playlistGroupString.indexOf("storyUserId=") + 12).let {
playlistGroupString.substring(it, playlistGroupString.indexOf(",", it))
}
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/spying/AnonymousStoryViewing.kt b/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/spying/AnonymousStoryViewing.kt
@@ -5,6 +5,7 @@ import me.rhunk.snapenhance.features.FeatureLoadParams
import me.rhunk.snapenhance.hook.HookStage
import me.rhunk.snapenhance.hook.Hooker
import me.rhunk.snapenhance.util.ktx.getObjectField
+import me.rhunk.snapenhance.util.ktx.setObjectField
class AnonymousStoryViewing : Feature("Anonymous Story Viewing", loadParams = FeatureLoadParams.ACTIVITY_CREATE_ASYNC) {
override fun asyncOnActivityCreate() {
@@ -12,8 +13,8 @@ class AnonymousStoryViewing : Feature("Anonymous Story Viewing", loadParams = Fe
Hooker.hook(context.classCache.networkApi,"submit", HookStage.BEFORE, { anonymousStoryViewProperty }) {
val httpRequest: Any = it.arg(0)
val url = httpRequest.getObjectField("mUrl") as String
- if (url.endsWith("readreceipt-indexer/batchuploadreadreceipts") || url.endsWith("v2/batch_cta")) {
- it.setResult(null)
+ if (url.endsWith("readreceipt-indexer/batchuploadreadreceipts")) {
+ httpRequest.setObjectField("mUrl", "http://127.0.0.1")
}
}
}