diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f82cb3d225..46136dd59d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -4,7 +4,7 @@ import java.time.LocalDate group = "me.leon.tools" -version = "1.15.1.beta" +version = "1.15.2.beta" plugins { application diff --git a/app/src/main/kotlin/me/leon/Constants.kt b/app/src/main/kotlin/me/leon/Constants.kt index b5350a206c..fc144ea0d2 100644 --- a/app/src/main/kotlin/me/leon/Constants.kt +++ b/app/src/main/kotlin/me/leon/Constants.kt @@ -13,7 +13,7 @@ val REG_NUMBER = "\\d+".toRegex() val REG_CRACK_HEADER = "\\d+ [\\w)]+(-->\\d+ )?".toRegex() val build: String - get() = "2022/12/06" + get() = "2022/12/25" val appVersion: String - get() = "1.15.1.beta" + get() = "1.15.2.beta" diff --git a/app/src/main/kotlin/me/leon/ToolsApp.kt b/app/src/main/kotlin/me/leon/ToolsApp.kt index 7c2f14a3b2..51b9b50fab 100644 --- a/app/src/main/kotlin/me/leon/ToolsApp.kt +++ b/app/src/main/kotlin/me/leon/ToolsApp.kt @@ -1,12 +1,9 @@ package me.leon import java.io.File -import java.security.SecureRandom -import java.security.cert.X509Certificate import java.util.Locale import java.util.Properties import javafx.scene.image.Image -import javax.net.ssl.* import me.leon.ext.fx.Prefs import me.leon.view.Home import tornadofx.* @@ -17,12 +14,11 @@ class ToolsApp : App(Home::class, Styles::class) { } companion object { - val properties: Properties = Properties() + private val properties: Properties = Properties() init { // for text i18n FX.locale = if (Prefs.language == "zh") Locale.CHINESE else Locale.ENGLISH initConfig() - fixSsl() } val isEnableClassical: Boolean get() = properties["isEnableClassical"].toString().toBoolean() @@ -62,34 +58,5 @@ class ToolsApp : App(Home::class, Styles::class) { javaClass.getResourceAsStream("/top1000.txt")?.use { it.copyTo(file.outputStream()) } } - - private fun fixSsl() { - val trustManagers = - arrayOf( - object : X509TrustManager { - override fun checkClientTrusted( - chain: Array?, - authType: String? - ) { - // nop - } - - override fun checkServerTrusted( - chain: Array?, - authType: String? - ) { - // nop - } - - override fun getAcceptedIssuers(): Array? { - return null - } - } - ) - val sc = SSLContext.getInstance("TLSv1.2") - sc.init(null, trustManagers, SecureRandom()) - HttpsURLConnection.setDefaultSSLSocketFactory(sc.socketFactory) - HttpsURLConnection.setDefaultHostnameVerifier { _, _ -> true } - } } } diff --git a/app/src/test/kotlin/me/leon/Ocr.kt b/app/src/test/kotlin/me/leon/Ocr.kt index 8755f93cae..95251b3aa0 100644 --- a/app/src/test/kotlin/me/leon/Ocr.kt +++ b/app/src/test/kotlin/me/leon/Ocr.kt @@ -1,17 +1,17 @@ package me.leon import java.io.File -import kotlin.test.* -import me.leon.ext.ocr.BaiduOcr -import me.leon.ext.toBase64 -import org.junit.Test import java.security.SecureRandom import java.security.cert.X509Certificate import javax.net.ssl.HttpsURLConnection import javax.net.ssl.SSLContext import javax.net.ssl.X509TrustManager +import kotlin.test.* +import me.leon.ext.ocr.BaiduOcr +import me.leon.ext.toBase64 +import org.junit.Test -//@Ignore +@Ignore class Ocr { @Test @@ -19,7 +19,6 @@ class Ocr { fixSsl() val data = "https://wx1.sinaimg.cn/mw2000/7736d59fly1gzpm3yc7m6j20j80ip755.jpg" assertTrue(BaiduOcr.ocr(data).contains("你们别看我")) - } private fun fixSsl() { val trustManagers = diff --git a/plugin-apipost/src/test/kotlin/me/leon/plugin/HttpTest.kt b/plugin-apipost/src/test/kotlin/me/leon/plugin/HttpTest.kt index 803a7219c9..cae20b6842 100644 --- a/plugin-apipost/src/test/kotlin/me/leon/plugin/HttpTest.kt +++ b/plugin-apipost/src/test/kotlin/me/leon/plugin/HttpTest.kt @@ -4,7 +4,6 @@ import java.io.File import java.util.Base64 import me.leon.toolsfx.plugin.net.* import org.junit.Test -import java.security.Security class HttpTest {