Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Lint passes: BOM escape, location permission note, translations fall back to English

Gathin236133866963c0
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f94eea454..1b2978e00 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -39,11 +39,11 @@ jobs:
with:
packages: platforms;android-34 build-tools;34.0.0
- uses: gradle/actions/setup-gradle@v4
- - name: Unit tests and release build
+ - name: Unit tests, lint and release build
working-directory: launcher
run: |
chmod +x gradlew
- ./gradlew --no-daemon testReleaseUnitTest assembleRelease
+ ./gradlew --no-daemon testReleaseUnitTest lintRelease assembleRelease
- name: The launcher stays small
run: |
size=$(stat -c %s launcher/app/build/outputs/apk/release/app-release.apk)
diff --git a/launcher/app/lint.xml b/launcher/app/lint.xml
new file mode 100644
index 000000000..0f27a98a2
--- /dev/null
+++ b/launcher/app/lint.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Lint for the launcher. CI runs lintRelease; keep it at zero errors. -->
+<lint>
+ <!-- A string missing from a values-* folder falls back to English by design: translations arrive
+ one language at a time from contributors, and a partial one is better than none. -->
+ <issue id="MissingTranslation" severity="informational" />
+</lint>
diff --git a/launcher/app/src/main/AndroidManifest.xml b/launcher/app/src/main/AndroidManifest.xml
index adeba7562..cf9e6f5dc 100644
--- a/launcher/app/src/main/AndroidManifest.xml
+++ b/launcher/app/src/main/AndroidManifest.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools">
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
@@ -8,8 +9,11 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
- <!-- Needed on Android 10 to read the Wi-Fi network name; granted over adb at install time. -->
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <!-- Needed since Android 10 to read the Wi-Fi network name for the network pill. Never requested at
+ runtime: build-and-install grants it with pm grant, so lint's Android 12 "ask for COARSE with
+ FINE" rule does not apply here. -->
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
+ tools:ignore="CoarseFineLocation" />
<!-- Android 11+ package visibility: lets the launcher list the TV apps it shows as tiles, and the
apps that declare a module card (docs/specs/card.md). -->
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/Config.java b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
index 66f2a988a..f346f6afd 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@ -204,7 +204,7 @@ final class Config {
int n = 0, r;
while (n < buf.length && (r = in.read(buf, n, buf.length - n)) > 0) n += r;
String text = new String(buf, 0, n, StandardCharsets.UTF_8);
- if (text.startsWith("")) text = text.substring(1); // Windows editors add a BOM
+ if (text.startsWith("\uFEFF")) text = text.substring(1); // Windows editors add a BOM
return new JSONObject(text);
} catch (Exception e) {
Log.w(TAG, "ignoring " + file + ": " + e.getMessage());