Skip to content

Commit

Permalink
feat: 导入时默认为显示状态,针对复制的内容做校验 (#252)
Browse files Browse the repository at this point in the history
* feat: 导入时默认为显示状态,针对复制的内容做校验

* feat: 导入时默认为显示状态,针对复制的内容做校验
  • Loading branch information
yi-boide authored Aug 8, 2024
1 parent f8e8404 commit 66223f9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
6 changes: 5 additions & 1 deletion commons/colorLibrary/obfuscation-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@

# Keep options:
# -keep-property-name: specifies property names that you want to keep
# -keep-global-name: specifies names that you want to keep in the global scope
# -keep-global-name: specifies names that you want to keep in the global scope
-enable-property-obfuscation
-enable-toplevel-obfuscation
-enable-filename-obfuscation
-enable-export-obfuscation
2 changes: 1 addition & 1 deletion entry/src/main/ets/database/AppDatabase/index.ets
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export default {
},
{
"tableName": "book_sources",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookSourceUrl` TEXT NOT NULL, `bookSourceName` TEXT NOT NULL, `bookSourceGroup` TEXT, `bookSourceType` INTEGER NOT NULL, `bookUrlPattern` TEXT, `bookSourceGrade` INTEGER NOT NULL DEFAULT 2, `isTop` INTEGER NOT NULL DEFAULT 0, `showExplore` INTEGER NOT NULL DEFAULT 0, `showRecentIcon` INTEGER NOT NULL DEFAULT 1, `bookSourceScore` TEXT NOT NULL DEFAULT `5.0分`, `customOrder` INTEGER NOT NULL DEFAULT 0, `enabled` INTEGER NOT NULL DEFAULT 1, `enabledExplore` INTEGER NOT NULL DEFAULT 1, `jsLib` TEXT, `enabledCookieJar` INTEGER DEFAULT 0, `concurrentRate` TEXT, `header` TEXT, `loginUrl` TEXT, `loginUi` TEXT, `loginCheckJs` TEXT, `coverDecodeJs` TEXT, `bookSourceComment` TEXT, `variableComment` TEXT, `lastUpdateTime` INTEGER NOT NULL, `respondTime` INTEGER NOT NULL, `weight` INTEGER NOT NULL, `exploreUrl` TEXT, `exploreScreen` TEXT, `ruleExplore` TEXT, `searchUrl` TEXT, `ruleSearch` TEXT, `ruleBookInfo` TEXT, `ruleToc` TEXT, `ruleContent` TEXT, `ruleReview` TEXT, PRIMARY KEY(`bookSourceUrl`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookSourceUrl` TEXT NOT NULL, `bookSourceName` TEXT NOT NULL, `bookSourceGroup` TEXT, `bookSourceType` INTEGER NOT NULL, `bookUrlPattern` TEXT, `bookSourceGrade` INTEGER NOT NULL DEFAULT 2, `isTop` INTEGER NOT NULL DEFAULT 0, `showExplore` INTEGER NOT NULL DEFAULT 1, `showRecentIcon` INTEGER NOT NULL DEFAULT 1, `bookSourceScore` TEXT NOT NULL DEFAULT `5.0分`, `customOrder` INTEGER NOT NULL DEFAULT 0, `enabled` INTEGER NOT NULL DEFAULT 1, `enabledExplore` INTEGER NOT NULL DEFAULT 1, `jsLib` TEXT, `enabledCookieJar` INTEGER DEFAULT 0, `concurrentRate` TEXT, `header` TEXT, `loginUrl` TEXT, `loginUi` TEXT, `loginCheckJs` TEXT, `coverDecodeJs` TEXT, `bookSourceComment` TEXT, `variableComment` TEXT, `lastUpdateTime` INTEGER NOT NULL, `respondTime` INTEGER NOT NULL, `weight` INTEGER NOT NULL, `exploreUrl` TEXT, `exploreScreen` TEXT, `ruleExplore` TEXT, `searchUrl` TEXT, `ruleSearch` TEXT, `ruleBookInfo` TEXT, `ruleToc` TEXT, `ruleContent` TEXT, `ruleReview` TEXT, PRIMARY KEY(`bookSourceUrl`))",
"fields": [
{
"fieldPath": "bookSourceUrl",
Expand Down
14 changes: 8 additions & 6 deletions entry/src/main/ets/pages/view/Find/IndexFind.ets
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,18 @@ export default struct IndexFind {

async pasteAnalyze() {
try {
const url = getPasteDataSync()
let url = getPasteDataSync()
if (!url) {
showMessage('未获取到粘贴信息,请求默认数据')
showMessage('未获取到粘贴信息')
await sleep()
// return
}
// if (!isNetworkUrl(url ?? '')) {
// showMessage('复制的链接不正确')
// return
// }
if (!isNetworkUrl(url ?? '')) {
showMessage('复制的链接不正确')
await sleep()
url = undefined
// return
}
const res: AxiosResponse = await axios
.get(url ?? 'https://node.wisdoms.xin/static/file/20240704/sy.json');
this.sourceList = res.data;
Expand Down
6 changes: 5 additions & 1 deletion readerLibrary/obfuscation-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@

# Keep options:
# -keep-property-name: specifies property names that you want to keep
# -keep-global-name: specifies names that you want to keep in the global scope
# -keep-global-name: specifies names that you want to keep in the global scope
-enable-property-obfuscation
-enable-toplevel-obfuscation
-enable-filename-obfuscation
-enable-export-obfuscation

0 comments on commit 66223f9

Please sign in to comment.