Skip to content

Commit dbb0b9d

Browse files
committed
v1.5.1
修复 1. 最大只能阅读50页 优化 1. 卡顿
1 parent eeb3735 commit dbb0b9d

File tree

25 files changed

+488
-319
lines changed

25 files changed

+488
-319
lines changed

.idea/.name

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deploymentTargetSelector.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/fumiama.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# copymanga 拷贝漫画
1+
# copymanga Lite
22
拷贝漫画的第三方APP,优化阅读/下载体验
3-
近日官方取消了网页端,本项目已不再可用,因此被存档
43
# 说明
54
本应用基于官方的`HLML5`手机版本网页端,作者不对其中呈现的任何内容负责
65
# 功能

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ android {
1212
minSdkVersion 23
1313
//noinspection OldTargetApi
1414
targetSdkVersion 34
15-
versionCode 13
16-
versionName '1.5.0'
15+
versionCode 14
16+
versionName '1.5.1'
1717
resConfigs "zh", "zh-rCN"
1818

1919
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -96,7 +96,7 @@ if (propFile.canRead()){
9696
dependencies {
9797
implementation fileTree(dir: "libs", include: ["*.jar"])
9898
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
99-
implementation 'androidx.core:core-ktx:1.8.0'
99+
implementation 'androidx.core:core-ktx:1.12.0'
100100
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
101101
implementation 'androidx.cardview:cardview:1.0.0'
102102
implementation 'androidx.viewpager2:viewpager2:1.1.0'

app/src/main/assets/h.js

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,62 @@
11
javascript:
2-
if (typeof (loaded) == "undefined"){
2+
if (typeof (loaded) == "undefined") {
33
var loaded = true;
44
function scanChapters(chapter) {
55
var chapterList = chapter.getElementsByClassName("tab-pane fade show active")[0].getElementsByTagName("ul")[0].getElementsByTagName("a");
66
var chapterArr = Array();
7-
for(var i = 0; i < chapterList.length; i++){
7+
for (var i = 0; i < chapterList.length; i++) {
88
chapterArr.push(JSON.constructor());
99
chapterArr[i]["name"] = chapterList[i].title;
1010
chapterArr[i]["url"] = chapterList[i].href;
1111
}
1212
return chapterArr;
1313
}
14+
function smoothLoadChapter(speed, interval) {
15+
let prevHeight = document.body.scrollHeight;
16+
let lastTime = 0;
17+
let ticking = false;
18+
function requestTick() {
19+
if (!ticking) {
20+
ticking = true;
21+
requestAnimationFrame(step);
22+
}
23+
}
24+
function step(timestamp) {
25+
if (!lastTime) lastTime = timestamp;
26+
const elapsed = timestamp - lastTime;
27+
if (elapsed >= interval) {
28+
const index = document.getElementsByClassName("comicIndex")[0].innerText;
29+
const count = document.getElementsByClassName("comicCount")[0].innerText;
30+
GM.setLoadingDialogProgress(index, count);
31+
window.scrollBy(0, speed);
32+
lastTime = timestamp;
33+
const currentHeight = document.body.scrollHeight;
34+
if (Math.round(window.innerHeight+window.scrollY+0.5) >= currentHeight) { /*避免小数不符无法触发*/
35+
if (currentHeight === prevHeight) {
36+
var images = document.getElementsByClassName("container-fluid comicContent")[0].getElementsByTagName("li");
37+
var nextChapter = document.getElementsByClassName("comicContent-next")[0].getElementsByTagName("a")[0].href;
38+
var prevChapter = document.getElementsByClassName("comicContent-prev")[1].getElementsByTagName("a")[0].href;
39+
if(nextChapter == location.href) nextChapter = "null";
40+
if(prevChapter == location.href) prevChapter = "null";
41+
var result = document.title.split(" - ")[1] + " " + location.href.substring(location.href.lastIndexOf("/")+1) + "\n" + nextChapter + "\n" + prevChapter;
42+
for(var i = 0; i < images.length; i++) result += "\n" + images[i].getElementsByTagName("img")[0].dataset.src;
43+
GM.setLoadingDialog(false);
44+
GM.loadChapter(result);
45+
return;
46+
}
47+
prevHeight = currentHeight;
48+
}
49+
}
50+
ticking = false;
51+
requestTick();
52+
}
53+
requestTick();
54+
}
1455
function modify() {
1556
var url = location.href;
16-
if(url.indexOf("/chapter/")>0){
17-
window.scroll({ top: document.body.scrollHeight, left: 0, behavior: 'smooth' });
18-
setTimeout(() => {
19-
window.scroll({ top: document.body.scrollHeight, left: 0, behavior: 'smooth' });
20-
setTimeout(() => {
21-
window.scroll({ top: document.body.scrollHeight, left: 0, behavior: 'smooth' });
22-
setTimeout(() => {
23-
window.scroll({ top: document.body.scrollHeight, left: 0, behavior: 'smooth' });
24-
setTimeout(() => {
25-
window.scroll({ top: document.body.scrollHeight, left: 0, behavior: 'smooth' });
26-
var imglist = document.getElementsByClassName("container-fluid comicContent")[0].getElementsByTagName("li");
27-
var nextChapter = document.getElementsByClassName("comicContent-next")[0].getElementsByTagName("a")[0].href;
28-
var prevChapter = document.getElementsByClassName("comicContent-prev")[1].getElementsByTagName("a")[0].href;
29-
if(nextChapter == location.href) nextChapter = "null";
30-
if(prevChapter == location.href) prevChapter = "null";
31-
var liststr = document.title.split(" - ")[1] + " " + location.href.substring(location.href.lastIndexOf("/")+1) + "\n" + nextChapter + "\n" + prevChapter;
32-
for(var i = 0; i < imglist.length; i++) liststr += "\n" + imglist[i].getElementsByTagName("img")[0].dataset.src;
33-
GM.loadChapter(liststr);
34-
}, 500);
35-
}, 500);
36-
}, 500);
37-
}, 500);
57+
if(url.indexOf("/chapter/") > 0){
58+
GM.setLoadingDialog(true);
59+
smoothLoadChapter(320, 16);
3860
} else {
3961
var json = Array();
4062
var chapters = document.getElementsByClassName("upLoop")[0].children;
@@ -55,4 +77,4 @@ if (typeof (loaded) == "undefined"){
5577
}
5678
}
5779
modify();
58-
}else modify();
80+
} else modify();

0 commit comments

Comments
 (0)