Skip to content

Commit e423866

Browse files
Merge pull request #2 from billybox1926-jpg/workbench-app-issue-factory
feat: sync workbench fixes and upstream cherry-picks
2 parents b7c9bce + dcda2e3 commit e423866

34 files changed

Lines changed: 1262 additions & 339 deletions

.github/workflows/attach_debug_apks_to_release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
with:
2222
ref: ${{ env.GITHUB_REF }}
2323

24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: temurin
28+
java-version: '17'
29+
2430
- name: Build and attach APKs to release
2531
shell: bash {0}
2632
env:
@@ -45,8 +51,8 @@ jobs:
4551
APK_BASENAME_PREFIX="termux-app_$APK_VERSION_TAG"
4652
4753
echo "Building APKs for 'APK_VERSION_TAG' release"
48-
export TERMUX_APK_VERSION_TAG="$APK_VERSION_TAG" # Used by app/build.gradle
49-
export TERMUX_PACKAGE_VARIANT="${{ env.PACKAGE_VARIANT }}" # Used by app/build.gradle
54+
export TERMUX_APK_VERSION_TAG="$APK_VERSION_TAG"
55+
export TERMUX_PACKAGE_VARIANT="${{ env.PACKAGE_VARIANT }}"
5056
if ! ./gradlew assembleDebug; then
5157
exit_on_error "Build failed for '$APK_VERSION_TAG' release."
5258
fi

.github/workflows/debug_build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Build
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
78
- 'github-releases/**'
9+
- workbench-app-issue-factory
810
pull_request:
911
branches:
1012
- master
@@ -24,7 +26,7 @@ jobs:
2426
- name: Setup java 17
2527
uses: actions/setup-java@v5
2628
with:
27-
distribution: 'temurin'
29+
distribution: temurin
2830
java-version: '17'
2931

3032
- name: Build APKs

.github/workflows/dependency-submission.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Java
1818
uses: actions/setup-java@v5
1919
with:
20-
distribution: 'temurin'
21-
java-version: 17
20+
distribution: temurin
21+
java-version: '17'
2222
- name: Generate and submit dependency graph
2323
uses: gradle/actions/dependency-submission@v5

.github/workflows/run_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup java 17
2020
uses: actions/setup-java@v5
2121
with:
22-
distribution: 'temurin'
22+
distribution: temurin
2323
java-version: '17'
2424
- name: Execute tests
2525
run: |

README.md

Lines changed: 115 additions & 240 deletions
Large diffs are not rendered by default.

TERMUX_APP_FIRST_BATCH_PLAN.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# TERMUX_APP_FIRST_BATCH_PLAN
2+
3+
## Selected Issues
4+
5+
- Bucket A: #5092: [Bug]: Yet another potential ANR / main-thread blocking risk
6+
- Bucket A: #3478: [Bug]: Termux Auto Crash
7+
- Bucket A: #152: big crash bug
8+
- Bucket B: #5128: [Patch] | PR BLOCKED . posting patch as issue instead | idle timeout : idle drain safe guard . remove from power intensive apps
9+
- Bucket B: #4589: "extra-keys" of "termux.properties" malfunctioning
10+
- Bucket B: #3245: [Feature]: Need Double-width rendering of ambiguous characters
11+
- Bucket B: #787: Are javadocs for termux source online anywhere?
12+
13+
## Rationale
14+
15+
First batch is limited to buckets A and B only: high-confidence app-code crashes and low-risk static/code-health fixes.
16+
17+
Do not batch-fix these automatically. Pick one issue, inspect source, make the smallest patch, and use GitHub Actions as the gate.

