修复部分已知bug

pull/5/head
fengyuecanzhu 4 years ago
parent 1776d017fe
commit d0e5b5cd72
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 10
      app/src/main/assets/fonts/_csrfToken.fy
  3. 6
      app/src/main/assets/updatelog.fy
  4. 10
      app/src/main/java/xyz/fycz/myreader/application/SysManager.java
  5. 2
      app/src/main/java/xyz/fycz/myreader/common/APPCONST.java
  6. 75
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookstoreActivity.java
  7. 6
      app/src/main/java/xyz/fycz/myreader/ui/activity/FeedbackActivity.java
  8. 34
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  9. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QiDianMobileRank.java
  10. 5
      app/src/main/java/xyz/fycz/myreader/widget/page/LocalPageLoader.java
  11. 2
      app/src/main/res/layout/layout_book_detail_content.xml
  12. 4
      app/src/main/res/values/strings.xml
  13. 2
      app/version_code.properties

@ -1,10 +0,0 @@
_csrfToken=6aY1oV18xaiLFe342vi6RRTJ1CsuZ7PZPqz2Tl9A; newstatisticUUID=1600427331_759036854,
_csrfToken=PnRLboRVY2ag0eGbG3e3dA3X4B96SpihEkCDGle7; newstatisticUUID=1600427449_1941387289,
_csrfToken=Ia5w2vTL03IHyPKiS5PJFgocvzHWbMgi4dBEvrox; newstatisticUUID=1600427497_1599098587,
_csrfToken=GjyWEsVXIta60t4YXkbtO0hsDc2VVBbfKy6GIBRg; newstatisticUUID=1600427528_887702937,
_csrfToken=iPjMCVKGnvL8QrbsdYIxCDNQZkJVSscN1CQFFSdF; newstatisticUUID=1600427557_1213608979,
_csrfToken=Iby8oSKxp767d25frgCGjOAWFWbYwwyRA36nBaxO; newstatisticUUID=1600427589_1737201533,
_csrfToken=IR81KoIAQxXYb6e9Agv8WuXDkAKukMLnlLe9BYha; newstatisticUUID=1600427619_487685580,
_csrfToken=YM1F8lgqaePVMceunc7z7ndjys5ngAx5sYsemg60; newstatisticUUID=1600427643_2022665645,
_csrfToken=8bRnXJseSCajlTcG6lhyWOF0rWwDCiMVpCGvKvQj; newstatisticUUID=1600427644_1615074434,
_csrfToken=AehQ3WVD6wLbFGhFsnSW4DRF6BS1wqVvHU6PbiiX; newstatisticUUID=1600427644_575162687

@ -1,6 +1,8 @@
2020.12.24 2020.01.08
风月读书v1.7.7 风月读书v1.7.8
1、新增建议反馈 1、新增建议反馈
2、修复部分已知bug
3、本地书籍支持匹配数字章节
2020.12.12 2020.12.12
风月读书v1.20.121218 风月读书v1.20.121218

