2dust / 2dust/v2rayNG

App shortcut icons appear corrupted / mismatched with labels on Android 17 (black background, wrong scaling)

オープン
#6,173 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Kotlin
スター
62.5k
フォーク
8.1k
平均マージ
2日 17時間
マージ済み PR(30日)
43

説明

### Fault point

The 4 static app shortcuts defined in `res/xml/shortcuts.xml` (both `main` and `fdroid` variants) render incorrectly on Android 17: the icons appear as black blocks / badly zoomed crops, looking as if the icon does not match its label.

Shortcuts affected:
- `shortcuts_switch` → `@drawable/ic_qu_switch_24dp`
- `shortcuts_scan` → `@drawable/ic_qu_scan_24dp`
- `shortcuts_start` → `@drawable/ic_qu_start_24dp`
- `shortcuts_stop` → `@drawable/ic_qu_stop_24dp`

They are only shown on Android 17; Android 16 and earlier render them correctly.

### Root cause (platform-level, not a binding bug)

The icon↔label binding is correct — git history shows it was never swapped (`fcc478ff` and later). The real cause is two-fold:

1. **Icon resource structure**: All four `ic_qu_*` drawables are plain non-adaptive vectors with a **white circle baseline + transparent corners** (a circle `pathData` on a 1024×1024 viewport leaves the four corners transparent) plus a black glyph on top.
2. **Android 17 rendering change**: Android 17 now renders transparent areas of shortcut icons as **black** and applies broken zoom/cropping to newly placed shortcuts. The transparent corners therefore turn into black blocks, and the glyph gets scaled incorrectly.

This exact behavior is reported on other projects too:
- Waboodoo/HTTP-Shortcuts#568 (Pixel 9 Pro / Android 17: “Icon Cropping & Background on Home”)
- Waboodoo/HTTP-Shortcuts#569 (“Android 17 Mangles Shortcut Icons”: transparent areas now render black instead of white)

### Analysis

- The shortcut icon bitmap cache (`/data/system/package_shortcut_*`) plus launcher caches can also keep stale icons after an OS/app update, worsening the “old icon, new label” appearance.
- The `ic_qu_*` drawables have no `drawable-night` variant and are not `adaptive-icon`, leaving no safe fallback for the Android 17 rendering path.

### Suggested fix

**User-side (immediate relief):**
1. Delete the app shortcuts and re-add them by long-pressing the launcher icon (forces re-render).
2. Clear the launcher app cache and/or toggle the themed-icon setting to refresh.

**Code-side (proper fix):**
1. Remove the transparent corners by filling the full viewport with an opaque background (e.g. extend the white circle path to a full rect), so there is nothing transparent for Android 17 to turn black.
2. Optionally migrate the shortcut icons to `adaptive-icon` (foreground/background layers) and to semantically clear glyphs (power symbol for switch, `qr_code`, `play_arrow`, `stop`), and add matching `drawable-night` resources.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。