termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
36.79k stars 3.86k forks source link

[Bug]: Termux crashed. #3070

Open cyrxdzj opened 2 years ago

cyrxdzj commented 2 years ago

Problem description

I opened it and it crashed immediately. It used to run normally for a month, but recently it crashed. I tried to uninstall it and install it again. But it still crashed. Screenshot_20221101-194240

Steps to reproduce the behavior.

No steps. Open it only.

What is the expected behavior?

No response

System information

cyrxdzj commented 2 years ago

I just tried to uninstall the termux: api, and then it magically worked.

cyrxdzj commented 2 years ago

Crash Details

Crash Thread: Thread[main,5,main] Crash Timestamp: 2022-11-01 11:42:34.658 UTC

Crash Message:

Unable to start activity ComponentInfo{com.termux/com.termux.app.TermuxActivity}: java.lang.SecurityException: getPermissionFlags requires android.permission.GRANT_RUNTIME_PERMISSIONS or android.permission.REVOKE_RUNTIME_PERMISSIONS

Stacktrace

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.termux/com.termux.app.TermuxActivity}: java.lang.SecurityException: getPermissionFlags requires android.permission.GRANT_RUNTIME_PERMISSIONS or android.permission.REVOKE_RUNTIME_PERMISSIONS
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2944)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3079)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1836)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6702)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
Caused by: java.lang.SecurityException: getPermissionFlags requires android.permission.GRANT_RUNTIME_PERMISSIONS or android.permission.REVOKE_RUNTIME_PERMISSIONS
        at android.os.Parcel.createException(Parcel.java:1950)
        at android.os.Parcel.readException(Parcel.java:1918)
        at android.os.Parcel.readException(Parcel.java:1868)
        at android.app.IActivityManager$Stub$Proxy.bindService(IActivityManager.java:4337)
        at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1673)
        at android.app.ContextImpl.bindService(ContextImpl.java:1613)
        at android.content.ContextWrapper.bindService(ContextWrapper.java:698)
        at com.termux.app.TermuxActivity.onCreate(TermuxActivity.java:246)
        at android.app.Activity.performCreate(Activity.java:7136)
        at android.app.Activity.performCreate(Activity.java:7127)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2924)
        ... 11 more

Termux App Info

APP_NAME: Termux PACKAGE_NAME: com.termux VERSION_NAME: 0.118.0 VERSION_CODE: 118 TARGET_SDK: 28 IS_DEBUGGABLE_BUILD: false APK_RELEASE: F-Droid SIGNING_CERTIFICATE_SHA256_DIGEST: 228FB2CFE90831C1499EC3CCAF61E96E8E1CE70766B9474672CE427334D41C42

Device Info

Software

OS_VERSION: 4.4.146 SDK_INT: 28 RELEASE: 9 ID: PPR1.180610.011 DISPLAY: LEKE-HW-S3.23 INCREMENTAL: mp1V8 SECURITY_PATCH: 2019-09-05 IS_DEBUGGABLE: 0 IS_TREBLE_ENABLED: true TYPE: user TAGS: release-keys

Hardware

MANUFACTURER: alps BRAND: alps MODEL: Leke Pad-L06 PRODUCT: full_tb8788p1_64_bsp BOARD: tb8788p1_64_bsp HARDWARE: mt8788 DEVICE: tb8788p1_64_bsp SUPPORTED_ABIS: arm64-v8a, armeabi-v7a, armeabi

2096779623 commented 2 years ago

We support Android 5 at least, and do not support Android 4.4 to install termux.

agnostic-apollo commented 2 years ago

SDK_INT: 28 RELEASE: 9

It's android 9.

Installing termux plugins sharing sharedUserId with termux apps often has bugs reported due to android os issues, not termux itself. Will need to look into it.

2096779623 commented 2 years ago

It's android 9.

Installing termux plugins sharing sharedUserId with termux apps often has bugs reported due to android os issues, not termux itself. Will need to look into it.

Sorry for it, this is an Android tablet for education in china, the system ROM may be a lot different than other Android 9 systems,although it has magisk.

agnostic-apollo commented 2 years ago

No worries. Yeah, modification from aosp could be an issue. The stacktrace doesn't show the other side of the binder transaction so don't know where it actually got triggered.

Moreover, the GRANT_RUNTIME_PERMISSIONS is meant to be granted to system apps, not for third party ones, so some internal component is likely failing and there may be nothing termux could do to prevent it.

https://cs.android.com/android/platform/superproject/+/android-9.0.0_r60:frameworks/base/core/res/AndroidManifest.xml;l=3099

https://cs.android.com/android/platform/superproject/+/android-9.0.0_r61:frameworks/base/services/core/java/com/android/server/pm/permission/PermissionManagerService.java;l=1656