From 4c7622e9957de60ab02d5b0b80b2dd4d541e80ae Mon Sep 17 00:00:00 2001 From: Icarus Xu Date: Tue, 14 Nov 2023 09:20:54 +0800 Subject: [PATCH 1/2] Update CodeExtractor.kt add keyword sent by alipay --- .../main/java/io/github/jd1378/otphelper/utils/CodeExtractor.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/io/github/jd1378/otphelper/utils/CodeExtractor.kt b/app/src/main/java/io/github/jd1378/otphelper/utils/CodeExtractor.kt index 21234275..9ea2fbd1 100644 --- a/app/src/main/java/io/github/jd1378/otphelper/utils/CodeExtractor.kt +++ b/app/src/main/java/io/github/jd1378/otphelper/utils/CodeExtractor.kt @@ -14,6 +14,7 @@ class CodeExtractor { "c[oó]digo", "clave", "验证码", + "校验码", "識別碼", "認證", "驗證", From fa24d5401a9679d22d561b59e2c09c531c2f5a59 Mon Sep 17 00:00:00 2001 From: Icarus Xu Date: Mon, 20 Nov 2023 21:26:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?add=20unit=20test=20for=20alipay=20"?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E7=A0=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Icarus Xu --- .../io/github/jd1378/otphelper/CodeDetectionUnitTest.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/test/java/io/github/jd1378/otphelper/CodeDetectionUnitTest.kt b/app/src/test/java/io/github/jd1378/otphelper/CodeDetectionUnitTest.kt index 2d076738..18eed15b 100644 --- a/app/src/test/java/io/github/jd1378/otphelper/CodeDetectionUnitTest.kt +++ b/app/src/test/java/io/github/jd1378/otphelper/CodeDetectionUnitTest.kt @@ -494,4 +494,11 @@ code: 123456 assertEquals(false, CodeIgnore.shouldIgnore(msg)) assertEquals("123456", CodeExtractor.getCode(msg)) } + + @Test + fun chineseAlipayCode() { + val msg = "【支付宝】校验码1234,付款金额169.00,你正在使用支付宝,需要进行校验,请勿向任何人提供您收到的短信校验码" + assertEquals(false, CodeIgnore.shouldIgnore(msg)) + assertEquals("1234", CodeExtractor.getCode(msg)) + } }