TERMUX_APP_ISSUE_LEDGER.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# TERMUX_APP_ISSUE_LEDGER
2+
3+
## Summary
4+
- Total upstream open issues: 474
5+
- Fixed in this fork: 4 (so far in this session)
6+
- Remaining actionable: ~471
7+
8+
## Fixed Issues (this session)
9+
10+
### App repo (termux-app)
11+
- #5047 Missing PendingIntent.FLAG_IMMUTABLE causes crash on Android 12+ → Fixed (added FLAG_IMMUTABLE to 4 PendingIntent calls in 3 files) — commit e108bb62 — CI pending
12+
- #5144 Resource leak: Streams and Process not closed in AndroidUtils.getSystemProperties() → Fixed (finally block for cleanup) — commit a8390f92 — CI pending
13+
14+
### Package repo (termux-api-package)
15+
- #224 run_api_command leaks file descriptors → Fixed (close server sockets) — commit 961ca8c — CI green
16+
- #200 termux-api command should detect if Termux:API plugin is not installed → Fixed (is_termux_api_installed check) — commit 931a7ba — CI green
17+
18+
## Bucket Counts
19+
- Bucket A: 3 (quick wins — crash/ANR bugs)
20+
- Bucket B: 4 (patches/features)
21+
- Bucket C: 235 (mostly device-specific/vague)
22+
- Bucket D: 6 (features)
23+
- Bucket E: 31 (environment/install issues)
24+
- Bucket F: 13 (medium features)
25+
- Bucket G: 182 (feature requests/enhancements)
26+
27+
## Next Targets (Bucket A - Quick Wins)
28+
- #3478: [Bug]: Termux Auto Crash (vague, needs investigation)
29+
- #152: big crash bug (old, CyanogenMod era)
30+
31+
## Recently Fixed (by phone Hermes, confirmed in code)
32+
- #5092: ANR / main-thread blocking in FileReceiverActivity → Fixed (background thread) — commits 631bb060, 3c4830bb, d88e6b78

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ android {
7979

8080
signingConfigs {
8181
debug {
82-
storeFile file('testkey_untrusted.jks')
83-
keyAlias 'alias'
84-
storePassword 'xrj45yWGLbsO7W0v'
85-
keyPassword 'xrj45yWGLbsO7W0v'
82+
storeFile file('termux-debug-shared.jks')
83+
keyAlias 'termuxdebug'
84+
storePassword 'termuxdebug'
85+
keyPassword 'termuxdebug'
8686
}
8787
}
8888

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
android:label="@string/application_name"
4646
android:requestLegacyExternalStorage="true"
4747
android:roundIcon="@mipmap/ic_launcher_round"
48-
android:supportsRtl="false"
48+
android:supportsRtl="true"
4949
android:theme="@style/Theme.TermuxApp.DayNight.DarkActionBar"
5050
tools:targetApi="m">
5151

@@ -57,6 +57,7 @@
5757
android:launchMode="singleTask"
5858
android:resizeableActivity="true"
5959
android:theme="@style/Theme.TermuxActivity.DayNight.NoActionBar"
60+
android:excludeFromRecents="true"
6061
tools:targetApi="n">
6162
<intent-filter>
6263
<action android:name="android.intent.action.MAIN" />

app/src/main/java/com/termux/app/TermuxActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public final class TermuxActivity extends AppCompatActivity implements ServiceCo
152152
* If between onResume() and onStop(). Note that only one session is in the foreground of the terminal view at the
153153
* time, so if the session causing a change is not in the foreground it should probably be treated as background.
154154
*/
155-
private boolean mIsVisible;
155+
private volatile boolean mIsVisible;
156156

157157
/**
158158
* If onResume() was called after onCreate().
@@ -856,7 +856,9 @@ public boolean isTerminalToolbarTextInputViewSelected() {
856856

857857

858858
public void termuxSessionListNotifyUpdated() {
859-
mTermuxSessionListViewController.notifyDataSetChanged();
859+
// Ensure adapter notification always runs on the UI thread to prevent
860+
// IllegalStateException from ListView when modified from background. (#5027)
861+
runOnUiThread(() -> mTermuxSessionListViewController.notifyDataSetChanged());
860862
}
861863

862864
public boolean isVisible() {

0 commit comments

Comments
 (0)