-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
termux-app is not booted and not properly working in background on Android 10 (on Xiaomi Redmi 7A) #3870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rpla14024
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
| <service | ||
| android:name=".app.TermuxService" | ||
| android:exported="false" /> | ||
| android:exported="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling export of a service, activity, receiver, provider allows other apps to call them without any permission. This will allow any random app to run commands in termux without user permission, and even with root if termux has root permissions, i.e you are creating a privilege escalation vulnerability.
| android:name=".app.TermuxService" | ||
| android:exported="false" /> | ||
| android:exported="true" | ||
| android:enabled="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Services are enabled by default.
https://developer.android.com/guide/topics/manifest/service-element#enabled
| public void onCreate(Bundle savedInstanceState) { | ||
| Logger.logDebug(LOG_TAG, "onCreate"); | ||
|
|
||
| // For details see: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TermuxService requests the permission if its required to start foreground terminal session from background. Permissions must not be requested unless needed.
| // For android >= 10, apps require Display over other apps permission to start foreground activities |
| FileReceiverActivity.updateFileReceiverActivityComponentsState(this); | ||
|
|
||
| try { | ||
| Intent serviceIntent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one issue that has already been solved locally and fix will be available in next version.
|
There were various issues with why termux-boot did not work properly and it will not be used from next termux release as boot logic has been rewritten into termux-app itself. |
For details see:
https://stackoverflow.com/a/19856267/1455694
https://stackoverflow.com/a/63250729/1455694
https://www.reddit.com/r/tasker/comments/d7whyj/android_10_and_auto_starting_apps/
https://stackoverflow.com/q/64642362/1455694
Not sure about real need for:
android:enabled="true"
android:exported="true"
in app/src/main/AndroidManifest.xml
Related pull request for termux-boot:
termux-boot is not working on Xiaomi Redmi 7A on Android 10
termux/termux-boot#195