Skip to content

Rebase into upstream#121

Open
RankoR wants to merge 50 commits into
GrapheneOS:mainfrom
RankoR-GOS:gos-16.2
Open

Rebase into upstream#121
RankoR wants to merge 50 commits into
GrapheneOS:mainfrom
RankoR-GOS:gos-16.2

Conversation

@RankoR

@RankoR RankoR commented Jul 19, 2026

Copy link
Copy Markdown

Fixed version of #115

TODOs from the original PR are also resolved now.

simplexatg and others added 30 commits October 17, 2024 12:12
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
# Conflicts:
#	build.sh
Signed-off-by: Patryk Miś <foss@patrykmis.com>

# Conflicts:
#	version.gradle
Signed-off-by: Patryk Miś <foss@patrykmis.com>

# Conflicts:
#	talkback/src/main/res/values/strings.xml
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>

# Conflicts:
#	build.gradle
#	shared.gradle
#	uiunderstanding/build.gradle
Signed-off-by: Patryk Miś <foss@patrykmis.com>
# Conflicts:
#	braille/brailleime/src/phone/res/values-pl/strings.xml
#	talkback/src/main/res/values-pl/strings.xml
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>

# Conflicts:
#	talkback/src/main/res/values/donottranslate.xml
…no network permission

Signed-off-by: Patryk Miś <foss@patrykmis.com>

# Conflicts:
#	talkback/src/main/java/com/google/android/accessibility/talkback/preference/TalkBackPreferenceFilter.java
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>

# Conflicts:
#	braille/brailleime/src/phone/java/com/google/android/accessibility/brailleime/input/BrailleInputPlaneResult.java
These are only used for version output that's not actually used.
- Fix status bar being white
Signed-off-by: Patryk Miś <foss@patrykmis.com>
PatrykMis and others added 20 commits May 18, 2026 00:52
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
Signed-off-by: Patryk Miś <foss@patrykmis.com>
…egration

Signed-off-by: Patryk Miś <foss@patrykmis.com>
PR #115 rebases the GrapheneOS TalkBack patches onto upstream v16.2.
gos-16.2 supersedes the v14.1-based main on all product code, liblouis
(3.35.0 > 3.31.0), SDK/NDK, and app version (16.2 > 14.1). This merge
records main as an ancestor so the PR is conflict-free while keeping the
tree exactly as gos-16.2. Genuinely-newer toolchain bits from main
(Gradle 9.6.1, actions/checkout v7, dependabot limit) are re-applied in
follow-up commits.
Pulled forward from GrapheneOS/talkback main (e6cd617). gos-16.2's CI
was on actions/checkout@v6.
Pulled forward from GrapheneOS/talkback main (e77be41).
AGP 8.13.2 relies on a Gradle internal API removed in Gradle 9.6.0, so
moving to the latest stable Gradle (9.6.1) requires AGP 9.x. Bump AGP to
9.3.0 (latest stable; min Gradle 9.5.0, JDK 17, build-tools 36 — all met)
and Gradle to 9.6.1. This addresses the PR's 'AGP v9.2+' TODO.

Adopt AGP 9's built-in Kotlin: drop 'apply plugin: kotlin-android' from
the 5 Kotlin modules; AGP now drives Kotlin compilation. The
kotlin-gradle-plugin classpath is kept, pinned to Kotlin 2.3.21, so the
Compose compiler plugin stays version-locked to the tested Kotlin rather
than following AGP's bundled version.

Two AGP 9 breaking-change fixes:
- Enable buildFeatures.resValues (now default-off) for the resValue in
  shared.gradle.
- Apply the Compose compiler plugin centrally in shared.gradle: built-in
  Kotlin makes every module Kotlin-enabled, so every module with compose
  enabled must apply the plugin (previously only the 5 Kotlin modules did).

