Skip to content

Commit 4c59748

Browse files
committed
优化从文本中提取版本号的代码逻辑
1 parent 778ee9f commit 4c59748

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/main/java/com/hjq/device/compat/DeviceOs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ private static String getOneUiVersionNameByVersionCode(int oneUiVersionCode) {
969969
}
970970

971971
/**
972-
* 从文本提取字符串中的版本号(只保留数字和点号)
972+
* 从文本提取版本号(只保留数字和点号)
973973
*/
974974
@NonNull
975975
private static String extractVersionNameByText(@Nullable String text) {
@@ -999,7 +999,7 @@ private static String extractVersionNameByText(@Nullable String text) {
999999
if (matcher.find() && matcher.groupCount() > 0) {
10001000
String result = matcher.group(1);
10011001
if (result != null) {
1002-
return result;
1002+
return result + ".0";
10031003
}
10041004
}
10051005
return "";

0 commit comments

Comments
 (0)