-
Notifications
You must be signed in to change notification settings - Fork 570
Comparing changes
Open a pull request
base repository: termux/termux-api
base: v0.51.0
head repository: termux/termux-api
compare: v0.52.0
- 13 commits
- 9 files changed
- 1 contributor
Commits on Apr 13, 2025
-
Fixed(BatteryStatusAPI): Output double value instead of string for te…
…mperature field with value rounded up to 1 decimal place `String.format("%.1f", batteryTemperature)` was used in d5364ef to round up the value to 1 decimal place, which resulted in field being a string in json output and with a comma-as-decimal-separater depending on device locale, like `25,5` instead of `25.5`, so we stay with double now. Closes #763
Configuration menu - View commit details
-
Copy full SHA for 97b4100 - Browse repository at this point
Copy the full SHA 97b4100View commit details
Commits on May 22, 2025
-
Fixed: Manually add stack trace of caller function that called `Resul…
…tReturner.returnData()` to exception messages as exceptions thrown inside `Runnable` lambda thread will not include it by default For example, exceptions like following don't tell which API call failed and where. ``` Error in ResultReturner: java.io.IOException: Connection refused at android.net.LocalSocketImpl.connectLocal(Native Method) at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:259) at android.net.LocalSocket.connect(LocalSocket.java:162) at com.termux.api.util.ResultReturner.lambda$returnData$0(ResultReturner.java:244) at com.termux.api.util.ResultReturner$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) at java.lang.Thread.run(Thread.java:1119) ``` Now it will be something like this ``` Error in ResultReturner: java.io.IOException: Connection refused at android.net.LocalSocketImpl.connectLocal(Native Method) at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:259) at android.net.LocalSocket.connect(LocalSocket.java:162) at com.termux.api.util.ResultReturner.lambda$returnData$0(ResultReturner.java:244) at com.termux.api.util.ResultReturner$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) at java.lang.Thread.run(Thread.java:1119) Suppressed: java.lang.Exception: Called by: at com.termux.api.util.ResultReturner.returnData(ResultReturner.java:234) at com.termux.api.apis.BatteryStatusAPI.onReceive(BatteryStatusAPI.java:27) at com.termux.api.TermuxApiReceiver.doWork(TermuxApiReceiver.java:91) at com.termux.api.TermuxApiReceiver.onReceive(TermuxApiReceiver.java:65) at android.app.ActivityThread.handleReceiver(ActivityThread.java:5029) at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2577) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loopOnce(Looper.java:248) at android.os.Looper.loop(Looper.java:338) at android.app.ActivityThread.main(ActivityThread.java:9067) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) ```
Configuration menu - View commit details
-
Copy full SHA for 922f358 - Browse repository at this point
Copy the full SHA 922f358View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02b1c66 - Browse repository at this point
Copy the full SHA 02b1c66View commit details -
Fixed(NotificationAPI): Fix
termux-notification
actions not updatin……g or conflicting between notifications due to same request code being used for the `PendingIntent` of all actions and also specify `PendingIntent.FLAG_IMMUTABLE` to prevent any modification - https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability Closes #677, Closes #764
Configuration menu - View commit details
-
Copy full SHA for 7c1759a - Browse repository at this point
Copy the full SHA 7c1759aView commit details -
Fixed(NotificationAPI): Fix
termux-notification --icon
not working ……for release builds as icon drawables were being removed by resource shrinker possibly related to 6ef2618 Use standard Android API to get resource id for drawable icon instead of using reflection into drawable class. Additionally use `String.format()` so that resource shrinker does not remove icons used by `NotificationAPI` for release builds. Closes #483
Configuration menu - View commit details
-
Copy full SHA for 1639e73 - Browse repository at this point
Copy the full SHA 1639e73View commit details -
Fixed: Fix disabling obfuscation added in 6ef2618 caused due to wrong…
… proguard file being used. This caused Termux classes like `ReportInfo` to be obfuscated making stacktraces harder to read. ``` java.lang.RuntimeException: Unable to start activity ComponentInfo{com.termux/com.termux.shared.activities.ReportActivity}: android.os.BadParcelableException: Parcelable encountered ClassNotFoundException reading a Serializable object (name = I0.a) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3864) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4006) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:111) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2462) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:240) at android.os.Looper.loop(Looper.java:351) at android.app.ActivityThread.main(ActivityThread.java:8377) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013) Caused by: android.os.BadParcelableException: Parcelable encountered ClassNotFoundException reading a Serializable object (name = I0.a) at android.os.Parcel.readSerializableInternal(Parcel.java:5113) at android.os.Parcel.readValue(Parcel.java:4655) at android.os.Parcel.readValue(Parcel.java:4363) at android.os.Parcel.-$$Nest$mreadValue(Unknown Source:0) at android.os.Parcel$LazyValue.apply(Parcel.java:4461) at android.os.Parcel$LazyValue.apply(Parcel.java:4420) at android.os.BaseBundle.getValueAt(BaseBundle.java:394) at android.os.BaseBundle.getValue(BaseBundle.java:374) at android.os.BaseBundle.getValue(BaseBundle.java:357) at android.os.BaseBundle.getValue(BaseBundle.java:350) at android.os.BaseBundle.getSerializable(BaseBundle.java:1451) at android.os.Bundle.getSerializable(Bundle.java:1144) at com.termux.shared.activities.ReportActivity.updateUI(ReportActivity.java:136) at com.termux.shared.activities.ReportActivity.onCreate(ReportActivity.java:89) at android.app.Activity.performCreate(Activity.java:8397) at android.app.Activity.performCreate(Activity.java:8370) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1403) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3837) ... 12 more Caused by: java.lang.ClassNotFoundException: I0.a at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:536) at android.os.Parcel$2.resolveClass(Parcel.java:5090) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1733) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1624) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1902) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1442) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:430) at android.os.Parcel.readSerializableInternal(Parcel.java:5096) ... 29 more Caused by: java.lang.ClassNotFoundException: I0.a ... 38 more ``` Related commit termux/termux-app@da3a0ac4
Configuration menu - View commit details
-
Copy full SHA for 28bc8c8 - Browse repository at this point
Copy the full SHA 28bc8c8View commit details -
Fixed(NfcAPI): Fix
termux-nfc -t x
resulting in error notification ……being shown as method was not returned from after sending error resulting in `ResultReturner.returnData()` being called twice ``` Error in ResultReturner: java.io.IOException: Connection refused at android.net.LocalSocketImpl.connectLocal(Native Method) at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:259) at android.net.LocalSocket.connect(LocalSocket.java:162) at com.termux.api.util.ResultReturner.lambda$returnData$0(SourceFile:250) at com.termux.api.util.ResultReturner.$r8$lambda$RFR2zSHu5FsJH7JvuCx4CPnUmMY(SourceFile:0) at com.termux.api.util.ResultReturner$$ExternalSyntheticLambda0.run(SourceFile:0) at java.lang.Thread.run(Thread.java:1119) Suppressed: java.lang.Exception: Called by: at com.termux.api.util.ResultReturner.returnData(SourceFile:239) at com.termux.api.apis.NfcAPI$NfcActivity.errorNfc(SourceFile:48) at com.termux.api.apis.NfcAPI$NfcActivity.onCreate(SourceFile:87) at android.app.Activity.performCreate(Activity.java:9155) at android.app.Activity.performCreate(Activity.java:9133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1521) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4262) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4467) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:222) at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:133) at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:103) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:80) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2823) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loopOnce(Looper.java:248) at android.os.Looper.loop(Looper.java:338) at android.app.ActivityThread.main(ActivityThread.java:9067) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) ```
Configuration menu - View commit details
-
Copy full SHA for c986fb0 - Browse repository at this point
Copy the full SHA c986fb0View commit details -
Fixed(NfcAPI): Check if
NfcAdapter
is available and notnull
in `……NfcActivity.onResume()` in addition to `onCreate()` before calling its methods otherwise would trigger a `NullPointerException`
Configuration menu - View commit details
-
Copy full SHA for 4ba140d - Browse repository at this point
Copy the full SHA 4ba140dView commit details -
Fixed(NfcAPI): Explicitly specify
PendingIntent.FLAG_MUTABLE
flag f……or `PendingIntent` passed to `NfcAdapter.enableForegroundDispatch()` - https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability
Configuration menu - View commit details
-
Copy full SHA for 5040a66 - Browse repository at this point
Copy the full SHA 5040a66View commit details -
Added(JobSchedulerAPI): Add docs for
JobInfo
minimum period being r……estricted to `900000ms` (`15` minutes) for Android `>= 7`
Configuration menu - View commit details
-
Copy full SHA for 9be2a6d - Browse repository at this point
Copy the full SHA 9be2a6dView commit details -
Changed|Fixed(JobSchedulerAPI): Fix
ResultReturner.returnData()
bei……ng called multiple times for different printing since 51a02f4 and 61262f7 throwing `Connection refused` exceptions for calls after the first one instead of printing, and also refactor actions out to functions and change action output format The `ResultReturner.returnData()` will be called once for each action. The schedule job action will not print all pending jobs at end and only the pending job that was scheduled if successful. Users should use `termux-job-scheduler -p` to get all pending jobs. The `termux-job-scheduler --p` action will print `No jobs found` instead of `No pending jobs` if no pending job exists. The `termux-job-scheduler --cancel-all` action will now print all jobs to be cancelled, or `No jobs found` found. The job description will use `4` spaces instead of a tab after the path. ``` Error in ResultReturner: java.io.IOException: Connection refused at android.net.LocalSocketImpl.connectLocal(Native Method) at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:259) at android.net.LocalSocket.connect(LocalSocket.java:162) at com.termux.api.util.ResultReturner.lambda$returnData$0(ResultReturner.java:250) at com.termux.api.util.ResultReturner$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) at java.lang.Thread.run(Thread.java:1119) Suppressed: java.lang.Exception: Called by: at com.termux.api.util.ResultReturner.returnData(ResultReturner.java:239) at com.termux.api.apis.JobSchedulerAPI.displayPendingJobs(JobSchedulerAPI.java:197) at com.termux.api.apis.JobSchedulerAPI.onReceive(JobSchedulerAPI.java:181) at com.termux.api.TermuxApiReceiver.doWork(TermuxApiReceiver.java:146) at com.termux.api.TermuxApiReceiver.onReceive(TermuxApiReceiver.java:65) at android.app.ActivityThread.handleReceiver(ActivityThread.java:5029) at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2577) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loopOnce(Looper.java:248) at android.os.Looper.loop(Looper.java:338) at android.app.ActivityThread.main(ActivityThread.java:9067) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) ``` ```shell ~ $ termux-job-scheduler -s ~/test1.sh --period-ms 900000 --job-id 1 Scheduling Job 1: /data/data/com.termux/files/home/test1.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) - response 1 Pending Job 1: /data/data/com.termux/files/home/test1.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) ~ $ termux-job-scheduler -s ~/test2.sh --period-ms 900000 --job-id 2 Scheduling Job 2: /data/data/com.termux/files/home/test2.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) - response 1 Pending Job 2: /data/data/com.termux/files/home/test2.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) ~ $ termux-job-scheduler -s ~/test3.sh --period-ms 900000 --job-id 3 Scheduling Job 3: /data/data/com.termux/files/home/test3.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) - response 1 Pending Job 3: /data/data/com.termux/files/home/test3.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) ~ $ termux-job-scheduler -p Pending Job 3: /data/data/com.termux/files/home/test3.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) Pending Job 2: /data/data/com.termux/files/home/test2.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) Pending Job 1: /data/data/com.termux/files/home/test1.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) ~ $ termux-job-scheduler --cancel --job-id 2 Cancelling Job 2: /data/data/com.termux/files/home/test2.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) ~ $ termux-job-scheduler --cancel-all Cancelling Job 3: /data/data/com.termux/files/home/test3.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) Cancelling Job 1: /data/data/com.termux/files/home/test1.sh (periodic: 900000ms) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10215 UnderlyingNetworks: Null] ]) ~ $ termux-job-scheduler --cancel-all No jobs found ~ $ termux-job-scheduler -p No jobs found ~ $ termux-job-scheduler --cancel --job-id 2 No job 2 found ``` Closes #762, Closes #773
Configuration menu - View commit details
-
Copy full SHA for 6fbf61a - Browse repository at this point
Copy the full SHA 6fbf61aView commit details -
Changed: Bump
termux-shared
toda3a0ac4e2
Related commit termux/termux-app@4de0caac Related commit termux/termux-app@da3a0ac4 Related commit 28bc8c85
Configuration menu - View commit details
-
Copy full SHA for a3a231e - Browse repository at this point
Copy the full SHA a3a231eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e225c9 - Browse repository at this point
Copy the full SHA 7e225c9View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.51.0...v0.52.0