From ef115f1b969115171c8297d3771e8470030894e4 Mon Sep 17 00:00:00 2001
From: pppscn <35696959@qq.com>
Date: Fri, 16 Feb 2024 22:54:28 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=87=AA=E5=AE=9A?=
=?UTF-8?q?=E4=B9=89=E6=A8=A1=E6=9D=BF=E5=A2=9E=E5=8A=A0`{{=E5=AE=9A?=
=?UTF-8?q?=E4=BD=8D=E4=BF=A1=E6=81=AF=5F=E7=BB=8F=E5=BA=A6}}`/`{{?=
=?UTF-8?q?=E5=AE=9A=E4=BD=8D=E4=BF=A1=E6=81=AF=5F=E7=BA=AC=E5=BA=A6}}`/`{?=
=?UTF-8?q?{=E5=AE=9A=E4=BD=8D=E4=BF=A1=E6=81=AF=5F=E5=9C=B0=E5=9D=80}}`?=
=?UTF-8?q?=E4=B8=89=E4=B8=AA=E6=A0=87=E7=AD=BE=20#400?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/idormy/sms/forwarder/entity/MsgInfo.kt | 14 ++++++++++----
app/src/main/res/values-en/strings.xml | 3 +++
app/src/main/res/values-zh-rCN/strings.xml | 3 +++
app/src/main/res/values-zh-rTW/strings.xml | 3 +++
app/src/main/res/values/strings.xml | 3 +++
5 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt b/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt
index c7f09f19..c089ce67 100644
--- a/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt
+++ b/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt
@@ -221,13 +221,19 @@ data class MsgInfo(
//替换 {{定位信息}} 标签
private fun replaceLocationTag(content: String, needJson: Boolean = false): String {
if (TextUtils.isEmpty(content)) return content
- if (content.indexOf(getString(R.string.tag_location)) == -1) return content
+ //if (content.indexOf(getString(R.string.tag_location)) == -1) return content
- var location = HttpServerUtils.apiLocationCache.toString()
+ val location = HttpServerUtils.apiLocationCache
+ var locationStr = location.toString()
+ var address = location.address
if (needJson) {
- location = jsonInnerStr(location)
+ locationStr = jsonInnerStr(locationStr)
+ address = jsonInnerStr(address)
}
- return content.replace(getString(R.string.tag_location), location)
+ return content.replace(getString(R.string.tag_location), locationStr)
+ .replace(getString(R.string.tag_location_longitude), location.longitude.toString())
+ .replace(getString(R.string.tag_location_latitude), location.latitude.toString())
+ .replace(getString(R.string.tag_location_address), address)
}
private fun jsonInnerStr(string: String?): String {
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index b0a2f79b..e4ab68b8 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -622,6 +622,9 @@
{{SCHEME}}
{{CALL_TYPE}}
{{LOCATION}}
+ {{LOCATION_LONGITUDE}}
+ {{LOCATION_LATITUDE}}
+ {{LOCATION_ADDRESS}}
{{BATTERY_PCT}}
{{BATTERY_STATUS}}
{{BATTERY_PLUGGED}}
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index b0b2493f..ac035f04 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -623,6 +623,9 @@
{{通知Scheme}}
{{通话类型}}
{{定位信息}}
+ {{定位信息_经度}}
+ {{定位信息_纬度}}
+ {{定位信息_地址}}
{{电池电量}}
{{电池状态}}
{{充电方式}}
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 18c75224..6e082363 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -623,6 +623,9 @@
{{通知Scheme}}
{{通話類型}}
{{定位信息}}
+ {{定位信息_經度}}
+ {{定位信息_緯度}}
+ {{定位信息_地址}}
{{電池電量}}
{{電池狀態}}
{{充電方式}}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 75ef00fc..71e87a03 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -623,6 +623,9 @@
{{通知Scheme}}
{{通话类型}}
{{定位信息}}
+ {{定位信息_经度}}
+ {{定位信息_纬度}}
+ {{定位信息_地址}}
{{电池电量}}
{{电池状态}}
{{充电方式}}