From 14c0b6ccafe526b1eb54f653a9a31a9ec6e2dfba Mon Sep 17 00:00:00 2001 From: beerpsi <92439990+beerpiss@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:20:37 +0700 Subject: [PATCH] [mgk] fix fetching pages (#87) --- src/id/mangaku/build.gradle | 3 ++- .../tachiyomi/extension/id/mangaku/Mangaku.kt | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/id/mangaku/build.gradle b/src/id/mangaku/build.gradle index fb7bf95a..d11af074 100644 --- a/src/id/mangaku/build.gradle +++ b/src/id/mangaku/build.gradle @@ -5,11 +5,12 @@ ext { extName = 'Mangaku' pkgNameSuffix = 'id.mangaku' extClass = '.Mangaku' - extVersionCode = 6 + extVersionCode = 7 } apply from: "$rootDir/common.gradle" dependencies { implementation(project(':lib-cryptoaes')) + implementation(project(':lib-unpacker')) } diff --git a/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt b/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt index d6c0344b..ed8163a4 100644 --- a/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt +++ b/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt @@ -4,6 +4,7 @@ import android.net.Uri import android.util.Base64 import android.util.Log import eu.kanade.tachiyomi.lib.cryptoaes.CryptoAES +import eu.kanade.tachiyomi.lib.unpacker.Unpacker import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.asObservableSuccess @@ -28,7 +29,7 @@ class Mangaku : ParsedHttpSource() { override val name = "Mangaku" - override val baseUrl = "https://mangaku.blog" + override val baseUrl = "https://mangaku.mom" override val lang = "id" @@ -141,12 +142,20 @@ class Mangaku : ParsedHttpSource() { val wpRoutineJs = client.newCall(GET(wpRoutineUrl, headers)).execute().use { it.body.string() } + val upt3 = wpRoutineJs .substringAfterLast("upt3(") .substringBefore(");") - val appMgk = wpRoutineJs - .substringAfter("const $upt3 = '") - .substringBefore("'") + val keymapJsPacked = wpRoutineJs + .substringAfter("eval(function(x,a,c,k,e,d)") + .substringBefore(".split('|'),0,{}))") + ".split('|'),0,{}))" + val keymapJs = Unpacker.unpack(keymapJsPacked) + val appMgkVariable = keymapJs + .substringAfter("$upt3=") + .substringBefore(";") + val appMgk = keymapJs + .substringAfter("let $appMgkVariable=\"") + .substringBefore("\";") .reversed() Log.d("mangaku", "app-mgk: $appMgk")