-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1d06cb5
Showing
613 changed files
with
205,221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/tmp/ | ||
/.keystore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# NarouReaderMod | ||
なろうリーダで100話以降の目次を取得するための改造パッチ | ||
|
||
# 注意 | ||
- 本パッチは非公式のものであり、なろうリーダの開発者とは無関係です。不具合があっても本家開発者に問い合わせないでください。 | ||
- 本パッチを利用することでアプリが正常に動作しなくなる可能性があります。自己責任でご利用ください。 | ||
- 100話ごとで目次を取得するため、話数の多い小説の更新確認は遅くなります。 | ||
- 一定以上更新に時間がかかる場合は目次の取得が中断されることがあります。その場合は登録小説を更新除外設定するなどで対処してください。 | ||
- 本パッチを適用したなろうリーダはGoogle Playにてアップデートされなくなります。 | ||
- アップデートを行う場合はアプリをアンインストールし、公式のものを再インストールしてください。 | ||
- パッチのソースはsrcディレクトリのAndroid Studioプロジェクトです。 | ||
- apkをビルドしてapktoolでデコードしたものからパッチをを作成しています。 | ||
|
||
|
||
# バイナリパッチ | ||
- ツールの用意や署名が面倒な場合はバイナリパッチを利用してください。 | ||
- できればapktoolを使ってソースパッチを適用することを推奨します。 | ||
- バイナリパッチはAPKPureのなろうリーダv1.35の単一apkにのみ適用可能です。 | ||
|
||
## 必要なもの | ||
- なろうリーダv1.35 (APKPure | ||
- bsdiff/bspatch | ||
- Windows : https://github.com/cnSchwarzer/bsdiff-win/releases/ | ||
- Linux : `sudo apt install bsdiff` | ||
- Mac : `brew install bsdiff` | ||
- narou-mod.bsdiff | ||
- https://github.com/kairi003/NarouReaderMod/releases からダウンロード | ||
|
||
## 適用方法 | ||
1. なろうリーダのapkを`original.apk`という名前で`narou-mod.bsdiff`と同じディレクトリに配置 | ||
- windowsの場合は`bspatch.exe`も同じディレクトリに配置 | ||
2. コマンドラインやターミナルを開き以下のコマンドで`narou-mod.bsdiff`を適用 | ||
```bash | ||
bspatch original.apk narou-mod.apk narou-mod.bsdiff | ||
``` | ||
|
||
# ソースパッチ | ||
## パッチ適用動作環境 | ||
- Linux推奨 | ||
- Windowsでも動作するがWSL推奨 | ||
- Macは未検証 | ||
|
||
## 必要なツール | ||
Ubuntuの場合、全てaptでインストール可能 | ||
- JDK : https://adoptopenjdk.net/ | ||
- apktool : https://ibotpeaches.github.io/Apktool/ | ||
- patch : Windowsの場合Git for Windows等に含まれる | ||
- keytool : JDKに含まれる | ||
- apksigner : Android SDKに含まれる | ||
- zipalign : Android SDKに含まれる | ||
|
||
## 使い方 | ||
署名やビルドが面倒な場合はバイナリパッチを利用してください。 | ||
1. なろうリーダのapkを入手 | ||
- デバイス中のapkはsplit apksになっているため、APKPureなどのサイトからダウンロード推奨 | ||
- セキュリティ的に不安な場合はbase.apkと同じディレクトリの全てのapkファイルをadbやSAIで抽出し、単一apkの代わりにbase.apkにパッチを当てる | ||
- この場合 `adb install-multiple` でインストール可能だが全てのapkに同一の署名が必要 | ||
2. なろうリーダのapkを`original.apk`という名前で`run.sh`と同じディレクトリに配置 | ||
3. 後述のコマンドでキーストアを作成 | ||
4. `run.sh` または `run.bat` を実行 | ||
- apktoolによるデコード、パッチの適用、ビルド、zipalign、署名を行う | ||
5. `narou-mod.apk` が生成されるので、これを端末にインストール | ||
- 自己署名のため、インストール時にセキュリティ警告が表示される | ||
|
||
## キーストアの作成 | ||
以下のコマンドでキーストアを作成する。 | ||
所在地などはデフォルト(Unkown)で問題ない。 | ||
パスワードは署名時に必要。 | ||
``` | ||
keytool -genkeypair -v -keystore .keystore -alias narou-mod -keyalg RSA -keysize 2048 -validity 100000 | ||
``` | ||
|
||
# パッチによる変更内容 | ||
### com.tscsoft.naroureader.utils.Modding.smali | ||
- 目次ページを全て読み込むための関数 `patchNovelHtml` を追加 | ||
|
||
### com.tscsoft.naroureader.utils.UpdateManager.smali.diff | ||
- `patchNovelHtml` を呼び出すように変更 | ||
|
||
### org.jsoup | ||
- 最適化でメソッドが削除されているため最適化を無効化したsmaliに差し替え | ||
|
||
### okhttp3 | ||
- SSL通信でクラッシュする不具合が修正されているためバージョンアップ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@@ -2968,6 +2968,9 @@ | ||
if-nez v2, :cond_0 | ||
|
||
.line 753 | ||
+ invoke-static {v0, v1, p1}, Lcom/tscsoft/naroureader/utils/Modding;->patchNovelHtml(Ljava/lang/String;Lcom/tscsoft/naroureader/http/HttpGet;Lcom/tscsoft/naroureader/beans/ListBean;)Ljava/lang/String; | ||
+ move-result-object v0 | ||
+ | ||
new-instance v2, Lcom/tscsoft/naroureader/NovelHtmlObject; | ||
|
||
invoke-virtual {v1}, Lcom/tscsoft/naroureader/http/HttpGet;->getActualUrl()Ljava/net/URL; |
210 changes: 210 additions & 0 deletions
210
patch/smali/com/tscsoft/naroureader/utils/Modding.smali
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
.class public Lcom/tscsoft/naroureader/utils/Modding; | ||
.super Ljava/lang/Object; | ||
.source "Modding.java" | ||
|
||
|
||
# direct methods | ||
.method public constructor <init>()V | ||
.locals 0 | ||
|
||
.line 16 | ||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V | ||
|
||
return-void | ||
.end method | ||
|
||
.method public static patchNovelHtml(Ljava/lang/String;Lcom/tscsoft/naroureader/http/HttpGet;Lcom/tscsoft/naroureader/beans/ListBean;)Ljava/lang/String; | ||
.locals 7 | ||
.annotation system Ldalvik/annotation/Throws; | ||
value = { | ||
Ljava/io/IOException;, | ||
Ljava/lang/InterruptedException; | ||
} | ||
.end annotation | ||
|
||
.line 18 | ||
new-instance v0, Ljava/lang/StringBuilder; | ||
|
||
const-string v1, "patchNovelHtml: " | ||
|
||
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V | ||
|
||
invoke-virtual {p2}, Lcom/tscsoft/naroureader/beans/ListBean;->getUrl()Ljava/lang/String; | ||
|
||
move-result-object p2 | ||
|
||
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; | ||
|
||
move-result-object p2 | ||
|
||
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; | ||
|
||
move-result-object p2 | ||
|
||
const-string v0, "NarouModding" | ||
|
||
invoke-static {v0, p2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I | ||
|
||
.line 19 | ||
invoke-static {p0}, Lorg/jsoup/Jsoup;->parse(Ljava/lang/String;)Lorg/jsoup/nodes/Document; | ||
|
||
move-result-object p2 | ||
|
||
const-string v1, ".index_box" | ||
|
||
.line 20 | ||
invoke-virtual {p2, v1}, Lorg/jsoup/nodes/Document;->selectFirst(Ljava/lang/String;)Lorg/jsoup/nodes/Element; | ||
|
||
move-result-object v2 | ||
|
||
if-nez v2, :cond_0 | ||
|
||
return-object p0 | ||
|
||
:cond_0 | ||
const-string p0, "a.novelview_pager-next[href]" | ||
|
||
.line 23 | ||
invoke-virtual {p2, p0}, Lorg/jsoup/nodes/Document;->selectFirst(Ljava/lang/String;)Lorg/jsoup/nodes/Element; | ||
|
||
move-result-object v3 | ||
|
||
.line 24 | ||
invoke-virtual {p1}, Lcom/tscsoft/naroureader/http/HttpGet;->getActualUrl()Ljava/net/URL; | ||
|
||
move-result-object v4 | ||
|
||
:goto_0 | ||
if-eqz v3, :cond_3 | ||
|
||
.line 27 | ||
new-instance v5, Ljava/net/URL; | ||
|
||
const-string v6, "href" | ||
|
||
invoke-virtual {v3, v6}, Lorg/jsoup/nodes/Element;->attr(Ljava/lang/String;)Ljava/lang/String; | ||
|
||
move-result-object v3 | ||
|
||
invoke-direct {v5, v4, v3}, Ljava/net/URL;-><init>(Ljava/net/URL;Ljava/lang/String;)V | ||
|
||
.line 28 | ||
new-instance v3, Ljava/lang/StringBuilder; | ||
|
||
const-string v4, "Fetch: " | ||
|
||
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V | ||
|
||
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; | ||
|
||
move-result-object v3 | ||
|
||
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; | ||
|
||
move-result-object v3 | ||
|
||
invoke-static {v0, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I | ||
|
||
.line 29 | ||
new-instance v3, Ljava/lang/StringBuilder; | ||
|
||
const-string v4, "Reset: " | ||
|
||
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V | ||
|
||
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; | ||
|
||
move-result-object v3 | ||
|
||
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; | ||
|
||
move-result-object v3 | ||
|
||
invoke-static {v0, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I | ||
|
||
.line 32 | ||
:try_start_0 | ||
invoke-virtual {v5}, Ljava/net/URL;->toExternalForm()Ljava/lang/String; | ||
|
||
move-result-object v3 | ||
|
||
invoke-virtual {p1, v3}, Lcom/tscsoft/naroureader/http/HttpGet;->get(Ljava/lang/String;)Ljava/lang/String; | ||
|
||
move-result-object v3 | ||
:try_end_0 | ||
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 | ||
|
||
const-string v4, "Get HTML" | ||
|
||
.line 37 | ||
invoke-static {v0, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I | ||
|
||
.line 38 | ||
invoke-virtual {p1}, Lcom/tscsoft/naroureader/http/HttpGet;->isSuccessful()Z | ||
|
||
move-result v4 | ||
|
||
if-eqz v4, :cond_3 | ||
|
||
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z | ||
|
||
move-result v4 | ||
|
||
if-eqz v4, :cond_1 | ||
|
||
goto :goto_1 | ||
|
||
.line 40 | ||
:cond_1 | ||
invoke-static {v3}, Lorg/jsoup/Jsoup;->parse(Ljava/lang/String;)Lorg/jsoup/nodes/Document; | ||
|
||
move-result-object v3 | ||
|
||
.line 41 | ||
invoke-virtual {v3, v1}, Lorg/jsoup/nodes/Document;->selectFirst(Ljava/lang/String;)Lorg/jsoup/nodes/Element; | ||
|
||
move-result-object v4 | ||
|
||
if-nez v4, :cond_2 | ||
|
||
goto :goto_1 | ||
|
||
.line 44 | ||
:cond_2 | ||
invoke-virtual {v4}, Lorg/jsoup/nodes/Element;->html()Ljava/lang/String; | ||
|
||
move-result-object v4 | ||
|
||
invoke-virtual {v2, v4}, Lorg/jsoup/nodes/Element;->append(Ljava/lang/String;)Lorg/jsoup/nodes/Element; | ||
|
||
.line 45 | ||
invoke-virtual {v3, p0}, Lorg/jsoup/nodes/Document;->selectFirst(Ljava/lang/String;)Lorg/jsoup/nodes/Element; | ||
|
||
move-result-object v3 | ||
|
||
move-object v4, v5 | ||
|
||
goto :goto_0 | ||
|
||
:catch_0 | ||
move-exception p0 | ||
|
||
.line 34 | ||
invoke-virtual {p0}, Ljava/lang/Exception;->toString()Ljava/lang/String; | ||
|
||
move-result-object p1 | ||
|
||
invoke-static {v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I | ||
|
||
.line 35 | ||
throw p0 | ||
|
||
.line 47 | ||
:cond_3 | ||
:goto_1 | ||
invoke-virtual {p2}, Lorg/jsoup/nodes/Document;->outerHtml()Ljava/lang/String; | ||
|
||
move-result-object p0 | ||
|
||
return-object p0 | ||
.end method |
Oops, something went wrong.