修复部分已知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
风月读书v1.7.7
2020.01.08
风月读书v1.7.8
1、新增建议反馈
2、修复部分已知bug
3、本地书籍支持匹配数字章节
2020.12.12
风月读书v1.20.121218

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

@ -82,7 +82,7 @@ public class APPCONST {
//设置版本号
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";

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

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

@ -11,6 +11,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PersistableBundle;
import android.util.Log;
import android.view.*;
import android.view.animation.Animation;
@ -21,6 +22,8 @@ import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
@ -186,6 +189,10 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
private boolean hasChangeSource;
private int pagePos;
private int chapterPos;
private Animation mTopInAnim;
private Animation mTopOutAnim;
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
protected void setUpToolbar(Toolbar toolbar) {
super.setUpToolbar(toolbar);
@ -301,6 +329,10 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
finish();
return;
}
if (pagePos != -1 && chapterPos != -1){
mBook.setHisttoryChapterNum(chapterPos);
mBook.setLastReadPosition(pagePos);
}
if (SharedPreUtils.getInstance().getBoolean(getString(R.string.isNightFS), false)) {
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) {
}
/**************************method*********************************/
/**
* 初始化
*/
private void init() {
if (MyApplication.isDestroy(this)) return;
screenOffTimerStart();
mPageLoader.init();
mPageLoader.refreshChapterList();

@ -212,7 +212,7 @@ public class QiDianMobileRank extends FindCrawler {
@Override
public String getFindName() {
return !isFemale ? !isSort ? "排行榜[男生小说]" : "分类[男生小说]" : !isSort ? "排行榜[女生小说]" : "分类[女生小说]";
return !isFemale ? !isSort ? "排行榜[起点中文网]" : "分类[起点中文网]" : !isSort ? "排行榜[起点女生网]" : "分类[起点女生网]";
}
@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})([\\(\uff08\u3010\u300a])(.{0,30})([\\)\uff09\u3011\u300b])(\\s{0,2})$",
"^(\\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;
@ -70,6 +72,7 @@ public class LocalPageLoader extends PageLoader {
*/
private List<Chapter> loadChapters() throws IOException {
mBookFile = new File(mCollBook.getChapterUrl());
//获取文件编码
mCharset = FileUtils.getFileCharset(mBookFile);

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

@ -214,8 +214,8 @@
<string name="read_cangshu99">99藏书·实体</string>
<string name="read_ben100">100本·实体</string>
<string name="find_qidian">男生小说</string>
<string name="find_qidian_ns">女生小说</string>
<string name="find_qidian">起点中文网</string>
<string name="find_qidian_ns">起点女生网</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

Loading…
Cancel
Save