You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local localeKeys=("application-label-zh-CN""application-label-zh""application-label-zh-Hans""application-label-zh-Hant""application-label-zh-rCN""application-label""application-label-en")
96
+
forkeyin"${localeKeys[@]}";do
97
+
local label
98
+
label=$(aapt dump badging "${tempApkFilePath}"< /dev/null 2>/dev/null | sed -n "s/.*${key}:'\\([^']*\\)'.*/\\1/p"| head -n 1)
99
+
if [[ -n"${label}" ]];then
100
+
appLabel="${label}"
101
+
break
102
+
fi
103
+
done
104
+
fi
105
+
if [[ -z"${appLabel}" ]];then
106
+
appLabel="${packageName}"
107
+
fi
108
+
local safeLabel
109
+
safeLabel=$(echo "${appLabel}"| tr -d '\r'| sed 's/[\\/:*?"<>|]/_/g'| sed 's/[[:space:]]\{1,\}/ /g'| sed 's/^ *//;s/ *$//')
baseLocalApk=$(ls -1 "${splitsDirPath}"| grep -E '^base-master\.apk$|^base\.apk$'| head -n 1)
156
+
local appLabel=""
157
+
if [[ -n"${baseLocalApk}" ]];then
83
158
if existCommand "aapt";then
84
159
local localeKeys=("application-label-zh-CN""application-label-zh""application-label-zh-Hans""application-label-zh-Hant""application-label-zh-rCN""application-label""application-label-en")
85
160
forkeyin"${localeKeys[@]}";do
86
161
local label
87
-
label=$(aapt dump badging "${tempApkFilePath}"< /dev/null 2>/dev/null | sed -n "s/.*${key}:'\\([^']*\\)'.*/\\1/p"| head -n 1)
162
+
label=$(aapt dump badging "${splitsDirPath}$(getFileSeparator)${baseLocalApk}"< /dev/null 2>/dev/null | sed -n "s/.*${key}:'\\([^']*\\)'.*/\\1/p"| head -n 1)
88
163
if [[ -n"${label}" ]];then
89
164
appLabel="${label}"
90
165
break
91
166
fi
92
167
done
93
168
fi
94
-
if [[ -z"${appLabel}" ]];then
95
-
appLabel="${packageName}"
96
-
fi
97
-
local safeLabel
98
-
safeLabel=$(echo "${appLabel}"| tr -d '\r'| sed 's/[\\/:*?"<>|]/_/g'| sed 's/[[:space:]]\{1,\}/ /g'| sed 's/^ *//;s/ *$//')
0 commit comments