commit
53f0340098
File diff suppressed because one or more lines are too long
@ -1,3 +1,3 @@ |
|||||||
<!DOCTYPE html><html lang="zh-CN" style="padding: 0;height:100%"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="../favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"><title>Legado Bookshelf</title><link href="css/about.65a00131.css" rel="prefetch"><link href="css/detail.12a39aa7.css" rel="prefetch"><link href="js/about.cee6f6d7.js" rel="prefetch"><link href="js/detail.bb04bd6b.js" rel="prefetch"><link href="css/app.e4c919b7.css" rel="preload" as="style"><link href="css/chunk-vendors.bd1373b6.css" rel="preload" as="style"><link href="js/app.aa604b87.js" rel="preload" as="script"><link href="js/chunk-vendors.ca94fdd0.js" rel="preload" as="script"><link href="css/chunk-vendors.bd1373b6.css" rel="stylesheet"><link href="css/app.e4c919b7.css" rel="stylesheet"></head><style>body::-webkit-scrollbar { |
<!DOCTYPE html><html lang="zh-CN" style="padding: 0;height:100%"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="../favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"><title>Legado Bookshelf</title><link href="css/about.65a00131.css" rel="prefetch"><link href="css/detail.ac2331a7.css" rel="prefetch"><link href="js/about.74ccd735.js" rel="prefetch"><link href="js/detail.d5b3eb30.js" rel="prefetch"><link href="css/app.e4c919b7.css" rel="preload" as="style"><link href="css/chunk-vendors.bd1373b6.css" rel="preload" as="style"><link href="js/app.7cd09a57.js" rel="preload" as="script"><link href="js/chunk-vendors.d7fcc132.js" rel="preload" as="script"><link href="css/chunk-vendors.bd1373b6.css" rel="stylesheet"><link href="css/app.e4c919b7.css" rel="stylesheet"></head><style>body::-webkit-scrollbar { |
||||||
display: none; |
display: none; |
||||||
}</style><body style="margin: 0;height:100%"><noscript><strong>We're sorry but yd-web-tool doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.ca94fdd0.js"></script><script src="js/app.aa604b87.js"></script></body></html> |
}</style><body style="margin: 0;height:100%"><noscript><strong>We're sorry but yd-web-tool doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.d7fcc132.js"></script><script src="js/app.7cd09a57.js"></script></body></html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,62 @@ |
|||||||
|
package io.legado.app.utils |
||||||
|
|
||||||
|
import java.security.MessageDigest |
||||||
|
import javax.crypto.Mac |
||||||
|
import javax.crypto.spec.SecretKeySpec |
||||||
|
|
||||||
|
object DigestUtils { |
||||||
|
|
||||||
|
/** |
||||||
|
* 消息摘要 |
||||||
|
* 支持MD5 SHA-1 SHA-224 SHA-256 SHA-384 SHA-512 |
||||||
|
* https://developer.android.google.cn/reference/java/security/MessageDigest?hl=en |
||||||
|
*/ |
||||||
|
fun getDigest( |
||||||
|
algorithm: String, |
||||||
|
data: String? |
||||||
|
): String { |
||||||
|
data ?: return "" |
||||||
|
val bytes = getDigest(algorithm, data.toByteArray()) |
||||||
|
return StringUtils.byteToHexString(bytes) |
||||||
|
} |
||||||
|
|
||||||
|
fun getDigest( |
||||||
|
algorithm: String, |
||||||
|
data: ByteArray |
||||||
|
): ByteArray { |
||||||
|
return kotlin.runCatching { |
||||||
|
val messageDigest = MessageDigest.getInstance(algorithm) |
||||||
|
messageDigest.digest(data) |
||||||
|
}.getOrThrow() |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 散列消息鉴别码 |
||||||
|
* 支持DESMAC DESMAC/CFB8 DESedeMAC DESedeMAC/CFB8 DESedeMAC64 DESwithISO9797 HmacMD5 HmacSHA* ISO9797ALG3MAC PBEwithSHA* |
||||||
|
* https://developer.android.google.cn/reference/kotlin/javax/crypto/Mac?hl=en |
||||||
|
*/ |
||||||
|
fun getHMac( |
||||||
|
algorithm: String, |
||||||
|
key: String, |
||||||
|
data: String? |
||||||
|
): String { |
||||||
|
data ?: return "" |
||||||
|
val bytes = getHMac(algorithm, key.toByteArray(), data.toByteArray()) |
||||||
|
return StringUtils.byteToHexString(bytes) |
||||||
|
} |
||||||
|
|
||||||
|
fun getHMac( |
||||||
|
algorithm: String, |
||||||
|
key: ByteArray, |
||||||
|
data: ByteArray |
||||||
|
): ByteArray { |
||||||
|
return kotlin.runCatching { |
||||||
|
val mac= Mac.getInstance(algorithm) |
||||||
|
val keySpec = SecretKeySpec(key, algorithm) |
||||||
|
mac.init(keySpec) |
||||||
|
mac.update(data) |
||||||
|
mac.doFinal() |
||||||
|
}.getOrThrow() |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,6 +1,6 @@ |
|||||||
#Fri May 07 15:24:46 CST 2021 |
#Mon May 23 22:07:39 CST 2022 |
||||||
distributionBase=GRADLE_USER_HOME |
distributionBase=GRADLE_USER_HOME |
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip |
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip |
||||||
distributionPath=wrapper/dists |
distributionPath=wrapper/dists |
||||||
zipStorePath=wrapper/dists |
zipStorePath=wrapper/dists |
||||||
zipStoreBase=GRADLE_USER_HOME |
zipStoreBase=GRADLE_USER_HOME |
||||||
|
@ -1 +1,31 @@ |
|||||||
|
pluginManagement { |
||||||
|
repositories { |
||||||
|
//原仓库 |
||||||
|
gradlePluginPortal() |
||||||
|
google() |
||||||
|
mavenCentral() |
||||||
|
//镜像仓库,无法连接源仓库自行启用镜像仓库,不要提交修改 |
||||||
|
//maven {url"https://maven-central-asia.storage-download.googleapis.com/maven2/"} |
||||||
|
//maven { url 'https://maven.aliyun.com/repository/google' } |
||||||
|
//maven { url 'https://maven.aliyun.com/repository/public' } |
||||||
|
//maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
dependencyResolutionManagement { |
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) |
||||||
|
repositories { |
||||||
|
//原仓库 |
||||||
|
google() |
||||||
|
mavenCentral() |
||||||
|
maven { url 'https://jitpack.io' } |
||||||
|
//镜像仓库,无法连接源仓库自行启用镜像仓库,不要提交修改 |
||||||
|
//maven {url"https://maven-central-asia.storage-download.googleapis.com/maven2/"} |
||||||
|
//maven { url 'https://maven.aliyun.com/repository/google' } |
||||||
|
//maven { url 'https://maven.aliyun.com/repository/public' } |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
rootProject.name = 'legado' |
||||||
|
|
||||||
include ':app',':epublib' |
include ':app',':epublib' |
||||||
|
Loading…
Reference in new issue