Skip to content

Commit

Permalink
Update 0.2.1: fix-last-page-evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
kairi003 committed Feb 20, 2024
1 parent 5c9a4a3 commit fe4d192
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 1 deletion.
18 changes: 18 additions & 0 deletions patches/fix-last-page-evaluation.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff -urwN -U5 tmp/dec/smali_classes2/com/tscsoft/naroureader/domain/usecases/GetNovelLastPageUrlUseCase.smali tmp/mod/smali_classes2/com/tscsoft/naroureader/domain/usecases/GetNovelLastPageUrlUseCase.smali
--- tmp/dec/smali_classes2/com/tscsoft/naroureader/domain/usecases/GetNovelLastPageUrlUseCase.smali 2024-02-20 20:38:28.982910964 +0900
+++ tmp/mod/smali_classes2/com/tscsoft/naroureader/domain/usecases/GetNovelLastPageUrlUseCase.smali 2024-02-20 20:45:11.862811546 +0900
@@ -84,10 +84,14 @@

invoke-virtual {v2, v0}, Lcom/tscsoft/naroureader/http/HttpGet;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

+ invoke-static {v0, v2}, Lcom/tscsoft/naroureader/utils/Modding;->getLastIndexPageHtml(Ljava/lang/String;Lcom/tscsoft/naroureader/http/HttpGet;)Ljava/lang/String;
+
+ move-result-object v0
+
.line 65
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

move-result v2

81 changes: 81 additions & 0 deletions patches/smali/com/tscsoft/naroureader/utils/Modding.smali
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,87 @@
return-void
.end method

.method public static getLastIndexPageHtml(Ljava/lang/String;Lcom/tscsoft/naroureader/http/HttpGet;)Ljava/lang/String;
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation

.line 84
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

move-result v0

if-eqz v0, :cond_0

return-object p0

.line 85
:cond_0
invoke-static {p0}, Lorg/jsoup/Jsoup;->parse(Ljava/lang/String;)Lorg/jsoup/nodes/Document;

move-result-object v0

const-string v1, "a.novelview_pager-last[href]"

.line 86
invoke-virtual {v0, v1}, Lorg/jsoup/nodes/Document;->selectFirst(Ljava/lang/String;)Lorg/jsoup/nodes/Element;

move-result-object v0

if-nez v0, :cond_1

return-object p0

.line 88
:cond_1
new-instance p0, Ljava/net/URL;

invoke-virtual {p1}, Lcom/tscsoft/naroureader/http/HttpGet;->getActualUrl()Ljava/net/URL;

move-result-object v1

const-string v2, "href"

invoke-virtual {v0, v2}, Lorg/jsoup/nodes/Element;->attr(Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

invoke-direct {p0, v1, v0}, Ljava/net/URL;-><init>(Ljava/net/URL;Ljava/lang/String;)V

.line 89
new-instance v0, Ljava/lang/StringBuilder;

const-string v1, "Fetch: "

invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

move-result-object v0

invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v0

const-string v1, "NarouModding"

invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

.line 90
invoke-virtual {p0}, Ljava/net/URL;->toExternalForm()Ljava/lang/String;

move-result-object p0

invoke-virtual {p1, p0}, Lcom/tscsoft/naroureader/http/HttpGet;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object p0

return-object p0
.end method

.method public static patchNovelHtml(Ljava/lang/String;Lcom/tscsoft/naroureader/http/HttpGet;Lcom/tscsoft/naroureader/beans/ListBean;)Ljava/lang/String;
.locals 8
.annotation system Ldalvik/annotation/Throws;
Expand Down
2 changes: 1 addition & 1 deletion patches/version.diff
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ diff -urN tmp/dec/apktool.yml tmp/mod/apktool.yml
- versionCode: 180
+ versionCode: 181
- versionName: 1.35.6
+ versionName: 1.35.6+0.2.0
+ versionName: 1.35.6+0.2.1
resourcesAreCompressed: false
sharedLibrary: false
sparseResources: false
1 change: 1 addition & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cp -r patches/smali/* tmp/dec/smali_classes2/
# apply patches
patch -u -p0 < patches/fix-update-100.diff
patch -u -p0 < patches/min-index-update.diff
patch -u -p0 < patches/fix-last-page-evaluation.diff
# patch -u -p0 < patches/switch-page-view.diff
patch -u -p0 < patches/version.diff

Expand Down

0 comments on commit fe4d192

Please sign in to comment.