From 9df40c4d985976d2ecbefccb658afa7598917d61 Mon Sep 17 00:00:00 2001 From: niuhuan Date: Mon, 17 Oct 2022 14:13:41 +0800 Subject: [PATCH] upgrade --- .gitignore | 1 + README-zh.md | 1 - README.md | 1 - ci/version.code.txt | 2 +- ci/version.info.txt | 4 +- go/go.mod | 4 ++ go/go.sum | 28 ++++++++++++ go/nhentai/common.go | 6 +-- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Podfile | 2 +- ios/Podfile.lock | 27 +++++++---- l10n.yaml | 1 + lib/l10n/app_zh.arb | 1 + lib/screens/comic_reader_screen.dart | 15 +++--- lib/screens/comics_screen.dart | 2 - lib/screens/webview_screen.dart | 68 ++++++++++++++++++++-------- pubspec.yaml | 2 +- scripts/bind-android-debug.sh | 2 +- scripts/bind-ios-arm64.sh | 2 +- scripts/bind-ios.sh | 2 +- scripts/build-apk-arm.sh | 2 +- scripts/build-apk-arm64.sh | 2 +- scripts/build-apk-x64.sh | 2 +- scripts/build-apk-x86.sh | 2 +- scripts/build-ipa.sh | 2 +- 25 files changed, 128 insertions(+), 55 deletions(-) diff --git a/.gitignore b/.gitignore index d870bec..fc2c462 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ app.*.map.json /go/mobile/lib/*.xcframework/ /lib/assets/version.txt +desiredFileName.txt diff --git a/README-zh.md b/README-zh.md index 9c4dd09..51326ef 100644 --- a/README-zh.md +++ b/README-zh.md @@ -17,7 +17,6 @@ ## 使用前必读 - 根据地区的不同DNS拦截器不一定有效, 请使用科学上网测试本软件的可用性 -- 由于官方网站使用了反DDOS攻击, 如果漫画列表拉取失败, 请过5秒之后重试 ## 软件截图 diff --git a/README.md b/README.md index 949e171..cbbad54 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ A beautiful and cross platform *NHentai Client*. Support desktop and mobile phon ## Must readme The official website uses the page to prevent DDoS attacks. -If the comic list is not obtained successfully, you need to wait 5 seconds and try again. ## Captures diff --git a/ci/version.code.txt b/ci/version.code.txt index e1d848b..6183501 100644 --- a/ci/version.code.txt +++ b/ci/version.code.txt @@ -1 +1 @@ -v0.0.8 \ No newline at end of file +v0.0.9 \ No newline at end of file diff --git a/ci/version.info.txt b/ci/version.info.txt index a8076f8..c4f8b72 100644 --- a/ci/version.info.txt +++ b/ci/version.info.txt @@ -1,2 +1,2 @@ -- 通过网页加载Cookie, 帮助穿过DDoS防御 (实验性) -- 可以直接打开 https://nhentai.com/g/12345/ 类似的网址进入详情页(安卓) +- Cross DDoS (only phone) +- 通过ddos (仅手机端) diff --git a/go/go.mod b/go/go.mod index bd5a03d..0f071ef 100644 --- a/go/go.mod +++ b/go/go.mod @@ -27,7 +27,11 @@ require ( github.com/mattn/go-sqlite3 v1.14.9 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105 // indirect + golang.org/x/mod v0.4.2 // indirect golang.org/x/net v0.0.0-20220615171555-694bf12d69de // indirect golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect golang.org/x/text v0.3.7 // indirect + golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect ) diff --git a/go/go.sum b/go/go.sum index a5551a4..976917d 100644 --- a/go/go.sum +++ b/go/go.sum @@ -1,3 +1,4 @@ +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= github.com/Xuanwo/go-locale v1.1.0 h1:51gUxhxl66oXAjI9uPGb2O0qwPECpriKQb2hl35mQkg= @@ -59,17 +60,36 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20220321031419-a8550c1d254a h1:LnH9RNcpPv5Kzi15lXg42lYMPUf0x8CuPv1YnvBWZAg= golang.org/x/image v0.0.0-20220321031419-a8550c1d254a/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105 h1:3vUV5x5+3LfQbgk7paCM6INOaJG9xXQbn79xoNkwfIk= +golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105/go.mod h1:pe2sM7Uk+2Su1y7u/6Z8KJ24D7lepUjFZbhFOrmDfuQ= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220615171555-694bf12d69de h1:ogOG2+P6LjO2j55AkRScrkB2BFpd+Z8TY2wcM0Z3MGo= golang.org/x/net v0.0.0-20220615171555-694bf12d69de/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211023085530-d6a326fbbf70/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -80,7 +100,15 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098 h1:YuekqPskqwCCPM79F1X5Dhv4ezTCj+Ki1oNwiafxkA0= +golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/go/nhentai/common.go b/go/nhentai/common.go index b2c0bc8..7613ec1 100644 --- a/go/nhentai/common.go +++ b/go/nhentai/common.go @@ -32,14 +32,14 @@ import ( func availableWebAddresses(_ string) (string, error) { return serialize([]string{ - "104.27.194.88:443", - "104.27.195.88:443", + "104.21.66.123:443", + "172.67.159.231:443", }, nil) } func availableImgAddresses(_ string) (string, error) { return serialize([]string{ - "23.237.126.122:443", + "185.107.44.3:443", "185.177.127.78:443", "185.177.127.77:443", }, nil) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 8d4492f..9625e10 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/ios/Podfile b/ios/Podfile index 1e8c3c9..88359b2 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 682b578..414cd7f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2,39 +2,50 @@ PODS: - app_links (0.0.1): - Flutter - Flutter (1.0.0) + - flutter_inappwebview (0.0.1): + - Flutter + - flutter_inappwebview/Core (= 0.0.1) + - OrderedSet (~> 5.0) + - flutter_inappwebview/Core (0.0.1): + - Flutter + - OrderedSet (~> 5.0) + - OrderedSet (5.0.0) - "permission_handler (5.1.0+2)": - Flutter - url_launcher_ios (0.0.1): - Flutter - - webview_flutter_wkwebview (0.0.1): - - Flutter DEPENDENCIES: - app_links (from `.symlinks/plugins/app_links/ios`) - Flutter (from `Flutter`) + - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) + +SPEC REPOS: + trunk: + - OrderedSet EXTERNAL SOURCES: app_links: :path: ".symlinks/plugins/app_links/ios" Flutter: :path: Flutter + flutter_inappwebview: + :path: ".symlinks/plugins/flutter_inappwebview/ios" permission_handler: :path: ".symlinks/plugins/permission_handler/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" - webview_flutter_wkwebview: - :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: app_links: 8941e7bac086136bae70d619141c36f258f4381d - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 + OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de - webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c +PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 COCOAPODS: 1.11.3 diff --git a/l10n.yaml b/l10n.yaml index 15338f2..dbaf35b 100644 --- a/l10n.yaml +++ b/l10n.yaml @@ -1,3 +1,4 @@ arb-dir: lib/l10n template-arb-file: app_en.arb output-localization-file: app_localizations.dart +untranslated-messages-file: desiredFileName.txt diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 5269f34..a526066 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -33,6 +33,7 @@ "failed": "失败", "autoCheckNewVersion": "自动检查更新", "disabled": "已禁用", + "disable": "禁用", "enabled": "已开启", "enable": "开启", "nextTime": "下一次", diff --git a/lib/screens/comic_reader_screen.dart b/lib/screens/comic_reader_screen.dart index 5b8e60a..a368661 100644 --- a/lib/screens/comic_reader_screen.dart +++ b/lib/screens/comic_reader_screen.dart @@ -432,9 +432,10 @@ class _ComicReaderWebToonState extends _ComicReaderState { .toList() .cast(); } else { - final height = constraints.maxHeight - + var height = constraints.maxHeight - super._appBarHeight() - - (_fullScreen ? super._appBarHeight() : super._bottomBarHeight()); + super._bottomBarHeight() - + MediaQuery.of(context).padding.bottom; _offsets = widget.comicInfo.images.pages .map((e) => height * e.w / e.h) .toList() @@ -447,9 +448,10 @@ class _ComicReaderWebToonState extends _ComicReaderState { .toList() .cast(); } else { - final height = constraints.maxHeight - + var height = constraints.maxHeight - super._appBarHeight() - - (_fullScreen ? super._appBarHeight() : super._bottomBarHeight()); + super._bottomBarHeight() - + MediaQuery.of(context).padding.bottom; _sizes = widget.comicInfo.images.pages .map((e) => Size(height * e.w / e.h, height)) .toList() @@ -469,9 +471,8 @@ class _ComicReaderWebToonState extends _ComicReaderState { top: super._appBarHeight(), bottom: _direction == ReaderDirection.topToBottom ? 130 - : (_fullScreen - ? super._appBarHeight() - : super._bottomBarHeight()), + : (super._bottomBarHeight() + + MediaQuery.of(context).padding.bottom) ), itemCount: widget.comicInfo.images.pages.length, itemBuilder: (BuildContext context, int index) { diff --git a/lib/screens/comics_screen.dart b/lib/screens/comics_screen.dart index 07039d5..fa0392a 100644 --- a/lib/screens/comics_screen.dart +++ b/lib/screens/comics_screen.dart @@ -2,13 +2,11 @@ import 'dart:io'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:nhentai/basic/channels/nhentai.dart'; import 'package:nhentai/screens/comic_search_screen.dart'; import 'package:nhentai/screens/components/pager.dart'; import 'package:nhentai/screens/webview_screen.dart'; -import 'package:webview_flutter/webview_flutter.dart'; import 'comic_downloads_screen.dart'; import 'components/actions.dart'; diff --git a/lib/screens/webview_screen.dart b/lib/screens/webview_screen.dart index 8dd3dba..b5f96c1 100644 --- a/lib/screens/webview_screen.dart +++ b/lib/screens/webview_screen.dart @@ -1,6 +1,9 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:nhentai/basic/channels/nhentai.dart'; -import 'package:webview_flutter/webview_flutter.dart'; +import 'package:nhentai/basic/common/common.dart'; class WebViewScreen extends StatefulWidget { const WebViewScreen({Key? key}) : super(key: key); @@ -10,7 +13,14 @@ class WebViewScreen extends StatefulWidget { } class _WebViewScreenState extends State { - late WebViewController _webViewController; + late InAppWebViewController _webViewController; + late CookieManager _cookieManager; + + @override + void initState() { + _cookieManager = CookieManager.instance(); + super.initState(); + } @override Widget build(BuildContext context) { @@ -18,26 +28,46 @@ class _WebViewScreenState extends State { appBar: AppBar( title: const Text("Load web cookies"), actions: [ - IconButton(onPressed: () { - _webViewController.loadUrl('https://nhentai.net/'); - }, icon: const Icon(Icons.refresh),), - IconButton(onPressed: () async { - final cookies = await _webViewController.runJavascriptReturningResult( - 'document.cookie', - ); - await nHentai.setCookie(cookies); - await nHentai.setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'); - Navigator.of(context).pop(); - }, icon: const Icon(Icons.check),), + IconButton( + onPressed: () { + _webViewController.loadUrl( + urlRequest: + URLRequest(url: Uri.parse('https://nhentai.net/'))); + }, + icon: const Icon(Icons.refresh), + ), + IconButton( + onPressed: () async { + final body = await _webViewController.evaluateJavascript( + source: "navigator.userAgent"); + await nHentai.setUserAgent(body); + + // var cookies = + // await _webViewController.evaluateJavascript(source: "document.cookie"); + // + // if (cookies.startsWith("\"")) { + // cookies = cookies.replaceAll("\"", ""); + // } + + final cookies = await _cookieManager.getCookies( + url: Uri.parse('https://nhentai.net/')); + print(cookies.map((e) => "${e.name}=${e.value}").join("; ")); + await nHentai.setCookie( + cookies.map((e) => "${e.name}=${e.value}").join("; ")); + Navigator.of(context).pop(); + }, + icon: const Icon(Icons.check), + ), ], ), - body: WebView( - initialUrl: 'https://nhentai.net/', - onWebViewCreated: (WebViewController webViewController) { - _webViewController = webViewController; + body: InAppWebView( + initialUrlRequest: URLRequest( + url: Uri.parse('https://nhentai.net/'), + ), + onLoadStart: (c, url) { + print("onLoadStart"); + _webViewController = c; }, - javascriptMode: JavascriptMode.unrestricted, - userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36', ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index 41162b8..0d6fe41 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: nhentai description: nhentai client publish_to: 'none' -version: 1.0.0+1 +version: 0.0.9+2 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/scripts/bind-android-debug.sh b/scripts/bind-android-debug.sh index cae5d23..5445933 100644 --- a/scripts/bind-android-debug.sh +++ b/scripts/bind-android-debug.sh @@ -4,4 +4,4 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile -gomobile bind -target=android/arm,android/arm64,android/386,android/amd64 -o lib/Mobile.aar ./ +gomobile bind -androidapi 19 -target=android/arm,android/arm64,android/386,android/amd64 -o lib/Mobile.aar ./ diff --git a/scripts/bind-ios-arm64.sh b/scripts/bind-ios-arm64.sh index 7f812ac..ffd23e0 100644 --- a/scripts/bind-ios-arm64.sh +++ b/scripts/bind-ios-arm64.sh @@ -4,4 +4,4 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile -gomobile bind -target=ios -o lib/Mobile.xcframework ./ +gomobile bind -androidapi 19 -target=ios -o lib/Mobile.xcframework ./ diff --git a/scripts/bind-ios.sh b/scripts/bind-ios.sh index 7f812ac..9406a7e 100644 --- a/scripts/bind-ios.sh +++ b/scripts/bind-ios.sh @@ -4,4 +4,4 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile -gomobile bind -target=ios -o lib/Mobile.xcframework ./ +gomobile bind -iosversion 11.0 -target=ios -o lib/Mobile.xcframework ./ diff --git a/scripts/build-apk-arm.sh b/scripts/build-apk-arm.sh index 7d03e8a..a535036 100644 --- a/scripts/build-apk-arm.sh +++ b/scripts/build-apk-arm.sh @@ -4,6 +4,6 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile go get golang.org/x/mobile/cmd/gobind -gomobile bind -target=android/arm -o lib/Mobile.aar ./ +gomobile bind -androidapi 19 -target=android/arm -o lib/Mobile.aar ./ cd ../.. flutter build apk --target-platform android-arm diff --git a/scripts/build-apk-arm64.sh b/scripts/build-apk-arm64.sh index 0310c52..883dcc9 100644 --- a/scripts/build-apk-arm64.sh +++ b/scripts/build-apk-arm64.sh @@ -4,6 +4,6 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile go get golang.org/x/mobile/cmd/gobind -gomobile bind -target=android/arm64 -o lib/Mobile.aar ./ +gomobile bind -androidapi 19 -target=android/arm64 -o lib/Mobile.aar ./ cd ../.. flutter build apk --target-platform android-arm64 diff --git a/scripts/build-apk-x64.sh b/scripts/build-apk-x64.sh index 034d0f5..37bcc73 100644 --- a/scripts/build-apk-x64.sh +++ b/scripts/build-apk-x64.sh @@ -4,6 +4,6 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile go get golang.org/x/mobile/cmd/gobind -gomobile bind -target=android/amd64 -o lib/Mobile.aar ./ +gomobile bind -androidapi 19 -target=android/amd64 -o lib/Mobile.aar ./ cd ../.. flutter build apk --target-platform android-x64 diff --git a/scripts/build-apk-x86.sh b/scripts/build-apk-x86.sh index 9317c33..6872ceb 100644 --- a/scripts/build-apk-x86.sh +++ b/scripts/build-apk-x86.sh @@ -4,6 +4,6 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile go get golang.org/x/mobile/cmd/gobind -gomobile bind -target=android/386 -o lib/Mobile.aar ./ +gomobile bind -androidapi 19 -target=android/386 -o lib/Mobile.aar ./ cd ../.. flutter build apk --target-platform android-x86 diff --git a/scripts/build-ipa.sh b/scripts/build-ipa.sh index 516b4c8..00c7a05 100644 --- a/scripts/build-ipa.sh +++ b/scripts/build-ipa.sh @@ -4,7 +4,7 @@ cd "$( cd "$( dirname "$0" )" && pwd )/.." cd go/mobile go get golang.org/x/mobile/cmd/gobind -gomobile bind -target=ios -o lib/Mobile.xcframework ./ +gomobile bind -iosversion 11.0 -target=ios -o lib/Mobile.xcframework ./ cd ../.. flutter build ios --release --no-codesign