@ -89,7 +89,8 @@ public class SysManager {
public static void resetSetting() { public static void resetSetting() {
Setting setting = getSetting(); Setting setting = getSetting();
switch (setting.getSettingVersion()) { switch (setting.getSettingVersion()) {
case 10: default: case 10:
default:
setting.initReadStyle(); setting.initReadStyle();
setting.setCurReadStyleIndex(1); setting.setCurReadStyleIndex(1);
setting.setSharedLayout(true); setting.setSharedLayout(true);
@ -106,7 +107,8 @@ public class SysManager {
public static void resetSource() { public static void resetSource() {
Setting setting = getSetting(); Setting setting = getSetting();
switch (setting.getSourceVersion()) { switch (setting.getSourceVersion()) {
case 0: default: case 0:
default:
ReadCrawlerUtil.addReadCrawler(BookSource.miaobi, BookSource.dstq, BookSource.xs7, BookSource.du1du, BookSource.paiotian); ReadCrawlerUtil.addReadCrawler(BookSource.miaobi, BookSource.dstq, BookSource.xs7, BookSource.du1du, BookSource.paiotian);
ReadCrawlerUtil.removeReadCrawler("cangshu99"); ReadCrawlerUtil.removeReadCrawler("cangshu99");
Log.d("SourceVersion", "" + 0); Log.d("SourceVersion", "" + 0);
@ -116,6 +118,10 @@ public class SysManager {
case 2: case 2:
ReadCrawlerUtil.addReadCrawler(BookSource.rexue, BookSource.chuanqi); ReadCrawlerUtil.addReadCrawler(BookSource.rexue, BookSource.chuanqi);
Log.d("SourceVersion", "" + 2); Log.d("SourceVersion", "" + 2);
case 3:
ReadCrawlerUtil.resetReadCrawlers();
Log.d("SourceVersion", "" + 3);
} }
setting.setSourceVersion(APPCONST.SOURCE_VERSION); setting.setSourceVersion(APPCONST.SOURCE_VERSION);
saveSetting(setting); saveSetting(setting);

@ -82,7 +82,7 @@ public class APPCONST {
//设置版本号 //设置版本号
public static final int SETTING_VERSION = 11; public static final int SETTING_VERSION = 11;
public static final int SOURCE_VERSION = 3; public static final int SOURCE_VERSION = 4;
public static final String FORMAT_FILE_DATE = "yyyy-MM-dd"; public static final String FORMAT_FILE_DATE = "yyyy-MM-dd";

@ -9,11 +9,15 @@ import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView; import butterknife.BindView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.application.MyApplication;
import xyz.fycz.myreader.base.BaseActivity; import xyz.fycz.myreader.base.BaseActivity;
@ -76,35 +80,33 @@ public class BookstoreActivity extends BaseActivity {
private Handler mHandler = new Handler() { private Handler mHandler = new Handler() {
@Override @Override
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
if (!MyApplication.isDestroy(BookstoreActivity.this)) { switch (msg.what) {
switch (msg.what) { case 1:
case 1: initTypeList();
initTypeList(); mRlRefresh.showFinish();
mRlRefresh.showFinish(); break;
break; case 2:
case 2: List<Book> bookList = (List<Book>) msg.obj;
List<Book> bookList = (List<Book>) msg.obj; initBookList(bookList);
initBookList(bookList); srlBookList.setEnableRefresh(true);
srlBookList.setEnableRefresh(true); srlBookList.setEnableLoadMore(true);
srlBookList.setEnableLoadMore(true); pbLoading.setVisibility(View.GONE);
pbLoading.setVisibility(View.GONE); break;
break; case 3:
case 3: pbLoading.setVisibility(View.VISIBLE);
pbLoading.setVisibility(View.VISIBLE); break;
break; case 4:
case 4: pbLoading.setVisibility(View.GONE);
pbLoading.setVisibility(View.GONE); srlBookList.finishRefresh(false);
srlBookList.finishRefresh(false); srlBookList.finishLoadMore(false);
srlBookList.finishLoadMore(false); break;
break; case 5:
case 5: mRlRefresh.showError();
mRlRefresh.showError(); break;
break; case 6:
case 6: DialogCreator.createTipDialog(BookstoreActivity.this,
DialogCreator.createTipDialog(BookstoreActivity.this, getResources().getString(R.string.top_sort_tip, title));
getResources().getString(R.string.top_sort_tip, title)); break;
break;
}
} }
} }
}; };
@ -225,6 +227,7 @@ public class BookstoreActivity extends BaseActivity {
((QiDianMobileRank) findCrawler).initCookie(this, new ResultCallback() { ((QiDianMobileRank) findCrawler).initCookie(this, new ResultCallback() {
@Override @Override
public void onFinish(Object o, int code) { public void onFinish(Object o, int code) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
spu.putString(getString(R.string.qdCookie), (String) o); spu.putString(getString(R.string.qdCookie), (String) o);
mBookTypes = findCrawler.getBookTypes(); mBookTypes = findCrawler.getBookTypes();
initBooks(); initBooks();
@ -232,6 +235,7 @@ public class BookstoreActivity extends BaseActivity {
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
mRlRefresh.showError(); mRlRefresh.showError();
e.printStackTrace(); e.printStackTrace();
} }
@ -240,18 +244,20 @@ public class BookstoreActivity extends BaseActivity {
mBookTypes = findCrawler.getBookTypes(); mBookTypes = findCrawler.getBookTypes();
initBooks(); initBooks();
} }
} else if ((mBookTypes = findCrawler.getBookTypes()) != null){ } else if ((mBookTypes = findCrawler.getBookTypes()) != null) {
initBooks(); initBooks();
} else { } else {
BookStoreApi.getBookTypeList(findCrawler, new ResultCallback() { BookStoreApi.getBookTypeList(findCrawler, new ResultCallback() {
@Override @Override
public void onFinish(Object o, int code) { public void onFinish(Object o, int code) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
mBookTypes = (ArrayList<BookType>) o; mBookTypes = (ArrayList<BookType>) o;
initBooks(); initBooks();
} }
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
e.printStackTrace(); e.printStackTrace();
mHandler.sendEmptyMessage(5); mHandler.sendEmptyMessage(5);
} }
@ -259,7 +265,7 @@ public class BookstoreActivity extends BaseActivity {
} }
} }
private void initBooks(){ private void initBooks() {
curType = mBookTypes.get(0); curType = mBookTypes.get(0);
mHandler.sendMessage(mHandler.obtainMessage(1)); mHandler.sendMessage(mHandler.obtainMessage(1));
page = 1; page = 1;
@ -280,6 +286,7 @@ public class BookstoreActivity extends BaseActivity {
((QiDianMobileRank) findCrawler).getRankBooks(curType, new ResultCallback() { ((QiDianMobileRank) findCrawler).getRankBooks(curType, new ResultCallback() {
@Override @Override
public void onFinish(Object o, int code) { public void onFinish(Object o, int code) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
List<Book> books = new ArrayList<>(); List<Book> books = new ArrayList<>();
for (QDBook rb : (List<QDBook>) o) { for (QDBook rb : (List<QDBook>) o) {
Book book = new Book(); Book book = new Book();
@ -291,8 +298,7 @@ public class BookstoreActivity extends BaseActivity {
book.setNewestChapterTitle(rb.getDesc()); book.setNewestChapterTitle(rb.getDesc());
book.setDesc(rb.getDesc()); book.setDesc(rb.getDesc());
if (rb instanceof RankBook) { if (rb instanceof RankBook) {
boolean hasRankCnt = !((RankBook) rb).getRankCnt().equals("null") && boolean hasRankCnt = !((RankBook) rb).getRankCnt().equals("null");
MyApplication.isApkInDebug(BookstoreActivity.this);
book.setUpdateDate(hasRankCnt ? book.getType() + "-" + rb.getCnt() : rb.getCnt()); book.setUpdateDate(hasRankCnt ? book.getType() + "-" + rb.getCnt() : rb.getCnt());
book.setNewestChapterId(hasRankCnt ? ((RankBook) rb).getRankCnt() : book.getType()); book.setNewestChapterId(hasRankCnt ? ((RankBook) rb).getRankCnt() : book.getType());
} else if (rb instanceof SortBook) { } else if (rb instanceof SortBook) {
@ -306,6 +312,7 @@ public class BookstoreActivity extends BaseActivity {
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
mHandler.sendMessage(mHandler.obtainMessage(4)); mHandler.sendMessage(mHandler.obtainMessage(4));
ToastUtils.showError("数据加载失败!\n" + e.getMessage()); ToastUtils.showError("数据加载失败!\n" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
@ -315,11 +322,13 @@ public class BookstoreActivity extends BaseActivity {
BookStoreApi.getBookRankList(curType, findCrawler, new ResultCallback() { BookStoreApi.getBookRankList(curType, findCrawler, new ResultCallback() {
@Override @Override
public void onFinish(Object o, int code) { public void onFinish(Object o, int code) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
mHandler.sendMessage(mHandler.obtainMessage(2, o)); mHandler.sendMessage(mHandler.obtainMessage(2, o));
} }
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
if (MyApplication.isDestroy(BookstoreActivity.this)) return;
mHandler.sendMessage(mHandler.obtainMessage(4)); mHandler.sendMessage(mHandler.obtainMessage(4));
ToastUtils.showError("数据加载失败!\n" + e.getMessage()); ToastUtils.showError("数据加载失败!\n" + e.getMessage());
e.printStackTrace(); e.printStackTrace();

@ -13,6 +13,7 @@ import androidx.appcompat.widget.Toolbar;
import butterknife.BindView; import butterknife.BindView;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.MyApplication;
import xyz.fycz.myreader.base.BaseActivity; import xyz.fycz.myreader.base.BaseActivity;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.widget.RefreshLayout; import xyz.fycz.myreader.widget.RefreshLayout;
@ -68,13 +69,14 @@ public class FeedbackActivity extends BaseActivity {
@Override @Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error); super.onReceivedError(view, request, error);
mRlRefresh.showError(); if (!MyApplication.isDestroy(FeedbackActivity.this))
mRlRefresh.showError();
} }
}); });
wvFeedback.setWebChromeClient(new WebChromeClient(){ wvFeedback.setWebChromeClient(new WebChromeClient(){
@Override @Override
public void onProgressChanged(WebView view, int newProgress) { public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100){ if (newProgress == 100 && !MyApplication.isDestroy(FeedbackActivity.this)){
mRlRefresh.showFinish(); mRlRefresh.showFinish();
} }
}}); }});

@ -11,6 +11,7 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.os.PersistableBundle;
import android.util.Log; import android.util.Log;
import android.view.*; import android.view.*;
import android.view.animation.Animation; import android.view.animation.Animation;
@ -21,6 +22,8 @@ import android.widget.ProgressBar;
import android.widget.SeekBar; import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
@ -186,6 +189,10 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
private boolean hasChangeSource; private boolean hasChangeSource;
private int pagePos;
private int chapterPos;
private Animation mTopInAnim; private Animation mTopInAnim;
private Animation mTopOutAnim; private Animation mTopOutAnim;
private Animation mBottomInAnim; private Animation mBottomInAnim;
@ -284,6 +291,27 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
} }
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
if (savedInstanceState != null) {
pagePos = savedInstanceState.getInt("pagePos");
chapterPos = savedInstanceState.getInt("chapterPos");
}else {
pagePos = -1;
chapterPos = -1;
}
super.onCreate(savedInstanceState);
}
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
if (mBook != null) {
outState.putInt("pagePos", mBook.getLastReadPosition());
outState.putInt("chapterPos", mBook.getHisttoryChapterNum());
}
}
@Override @Override
protected void setUpToolbar(Toolbar toolbar) { protected void setUpToolbar(Toolbar toolbar) {
super.setUpToolbar(toolbar); super.setUpToolbar(toolbar);
@ -301,6 +329,10 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
finish(); finish();
return; return;
} }
if (pagePos != -1 && chapterPos != -1){
mBook.setHisttoryChapterNum(chapterPos);
mBook.setLastReadPosition(pagePos);
}
if (SharedPreUtils.getInstance().getBoolean(getString(R.string.isNightFS), false)) { if (SharedPreUtils.getInstance().getBoolean(getString(R.string.isNightFS), false)) {
mSetting.setDayStyle(!ColorUtil.isColorLight(getResources().getColor(R.color.textPrimary))); mSetting.setDayStyle(!ColorUtil.isColorLight(getResources().getColor(R.color.textPrimary)));
} }
@ -794,11 +826,13 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
public void onDialogDismissed(int dialogId) { public void onDialogDismissed(int dialogId) {
} }
/**************************method*********************************/ /**************************method*********************************/
/** /**
* 初始化 * 初始化
*/ */
private void init() { private void init() {
if (MyApplication.isDestroy(this)) return;
screenOffTimerStart(); screenOffTimerStart();
mPageLoader.init(); mPageLoader.init();
mPageLoader.refreshChapterList(); mPageLoader.refreshChapterList();

@ -212,7 +212,7 @@ public class QiDianMobileRank extends FindCrawler {
@Override @Override
public String getFindName() { public String getFindName() {
return !isFemale ? !isSort ? "排行榜[男生小说]" : "分类[男生小说]" : !isSort ? "排行榜[女生小说]" : "分类[女生小说]"; return !isFemale ? !isSort ? "排行榜[起点中文网]" : "分类[起点中文网]" : !isSort ? "排行榜[起点女生网]" : "分类[起点女生网]";
} }
@Override @Override

@ -44,7 +44,9 @@ public class LocalPageLoader extends PageLoader {
"^(\\s{0,4})([\\(\u3010\u300a]?(\u5377)?)([0-9\u96f6\u4e00\u4e8c\u4e24\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396\u62fe\u4f70\u4edf]{1,10})([\\.:\uff1a\u0020\f\t])(.{0,30})$", "^(\\s{0,4})([\\(\u3010\u300a]?(\u5377)?)([0-9\u96f6\u4e00\u4e8c\u4e24\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396\u62fe\u4f70\u4edf]{1,10})([\\.:\uff1a\u0020\f\t])(.{0,30})$",
"^(\\s{0,4})([\\(\uff08\u3010\u300a])(.{0,30})([\\)\uff09\u3011\u300b])(\\s{0,2})$", "^(\\s{0,4})([\\(\uff08\u3010\u300a])(.{0,30})([\\)\uff09\u3011\u300b])(\\s{0,2})$",
"^(\\s{0,4})(\u6b63\u6587)(.{0,20})$", "^(\\s{0,4})(\u6b63\u6587)(.{0,20})$",
"^(.{0,4})(Chapter|chapter)(\\s{0,4})([0-9]{1,4})(.{0,30})$"}; "^(.{0,4})(Chapter|chapter)(\\s{0,4})([0-9]{1,4})(.{0,30})$",
"^(\\s{0,4})(\\d{1,5}[::,.,、_—\\-])(.{1,30})$",
"^(\\s{0,4})(\u756a\u5916)(.{0,20})$"};
//章节解析模式 //章节解析模式
private Pattern mChapterPattern = null; private Pattern mChapterPattern = null;
@ -70,6 +72,7 @@ public class LocalPageLoader extends PageLoader {
*/ */
private List<Chapter> loadChapters() throws IOException { private List<Chapter> loadChapters() throws IOException {
mBookFile = new File(mCollBook.getChapterUrl()); mBookFile = new File(mCollBook.getChapterUrl());
//获取文件编码 //获取文件编码
mCharset = FileUtils.getFileCharset(mBookFile); mCharset = FileUtils.getFileCharset(mBookFile);

@ -53,7 +53,7 @@
android:gravity="right" android:gravity="right"
android:padding="15dp" android:padding="15dp"
android:text="更多" android:text="更多"
android:textColor="@color/textAssist" android:textColor="@color/textSecondary"
android:textSize="15sp" /> android:textSize="15sp" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView

@ -214,8 +214,8 @@
<string name="read_cangshu99">99藏书·实体</string> <string name="read_cangshu99">99藏书·实体</string>
<string name="read_ben100">100本·实体</string> <string name="read_ben100">100本·实体</string>
<string name="find_qidian">男生小说</string> <string name="find_qidian">起点中文网</string>
<string name="find_qidian_ns">女生小说</string> <string name="find_qidian_ns">起点女生网</string>
<!-- 朗读 --> <!-- 朗读 -->
<string name="read_aloud">朗读</string> <string name="read_aloud">朗读</string>

@ -1,2 +1,2 @@
#Thu Dec 24 22:07:42 CST 2020 #Fri Jan 08 23:11:19 CST 2021
VERSION_CODE=177 VERSION_CODE=177

Loading…
Cancel
Save