app: address SetTextI18n lint

This commit is contained in:
Harsh Shandilya 2022-04-24 16:40:55 +05:30
parent 5bad2a7256
commit 599abd37e8
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
3 changed files with 6 additions and 12 deletions

View file

@ -1,15 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.1.3" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.3)" variant="all" version="7.1.3">
<issue
id="SetTextI18n"
message="Do not concatenate text displayed with `setText`. Use resource string with placeholders."
errorLine1=" warningAppName.text = &quot;“${packageManager.getApplicationLabel(appInfo)}”&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillPublisherChangedActivity.kt"
line="110"
column="31"/>
</issue>
</issues>

View file

@ -111,7 +111,11 @@ class AutofillPublisherChangedActivity : AppCompatActivity() {
warningAppInstallDate.text =
getString(R.string.oreo_autofill_warning_publisher_install_time, installTime)
val appInfo = packageManager.getApplicationInfo(appPackage, PackageManager.GET_META_DATA)
warningAppName.text = "${packageManager.getApplicationLabel(appInfo)}"
warningAppName.text =
getString(
R.string.oreo_autofill_warning_publisher_app_name,
packageManager.getApplicationLabel(appInfo)
)
val currentHash = computeCertificatesHash(this@AutofillPublisherChangedActivity, appPackage)
warningAppAdvancedInfo.text =

View file

@ -211,6 +211,7 @@
<string name="oreo_autofill_warning_publisher_header">This app\'s publisher has changed since you first associated a Password Store entry with it:</string>
<string name="oreo_autofill_warning_publisher_footer"><b>The currently installed app may be trying to steal your credentials by pretending to be a trusted app.</b>\n\nTry to uninstall and reinstall the app from a trusted source, such as the Play Store, Amazon Appstore, F-Droid, or your phone manufacturer\'s store.</string>
<string name="oreo_autofill_warning_publisher_install_time">Installed: %1$s</string>
<string name="oreo_autofill_warning_publisher_app_name" translatable="false">“%1$s“</string>
<string name="oreo_autofill_warning_publisher_advanced_info_template" translatable="false">Package:\n%1$s\n\nHash:\n%2$s</string>
<string name="oreo_autofill_warning_publisher_advanced_info_button">Advanced information</string>
<string name="oreo_autofill_warning_publisher_changed_disable_autofill_button">Keep Autofill disabled</string>