Skip to content

Commit

Permalink
Merge branch 'release-tci' of github.com:Haleydu/Cimoc into release-tci
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleydu committed Feb 20, 2021
2 parents 4800629 + 14172b4 commit 52b0175
Show file tree
Hide file tree
Showing 18 changed files with 747 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ android {
}

greendao {
schemaVersion 11
schemaVersion 12
}

dependencies {
Expand Down
187 changes: 187 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,194 @@
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name=".ui.activity.StreamReaderActivity"
android:forceDarkAllowed="false"
android:theme="@style/AppThemeNoDark"
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name=".ui.activity.BrowserFilter"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="cimoc" />
<data
android:host="m.buka.cn"
android:scheme="http" />
<data
android:host="m.buka.cn"
android:scheme="https" />
<data
android:host="www.dm5.com"
android:scheme="http" />
<data
android:host="www.dm5.com"
android:scheme="https" />
<data
android:host="tel.dm5.com"
android:scheme="http" />
<data
android:host="tel.dm5.com"
android:scheme="https" />
<data
android:host="manhua.dmzj.com"
android:scheme="http" />
<data
android:host="manhua.dmzj.com"
android:scheme="https" />
<data
android:host="m.dmzj.com"
android:scheme="http" />
<data
android:host="m.dmzj.com"
android:scheme="https" />
<!-- <data
android:host="www.manhuagui.com"
android:scheme="http" />
<data
android:host="www.manhuagui.com"
android:scheme="https" />
<data
android:host="tw.manhuagui.com"
android:scheme="http" />
<data
android:host="tw.manhuagui.com"
android:scheme="https" />
<data
android:host="m.manhuagui.com"
android:scheme="http" />
<data
android:host="m.manhuagui.com"
android:scheme="https" /> -->
<data
android:host="m.5qmh.com"
android:scheme="http" />
<data
android:host="m.5qmh.com"
android:scheme="https" />
<data
android:host="m.pufei.net"
android:scheme="http" />
<data
android:host="m.pufei.net"
android:scheme="https" />
<data
android:host="ac.qq.com"
android:scheme="http" />
<data
android:host="ac.qq.com"
android:scheme="https" />
<data
android:host="m.ac.qq.com"
android:scheme="http" />
<data
android:host="m.ac.qq.com"
android:scheme="https" />
<data
android:host="www.u17.com"
android:scheme="http" />
<data
android:host="www.u17.com"
android:scheme="https" />
<data
android:host="www.migudm.cn"
android:scheme="http" />
<data
android:host="www.migudm.cn"
android:scheme="https" />
<data
android:host="m.migudm.cn"
android:scheme="http" />
<data
android:host="m.migudm.cn"
android:scheme="https" />
<!-- <data
android:host="h5.manhua.163.com"
android:scheme="http" />
<data
android:host="h5.manhua.163.com"
android:scheme="https" /> -->
<data
android:host="99770.hhxxee.com"
android:scheme="http" />
<data
android:host="99770.hhxxee.com"
android:scheme="https" />
<data
android:host="www.cartoonmad.com"
android:scheme="http" />
<data
android:host="www.cartoonmad.com"
android:scheme="https" />
<data
android:host="www.2animx.com"
android:scheme="http" />
<data
android:host="www.2animx.com"
android:scheme="https" />
<data
android:host="www.50mh.com"
android:scheme="http" />
<data
android:host="www.50mh.com"
android:scheme="https" />
<data
android:host="m.50mh.com"
android:scheme="http" />
<data
android:host="m.50mh.com"
android:scheme="https" />
<data
android:host="www.manhuadb.com"
android:scheme="http" />
<data
android:host="www.manhuadb.com"
android:scheme="https" />
<data
android:host="m.bnmanhua.com"
android:scheme="http" />
<data
android:host="m.bnmanhua.com"
android:scheme="https" />
<data
android:host="m.tohomh123.com"
android:scheme="http" />
<data
android:host="m.tohomh123.com"
android:scheme="https" />
<data
android:host="www.chuixue.net"
android:scheme="http" />
<data
android:host="www.chuixue.net"
android:scheme="https" />
<data
android:host="m.517manhua.com"
android:scheme="http" />
<data
android:host="m.517manhua.com"
android:scheme="https" />
<data
android:host="m.ykmh.com"
android:scheme="https" />
<data
android:host="m.mh160.xyz"
android:scheme="https" />
<data
android:host="www.mh160.xyz"
android:scheme="https" />
</intent-filter>
</activity>

<service android:name=".service.DownloadService" />

Expand Down
19 changes: 19 additions & 0 deletions app/src/main/java/com/hiroshi/cimoc/helper/DBOpenHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

import com.hiroshi.cimoc.model.ChapterDao;
import com.hiroshi.cimoc.model.ComicDao;
Expand All @@ -11,6 +12,7 @@
import com.hiroshi.cimoc.model.TagDao;
import com.hiroshi.cimoc.model.TagRefDao;
import com.hiroshi.cimoc.model.TaskDao;
import com.hiroshi.cimoc.utils.StringUtils;

import org.greenrobot.greendao.database.Database;

Expand All @@ -34,6 +36,7 @@ public void onCreate(Database db) {

@Override
public void onUpgrade(Database db, int oldVersion, int newVersion) {
Log.d("DB", StringUtils.format("DB V:%d,%d", oldVersion, newVersion));
switch (oldVersion) {
case 1:
SourceDao.createTable(db, false);
Expand All @@ -58,9 +61,25 @@ public void onUpgrade(Database db, int oldVersion, int newVersion) {
updateIntroAndAuthor(db);
ChapterDao.createTable(db, true);
ImageUrlDao.createTable(db, true);
case 11:
updateChapter(db);

}
}

private void updateChapter(Database db) {
db.beginTransaction();
db.execSQL("ALTER TABLE \"CHAPTER\" RENAME TO \"CHAPTER2\"");
ChapterDao.createTable(db, false);
db.execSQL("INSERT INTO \"CHAPTER\" (\"_id\", \"SOURCE_COMIC\", \"TITLE\", \"PATH\", \"COUNT\", \"COMPLETE\", \"DOWNLOAD\", \"TID\" , \"SOURCE_GROUP\")" +
" SELECT \"_id\", \"SOURCE_COMIC\", \"TITLE\", \"PATH\", \"COUNT\", \"COMPLETE\", \"DOWNLOAD\", \"TID\",\"\" FROM \"CHAPTER2\"");
db.execSQL("DROP TABLE \"CHAPTER2\"");
db.setTransactionSuccessful();
db.endTransaction();


}

private void updateLocal(Database db) {
db.beginTransaction();
db.execSQL("ALTER TABLE \"COMIC\" RENAME TO \"COMIC2\"");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private static void initSource(DaoSession session) {
list.add(MH160.getDefaultSource());
list.add(QiMiaoMH.getDefaultSource());
list.add(YKMH.getDefaultSource());
list.add(DmzjFix.getDefaultSource());
session.getSourceDao().insertOrReplaceInTx(list);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ public Parser getParser(int type) {
case YKMH.TYPE:
parser = new YKMH(source);
break;
case DmzjFix.TYPE:
parser = new DmzjFix(source);
break;
default:
parser = new Null();
break;
Expand Down
37 changes: 29 additions & 8 deletions app/src/main/java/com/hiroshi/cimoc/model/Chapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/**
* Created by Hiroshi on 2016/7/2.
* fixed by Haleydu on 2020/8/25.
* Modified by lx200916 on 2021/2/7
*/
@Entity
public class Chapter implements Parcelable {
Expand All @@ -36,13 +37,19 @@ public Chapter[] newArray(int size) {
private boolean complete;
private boolean download;
private long tid;
private String sourceGroup;

public Chapter(Long id,Long sourceComic,String title, String path, long tid) {
this(id,sourceComic,title, path, 0, false, false, tid);
public Chapter(Long id, Long sourceComic, String title, String path, long tid) {
this(id, sourceComic, title, path, 0, false, false, tid, "");
}

public Chapter(Long id,Long sourceComic,String title, String path) {
this(id,sourceComic,title, path, 0, false, false, -1);
public Chapter(Long id, Long sourceComic, String title, String path, String sourceGroup) {
this(id, sourceComic, title, path, 0, false, false, -1, sourceGroup);

}

public Chapter(Long id, Long sourceComic, String title, String path) {
this(id, sourceComic, title, path, 0, false, false, -1, "");
}

public Chapter(String title, String path) {
Expand All @@ -53,13 +60,18 @@ public Chapter(String title, String path) {
this.download = false;
this.tid = -1;
}

public Chapter(Parcel source) {
this(source.readLong(), source.readLong(),source.readString(), source.readString(), source.readInt(), source.readByte() == 1, source.readByte() == 1, source.readLong());
this(source.readLong(), source.readLong(), source.readString(), source.readString(), source.readInt(), source.readByte() == 1, source.readByte() == 1, source.readLong(), "");
}

@Generated(hash = 342970835)
public Chapter(Long id, @NotNull Long sourceComic, String title, String path, int count, boolean complete, boolean download, long tid) {
public Chapter(Long id, Long sourceComic, String title, String path, int progress, boolean b, boolean b1, Long id1) {
this(id, sourceComic, title, path, progress, b, b1, id1, "");

}

@Generated(hash = 1726293378)
public Chapter(Long id, @NotNull Long sourceComic, String title, String path, int count, boolean complete, boolean download, long tid, String sourceGroup) {
this.id = id;
this.sourceComic = sourceComic;
this.title = title;
Expand All @@ -68,6 +80,15 @@ public Chapter(Long id, @NotNull Long sourceComic, String title, String path, in
this.complete = complete;
this.download = download;
this.tid = tid;
this.sourceGroup = sourceGroup;
}

public String getSourceGroup() {
return sourceGroup == null ? "" : sourceGroup;
}

public void setSourceGroup(String sourceGroup) {
this.sourceGroup = sourceGroup;
}

@Generated(hash = 393170288)
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/hiroshi/cimoc/model/Comic.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class Comic {
private Integer page;
private String chapter;
private String url;
@Transient
public Object note;


private String intro;
Expand All @@ -43,7 +45,7 @@ public class Comic {

public Comic(int source, String cid, String title, String cover, String update, String author) {
this(null, source, cid, title, cover == null ? "" : cover, false, false, update,
null, null, null, null, null, null, null, null,null,null);
null, null, null, null, null, null, null, null, null, null);
this.author = author;
}

Expand Down
Loading

0 comments on commit 52b0175

Please sign in to comment.