Verified: ./gradlew assemblePhoneDebug succeeds and produces the APK.
Enables Gradle dependency verification (verify-metadata=true,
verify-signatures=false) with sha512 checksums for the full v16.2
dependency set (814 components, 2787 artifacts), generated with the
GrapheneOS app-docs init script:

  ./gradlew --no-daemon --no-configuration-cache \
    -I $APP_DOCS/scripts/gradle-dependency-verification-artifacts.init.gradle.kts \
    --write-verification-metadata sha512 \
    resolveDependencyVerificationArtifacts

Validated with the checkDependencyVerificationHashes task (strict mode).
Addresses the PR's 'Add Gradle Dependency Verification Metadata' TODO.
Metadata regenerated for the v16.2 toolchain rather than reusing main's
v14.1 metadata, which would not match this dependency set.
TalkBack crash-looped on every accessibility-service connect:
  java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
    at ...updatetasks.VersionUpdateTaskKt.convertToVersion(VersionUpdateTask.kt:73)
    at ...TalkBackUpdateManager.startMigration
    at ...TalkBackUpdateHelper.checkUpdate
    at ...TalkBackService.onServiceConnected

convertToVersion() indexed splitVersion[0..2], assuming a 3-part X.Y.Z
version, but GrapheneOS sets versionName "16.2" (2 parts, matching the
downstream convention, cf. main's "14.1"). splitVersion[2] threw
IndexOutOfBoundsException, which the catch (NumberFormatException only)
did not handle, so the service died on connect and never started.

Default any missing version component to 0 via getOrNull, so "16.2"
parses as Version(16, 2, 0). This crash path is new in v16.2 (the
updatetasks package does not exist on the v14.1-based main branch).

Verified on-device (Pixel 9, Android 17): with this fix TalkBack's
service connects, resumeInfrastructure() runs, and it begins speaking
(previously it crash-looped immediately).
The Wear product flavor is already gone (only the 'phone' flavor
remains), leaving these watch resources dead: layout-watch/,
values-watch/ and xml-watch/ (all have phone/base equivalents), plus the
unqualified values/watch_strings.xml and utils watch_attrs.xml /
watch_styles.xml (all verified unreferenced outside the wear files).
Mirrors upstream main's 8c96714 / 8f10e03 'Remove rest of Wear flavor
resources', which the v16.2 rebase had not re-applied.
The Play Store button is never usable on GrapheneOS: PackageManagerUtils
.hasGmsCorePackage() is hardwired to false, so the preference was already
force-removed at runtime. Physically remove the dead code — the
updatePlayStorePreference / supportsPlayStore / assignPlayStoreIntentToPreference
/ showTalkBackVersion methods, the TALKBACK_VERSION_PATTERN field and the
now-unused imports in AdvancedSettingFragment, plus the preference entry
in advanced_preferences.xml. Mirrors upstream main's 6df4a18 'Remove
Play Store button', which the v16.2 rebase had not re-applied. The
title/summary_pref_play_store string translations are left in place, as
main's commit also left them.
Mostly memory-safety fixes, according to the changelog: a heap buffer
overflow in back_passDoAction, NULL pointer dereferences and buffer
overflows in pattern compilation, a NULL deref in lou_readCharFromFile,
a memory leak in parseLanguageTag, missing length validation in
_lou_backTranslate, and an infinite loop in isEmphasizable.

Refreshes the vendored core sources and bumps config.h to 3.38.0, and
updates the 35 shipped translation tables that changed upstream. The
Norwegian and Swedish tables were restructured upstream to pull in new
include fragments, so five newly-required files are added:
no-no-cyrillic6dot.uti, sv-6common.uti, sv-6g1.uti, sv-6g2.uti and
sv-phon.uti. The public liblouis.h API is unchanged, so the JNI wrapper
and Android.mk need no changes.

Signed-off-by: Artem Smirnov <artem@smirnov.page>
Re-vendors the compiled brltty subset from the official 6.9.1 release,
bringing upstream memory/robustness fixes and driver updates. Google's
fork is nearly verbatim upstream, so this is largely a clean re-vendor
with these carried-forward adaptations:

- config.h: kept the Android-tuned configuration, bumped to 6.9.1 and
  renamed COMMANDS_DIRECTORY to HELPERS_DIRECTORY (renamed upstream).
- brl.auto.h: kept Google's hand-written Android driver table (unchanged
  11-driver set); the other generated headers come from the 6.9.1 build.
