Skip to content

Commit

Permalink
build : release 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon406 committed Sep 5, 2021
1 parent e264668 commit d071ae2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion current
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.6.0
3 changes: 2 additions & 1 deletion src/main/kotlin/me/leon/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const val VERSION = "1.6.0"
const val REPO_URL = "https://github.com/Leon406/ToolsFx"
const val PJ52_URL = "https://www.52pojie.cn/thread-1501153-1-1.html"
const val LAN_ZOU_DOWNLOAD_URL = "https://leon.lanzoui.com/b0d9av2kb"
const val CHECK_UPDATE_URL = "https://cdn.staticaly.com/gh/Leon406/ToolsFx/dev/current"
const val CHECK_UPDATE_URL = "https://cdn.staticaly.com/gh/Leon406/ToolsFx/main/current"
const val CHECK_UPDATE_URL2 = "https://gitee.com/LeonShih/ToolsFx/raw/main/current"
const val LICENSE = "https://cdn.staticaly.com/gh/Leon406/ToolsFx/main/LICENSE"
const val APP_NAME = "密码学工具箱 by Leon406 "
24 changes: 11 additions & 13 deletions src/main/kotlin/me/leon/ext/Net.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ const val RESPONSE_OK = 200

fun String.readBytesFromNet() =
(URL(this).openConnection().apply {
// setRequestProperty("Referer",
// "https://pc.woozooo.com/mydisk.php")
connectTimeout = DEFAULT_CONNECT_TIME_OUT
readTimeout = DEFAULT_READ_TIME_OUT
setRequestProperty("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
setRequestProperty(
"user-agent",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) " +
connectTimeout = DEFAULT_CONNECT_TIME_OUT
readTimeout = DEFAULT_READ_TIME_OUT
setRequestProperty("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
setRequestProperty(
"user-agent",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) " +
"Chrome/86.0.4240.198 Safari/537.36"
)
} as
)
} as
HttpURLConnection)
.takeIf {
// println("$this __ ${it.responseCode}")
Expand All @@ -29,8 +27,8 @@ fun String.readBytesFromNet() =
?.readBytes()
?: byteArrayOf()

fun String.readFromNet() =
fun String.readFromNet(resumeUrl: String = ""): String =
runCatching { String(this.readBytesFromNet()) }.getOrElse {
println("read err ${it.message}")
""
println("read err ${it.stacktrace()} ")
if (resumeUrl.isEmpty()) "" else resumeUrl.readFromNet()
}
2 changes: 1 addition & 1 deletion src/main/kotlin/me/leon/view/AboutView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AboutView : View("关于") {

private fun checkUpdate(isAuto: Boolean = true) {
if (!isAuto) return
runAsync { CHECK_UPDATE_URL.readFromNet() } ui
runAsync { CHECK_UPDATE_URL.readFromNet(CHECK_UPDATE_URL2) } ui
{
latestVersion.text =
if (it.isEmpty()) "未知错误"
Expand Down

0 comments on commit d071ae2

Please sign in to comment.