- Re-applied Google's HID-descriptor patches to gio.c, gio_hid.c,
  gio_internal.h and driver.h.
- Wrapper: deallocateQueue was renamed to destroyQueue upstream; updated
  the calls in libbrltty.c and usb_android.c.
- 6.9.1 split the command-line framework into new files, so cmdbase.c,
  cmdput.c, color.c and match.c (plus their headers) are added and
  compiled via Android.mk.
- Removed a stray committed duplicate, "brlapi.h (copy).in".

The HID braille driver (Google-only) is kept as-is. The disabled,
uncompiled drivers (EuroBraille, Virtual) are left untouched.

Builds and links for both ABIs; the packaged libbrlttywrap.so reports
BRLTTY-6.9.1.

Signed-off-by: Artem Smirnov <artem@smirnov.page>
Follow-up tidy-up to the 6.9.1 update; none of these files are compiled.

- Removed files that upstream deleted: the Virtual braille driver, the
  Headers/strfmth.h header (superseded upstream by strfmt_types.h) and
  Programs/brltty-lscmds.c.
- EuroBraille (a disabled driver kept for its "gets back" TODO) was left
  half-renamed by the bulk re-vendor; completed the 6.9.1 rename of
  eu_braille.c/eu_clio.c/eu_esysiris.c to braille.c/clio.c/esysiris.c so
  the directory matches upstream 6.9.1.

Native library still builds and links for both ABIs.

Signed-off-by: Artem Smirnov <artem@smirnov.page>
The app requests lt-8dot.utb (LibLouis.java) for Lithuanian 8-dot
computer braille, but the table was never shipped, so selecting that
mode failed to load. This is a pre-existing gap, unrelated to the
3.38.0 update. Added from the liblouis 3.38.0 release; it compiles
cleanly under the shipped engine and its include closure is already
satisfied. All 111 app-requested tables now resolve.

Signed-off-by: Artem Smirnov <artem@smirnov.page>
Ports the main-branch degoogling of OCR (15.1 commit 6ae6768) to
v16.2. TalkBack's text recognition used
com.google.android.gms:play-services-mlkit-text-recognition, which
fetches its model through Google Play Services and communicates with
GMS - undesirable on a no-GMS build.

- Removed the play-services-mlkit-text-recognition dependency.
- Deleted OcrController and OcrInfo (the ML Kit wrappers).
- Stubbed CharacterCaptionRequest so the OCR request performs no work.
- ImageCaptioner.supportsImageCaption() now returns false. That also
  hides the shared "Automatic descriptions" settings entry, which hosts
  icon detection and image description as well; those two keep their own
  support methods but are no longer reachable from that page. This
  matches the main branch, and on a no-GMS build none of the three can
  function anyway.
- Removed the now-inert com.google.mlkit.vision.DEPENDENCIES manifest
  metadata (the GMS model-download hint).
- Regenerated gradle/verification-metadata.xml (dropped the ML Kit
  components, 814 -> 787).

No com.google.mlkit classes remain in the APK.

Signed-off-by: Artem Smirnov <artem@smirnov.page>
Upstream liblouis removed et.ctb in 3.38.0 ("use et-g0.utb instead").
The app loads et-g0.utb (LibLouis.java), not et.ctb, and no shipped
table includes it, so it was dead weight carried over from the 3.35.0
tables. All 111 app-loaded tables still resolve without it.

Signed-off-by: Artem Smirnov <artem@smirnov.page>
@RankoR
RankoR marked this pull request as ready for review July 20, 2026 22:27
@RankoR
RankoR requested a review from inthewaves July 20, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants