Benjamin-Loison / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
0 stars 0 forks source link

First `termux-notification` `--button1-action` overwrites following `termux-notification` `--button1-action` #23

Open Benjamin-Loison opened 3 weeks ago

Benjamin-Loison commented 3 weeks ago

See Benjamin_Loison/Food/issues/43.

pkg install -y termux-api

+5

Problem description

Steps to reproduce

Expected behavior

Additional information

Benjamin-Loison commented 6 days ago

Can investigate in Waydroid.

Benjamin-Loison commented 6 days ago

If I remember correctly I already investigated how to download GitHub action artefact.

No interesting issue for github.com] (so takes into account api.github.com, even if wrote as {api.,}.github.com) in Improve_websites_thanks_to_open_source/issues using Benjamin-Loison/gitea/issues/9.

Related to Improve_websites_thanks_to_open_source/issues/936.

11

18

22

Benjamin-Loison commented 6 days ago

Well let us proceed again.

Benjamin-Loison commented 6 days ago

Before moving from commit to actual artefact download, let us focus on the latter.

https://github.com/termux/termux-api https://github.com/termux/termux-api/commit/c553bc2ba7de37ad5c42df23d71e699d2785d7c5 https://github.com/termux/termux-api/actions/runs/10155362023/job/28081990125 https://github.com/termux/termux-api/actions/runs/10155362023/artifacts/1753648493

If I remember correctly setting an account cookie is enough to download such URL.

wget 'https://github.com/termux/termux-api/actions/runs/10155362023/artifacts/1753648493'
--2024-09-17 00:16:01--  https://github.com/termux/termux-api/actions/runs/10155362023/artifacts/1753648493
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 307 Temporary Redirect
Location: https://github.com/termux/termux-api/suites/26571635387/artifacts/1753648493 [following]
--2024-09-17 00:16:01--  https://github.com/termux/termux-api/suites/26571635387/artifacts/1753648493
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 404 Not Found
2024-09-17 00:16:01 ERROR 404: Not Found.

Hence the issue I was looking for should mention actions/runs/.

I checked:

with no luck.

Benjamin_Loison/termux-boot/issues/6 does not help too.

Benjamin-Loison commented 6 days ago
minimizeCURL curl.sh 'HTTP/2 307'
Output: ``` 1800 Removing headers 1709 still fine 1586 still fine 1549 still fine 1503 still fine 1491 still fine 1463 still fine 1429 still fine 1399 still fine 1369 still fine 1343 still fine 1319 still fine 1297 still fine 1279 still fine Removing URL parameters Removing cookies 1199 still fine 1164 still fine 1149 still fine 1120 still fine 1075 still fine 1029 still fine 812 still fine 205 still fine 178 still fine 159 still fine Removing raw data curl -I https://github.com/termux/termux-api/suites/26571635387/artifacts/1753648493 -H 'Cookie: user_session=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ```
Benjamin-Loison commented 6 days ago
history | grep '[u]ser_session'

does not return anything while I remember recently having looked for using headers with wget.

Benjamin-Loison commented 6 days ago
 wget --header='Cookie: user_session=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' https://github.com/termux/termux-api/suites/26571635387/artifacts/1753648493

works fine.

 wget --header='Cookie: user_session=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' https://github.com/termux/termux-api/actions/runs/10155362023/artifacts/1753648493

too.

If I remember I was not able to use the GitHub API for this purpose. Note that the final download URL does not require to be authenticated, hence could in theory provide a service redirecting safely people to the wanted download without authenticating. The question is then how to prove that the redirection is correct. GitHub action logs seem to mention the checksum so with client verification it seems douable without trust.

My aim here is to retrieve APK by commit to bisect, so just retrieving last one as I remember does not interest me much. Maybe I was referring to https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-artifacts-for-a-repository.

Benjamin-Loison commented 6 days ago
history | grep 'termux.*apk'

does not bring interesting results.

Benjamin-Loison commented 6 days ago

https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository

Benjamin-Loison commented 6 days ago

DuckDuckGo and Google results for GitHub API get workflow run by commit do not look interesting.

Benjamin-Loison commented 6 days ago

https://api.github.com/repos/termux/termux-app/actions/artifacts

curl -s https://api.github.com/repos/termux/termux-app/actions/artifacts | jq .artifacts[].name
Output: ``` "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_sha256sums" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_x86" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_x86_64" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_armeabi-v7a" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_universal" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_sha256sums" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_x86" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_x86_64" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_armeabi-v7a" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_arm64-v8a" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_universal" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_sha256sums" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_x86" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_x86_64" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_armeabi-v7a" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_arm64-v8a" "termux-app_v0.118.0+c2d57f2-apt-android-5-github-debug_universal" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_sha256sums" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_x86" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_x86_64" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_armeabi-v7a" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_arm64-v8a" "termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_universal" "termux-app_v0.118.0+f6e2300-apt-android-5-github-debug_sha256sums" "termux-app_v0.118.0+f6e2300-apt-android-5-github-debug_x86" "termux-app_v0.118.0+f6e2300-apt-android-5-github-debug_x86_64" "termux-app_v0.118.0+f6e2300-apt-android-5-github-debug_armeabi-v7a" "termux-app_v0.118.0+f6e2300-apt-android-5-github-debug_arm64-v8a" "termux-app_v0.118.0+f6e2300-apt-android-5-github-debug_universal" ```

https://api.github.com/repos/termux/termux-app/actions/runs?head_sha=c2d57f2ed810b6fa854a6c9ab0ecee4aac38a0cc

does not mention 10155362023 and 28081990125.

Benjamin-Loison commented 6 days ago

https://api.github.com/repos/termux/termux-app/actions/artifacts?name=termux-app_v0.118.0+c2d57f2-apt-android-7-github-debug_sha256sums does not return anything...

Benjamin-Loison commented 6 days ago
gh api repos/termux/termux-api/actions/artifacts --jq ".artifacts[] | select(.workflow_run.head_sha == \"c553bc2ba7de37ad5c42df23d71e699d2785d7c5\")"
{
  "message": "Bad credentials",
  "documentation_url": "https://docs.github.com/rest",
  "status": "401"
}
gh: Bad credentials (HTTP 401)

Source: the Stack Overflow answer 73119578

gh
Output: ``` Work seamlessly with GitHub from the command line. USAGE gh [flags] CORE COMMANDS auth: Authenticate gh and git with GitHub browse: Open the repository in the browser codespace: Connect to and manage codespaces gist: Manage gists issue: Manage issues org: Manage organizations pr: Manage pull requests project: Work with GitHub Projects. release: Manage releases repo: Manage repositories GITHUB ACTIONS COMMANDS cache: Manage Github Actions caches run: View details about workflow runs workflow: View details about GitHub Actions workflows ALIAS COMMANDS co: Alias for "pr checkout" ADDITIONAL COMMANDS alias: Create command shortcuts api: Make an authenticated GitHub API request completion: Generate shell completion scripts config: Manage configuration for gh extension: Manage gh extensions gpg-key: Manage GPG keys label: Manage labels ruleset: View info about repo rulesets search: Search for repositories, issues, and pull requests secret: Manage GitHub secrets ssh-key: Manage SSH keys status: Print information about relevant issues, pull requests, and notifications across repositories variable: Manage GitHub Actions variables HELP TOPICS actions: Learn about working with GitHub Actions environment: Environment variables that can be used with gh exit-codes: Exit codes used by gh formatting: Formatting options for JSON data exported from gh mintty: Information about using gh with MinTTY reference: A comprehensive reference of all gh commands FLAGS --help Show help for command --version Show gh version EXAMPLES $ gh issue create $ gh repo clone cli/cli $ gh pr checkout 321 LEARN MORE Use `gh --help` for more information about a command. Read the manual at https://cli.github.com/manual ```
gh auth
Output: ``` Authenticate gh and git with GitHub USAGE gh auth [flags] AVAILABLE COMMANDS login: Log in to a GitHub account logout: Log out of a GitHub account refresh: Refresh stored authentication credentials setup-git: Setup git with GitHub CLI status: View authentication status switch: Switch active GitHub account token: Print the authentication token gh uses for a hostname and account INHERITED FLAGS --help Show help for command LEARN MORE Use `gh --help` for more information about a command. Read the manual at https://cli.github.com/manual ```
gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? SSH
? Upload your SSH public key to your GitHub account? /home/benjamin/.ssh/id_ed25519.pub
? Title for your SSH key: GitHub CLI
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: XXXX-XXXX
Press Enter to open github.com in your browser... 
✓ Authentication complete.
- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
✓ SSH key already existed on your GitHub account: /home/benjamin/.ssh/id_ed25519.pub
✓ Logged in as Benjamin-Loison
! You were already logged in to this account
gh api repos/termux/termux-api/actions/artifacts --jq ".artifacts[] | select(.workflow_run.head_sha == \"c553bc2ba7de37ad5c42df23d71e699d2785d7c5\")"
Output: ```json { "archive_download_url": "https://api.github.com/repos/termux/termux-api/actions/artifacts/1753648493/zip", "created_at": "2024-07-30T02:59:04Z", "expired": false, "expires_at": "2024-10-28T02:57:32Z", "id": 1753648493, "name": "termux-api_v0.50.1+c553bc2-github-debug", "node_id": "MDg6QXJ0aWZhY3QxNzUzNjQ4NDkz", "size_in_bytes": 6113846, "updated_at": "2024-07-30T02:59:04Z", "url": "https://api.github.com/repos/termux/termux-api/actions/artifacts/1753648493", "workflow_run": { "head_branch": "master", "head_repository_id": 38464245, "head_sha": "c553bc2ba7de37ad5c42df23d71e699d2785d7c5", "id": 10155362023, "repository_id": 38464245 } } ```
Benjamin-Loison commented 6 days ago

https://api.github.com/repos/termux/termux-api/actions/workflows/debug_build.yml/runs?head_sha=c553bc2ba7de37ad5c42df23d71e699d2785d7c5

Benjamin-Loison commented 6 days ago

https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run https://api.github.com/repos/termux/termux-api/actions/runs/10155362023/jobs https://api.github.com/repos/termux/termux-api/actions/runs/10155362023/artifacts

Benjamin-Loison commented 6 days ago
REPOSITORY=termux-api
COMMIT=c553bc2ba7de37ad5c42df23d71e699d2785d7c5
RUN_ID=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/actions/workflows/debug_build.yml/runs?head_sha=$COMMIT" | jq .workflow_runs[0].id`
ARTIFACT_ID=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/actions/runs/$RUN_ID/artifacts" | jq .artifacts[0].id`
 USER_SESSION=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
wget --header="Cookie: user_session=$USER_SESSION" https://github.com/termux/$REPOSITORY/actions/runs/$RUN_ID/artifacts/$ARTIFACT_ID

works as wanted.

REPOSITORY=termux-api
DEFAULT_BRANCH=`curl -s "https://api.github.com/repos/termux/$REPOSITORY" | jq -r .default_branch`
COMMIT=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/commits/$DEFAULT_BRANCH" | jq -r .sha`
RUN_ID=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/actions/workflows/debug_build.yml/runs?head_sha=$COMMIT" | jq .workflow_runs[0].id`
ARTIFACT_ID=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/actions/runs/$RUN_ID/artifacts" | jq .artifacts[0].id`
 USER_SESSION=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
wget --header="Cookie: user_session=$USER_SESSION" https://github.com/termux/$REPOSITORY/actions/runs/$RUN_ID/artifacts/$ARTIFACT_ID

works as wanted for last commit APK.

Benjamin-Loison commented 6 days ago

.apk file extension is mandatory for adb install.

REPOSITORY=termux-api
DEFAULT_BRANCH=`curl -s "https://api.github.com/repos/termux/$REPOSITORY" | jq -r .default_branch`
COMMIT=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/commits/$DEFAULT_BRANCH" | jq -r .sha`
RUN_ID=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/actions/workflows/debug_build.yml/runs?head_sha=$COMMIT" | jq .workflow_runs[0].id`
ARTIFACT=`curl -s "https://api.github.com/repos/termux/$REPOSITORY/actions/runs/$RUN_ID/artifacts" | jq .artifacts[0]`
ARTIFACT_NAME=`echo $ARTIFACT | jq -r .name`
ARTIFACT_ID=`echo "$ARTIFACT" | jq .id`
 USER_SESSION=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
APK_FILE_NAME=$ARTIFACT_NAME.apk
wget --header="Cookie: user_session=$USER_SESSION" https://github.com/termux/$repository/actions/runs/$RUN_ID/artifacts/$ARTIFACT_ID
unzip $ARTIFACT_ID
adb install $APK_FILE_NAME
for file in `zipinfo -1 $ARTIFACT_ID`
do
    rm $file
done
rm $ARTIFACT_ID

Source: the Super User answer 816676

 USER_SESSION=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
REPOSITORIES=(termux-app termux-api)
for repository in "${REPOSITORIES[@]}"
do
    DEFAULT_BRANCH=`curl -s "https://api.github.com/repos/termux/$repository" | jq -r .default_branch`
    COMMIT=`curl -s "https://api.github.com/repos/termux/$repository/commits/$DEFAULT_BRANCH" | jq -r .sha`
    RUN_ID=`curl -s "https://api.github.com/repos/termux/$repository/actions/workflows/debug_build.yml/runs?head_sha=$COMMIT" | jq .workflow_runs[0].id`
    ARTIFACT=`curl -s "https://api.github.com/repos/termux/$repository/actions/runs/$RUN_ID/artifacts" | jq .artifacts[0]`
    ARTIFACT_NAME=`echo $ARTIFACT | jq -r .name`
    ARTIFACT_ID=`echo "$ARTIFACT" | jq .id`
    APK_FILE_NAME=$ARTIFACT_NAME.apk
    wget --header="Cookie: user_session=$USER_SESSION" https://github.com/termux/$repository/actions/runs/$RUN_ID/artifacts/$ARTIFACT_ID
    unzip $ARTIFACT_ID
    adb install $APK_FILE_NAME
    for file in `zipinfo -1 $ARTIFACT_ID`
    do
        rm $file
    done
    rm $ARTIFACT_ID
done
Benjamin-Loison commented 5 days ago

Preferably test on recent Android version as otherwise the test may not be correct.

So testing on my really up-to-date phone seems the most appropriate, maybe just reinstalling Termux API is enough.

Maybe should check if there was recent update of termux-api APT package.

find -name 'termux-api'
./packages/termux-api

termux-packages/tree/ca3e4fcbecd9636c39eab494a004c8d0840fb740/packages/termux-api which relies on termux-api-package. termux-api-package/commits/master/ does not show recent relevant activity so it does not seem to be the source of the issue.

Benjamin-Loison commented 5 days ago

Benjamin-Loison/android/issues/46#issuecomment-2357196559 would help.

Current allowed permissions are:

Benjamin-Loison commented 5 days ago
notification-test() {
    termux-notification -t "Test $1" --button1 "Button $1" --button1-action "echo Button $1 >> termux_notification_action.txt"
}
notification-test 0
notification-test 1

While following --button1 label is correct, --button1-action is stuck to the initial one, hence termux_notification_action.txt is only made of Button 0 lines.

With commit/c553bc2ba7de37ad5c42df23d71e699d2785d7c5 on Fairphone 4 LineageOS.

adb install termux-api_v0.50.1+github-debug.apk
Performing Streamed Install
Success

does not list the app anymore when scroll up but it is in Settings > Apps > Recently opened apps > See all N apps.

This version solves the issue.

Should try the equivalent GitHub action one.

Benjamin-Loison commented 5 days ago

termux-api/tree/v0.50.1

termux-api/commit/e315b53ec048e3dd321d69525c9e1162ca53f19f

Oldest GitHub action commit is commit/83c62b35188b2df7987992bb52263047444e4a90 but it shows The logs for this run have expired and are no longer available..

Oldest GitHub action commit with logs table of contents is commit/a9abc964b48bb3f9c54a2086df364ee8183cf523 but it shows Error: The log was not found. It may have been deleted based on retention settings..

Oldest GitHub action commit with artifact is commit/c553bc2ba7de37ad5c42df23d71e699d2785d7c5 which is the last commit hence by definition has the issue.

So have to compile on my own, related to #11.

Benjamin-Loison commented 5 days ago

Would be nice to at least use the version just before introducing the issue.

Benjamin-Loison commented 4 days ago

My own Debian 12 GNOME Pegasus last commit build has the issue.

rm termux-api_debug.apk; scp benjamin_loison@pegasus:/home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-api/app/build/outputs/apk/debug/termux-api_debug.apk . && adb install termux-api_debug.apk
git reset --hard e315b53ec048e3dd321d69525c9e1162ca53f19f
HEAD is now at e315b53 Bump to v0.50.1

I paid attention to no previous compilation file to be remaining.

git diff
Output: ```diff diff --git a/build.gradle b/build.gradle index 5675f8e..06051b5 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.4.1' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3cd8500..2ec77e5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ```

Source: the Stack Overflow answer 75502295

Without having to restart Termux etc, my own build of v0.50.1 does not have the issue.

So it's time for Git bisect.

Benjamin-Loison commented 4 days ago
git bisect start
status: waiting for both good and bad commits
git bisect bad
status: waiting for good commit(s), bad commit known
git bisect good e315b53ec048e3dd321d69525c9e1162ca53f19f
Bisecting: 45 revisions left to test after this (roughly 6 steps)
[e7a684a9942e3d720975eb90e14e5f71bd6cb9b0] Changed: Remove redundant return variables
git log
commit e7a684a9942e3d720975eb90e14e5f71bd6cb9b0 (HEAD)
Author: agnostic-apollo <agnosticapollo@gmail.com>
Date:   Mon Mar 14 22:58:06 2022 +0500

    Changed: Remove redundant return variables
Benjamin-Loison commented 4 days ago
./gradlew assembleDebug
Output: ``` Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> FAILURE: Build failed with an exception. * What went wrong: Gradle could not start your build. > Cannot create service of type TaskExecuter using method ProjectExecutionServices.createTaskExecuter() as there is a problem with parameter #15 of type ReservedFileSystemLocationRegistry. > Cannot create service of type ReservedFileSystemLocationRegistry using method ProjectExecutionServices.createReservedFileLocationRegistry() as there is a problem with parameter #1 of type List. > Could not create service of type ExecutionHistoryStore using ExecutionGradleServices.createExecutionHistoryStore(). > java.io.FileNotFoundException: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-api/.gradle/7.3.1/executionHistory/executionHistory.lock (Permission denied) * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 2s ```
sudo ./gradlew assembleDebug
Output: ``` Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> > Task :app:checkDebugAarMetadata FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:checkDebugAarMetadata'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not find com.termux.termux-app:termux-shared:760ae78aff. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/termux/termux-app/termux-shared/760ae78aff/termux-shared-760ae78aff.pom - https://repo.maven.apache.org/maven2/com/termux/termux-app/termux-shared/760ae78aff/termux-shared-760ae78aff.pom - https://jitpack.io/com/termux/termux-app/termux-shared/760ae78aff/termux-shared-760ae78aff.pom Required by: project :app * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 8s 3 actionable tasks: 3 executed ```
git status
Output: ``` HEAD detached at e7a684a You are currently bisecting, started from branch 'master'. (use "git bisect reset" to get back to the original branch) nothing to commit, working tree clean ```
Benjamin-Loison commented 4 days ago
sudo git clean -f -d -x
Removing .gradle/
Removing app/build/

does not help.

./gradlew assembleDebug
Output: ``` FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-api/local.properties'. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 799ms ```
echo 'sdk.dir=/usr/lib/android-sdk' > local.properties

Then no significant difference with initial error.

Benjamin-Loison commented 4 days ago
grep -rI 'debugRuntimeClasspath'

does not return anything.

grep -rI 760ae78aff
app/build.gradle:    implementation 'com.termux.termux-app:termux-shared:760ae78aff'
Benjamin-Loison commented 4 days ago

termux-shared does not exist.

Benjamin-Loison commented 4 days ago

Seems to refer to termux-app/tree/760ae78affdf5f53cefffcad073bd535b17e5a55/termux-shared.

./gradlew assembleDebug
Output: ``` Downloading https://services.gradle.org/distributions/gradle-7.2-all.zip ..............10%...............20%...............30%...............40%...............50%...............60%...............70%...............80%...............90%...............100% Welcome to Gradle 7.2! Here are the highlights of this release: - Toolchain support for Scala - More cache hits when Java source files have platform-specific line endings - More resilient remote HTTP build cache behavior For more details see https://docs.gradle.org/7.2/release-notes.html Starting a Gradle Daemon (subsequent builds will be faster) FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > com.android.builder.errors.EvalIssueException: SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-app/local.properties'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 17s ```
echo 'sdk.dir=/usr/lib/android-sdk' > local.properties
./gradlew assembleDebug
Output: ``` > Configure project :app Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Checking the license for package NDK (Side by side) 22.1.7171670 in /usr/lib/android-sdk/licenses License for package NDK (Side by side) 22.1.7171670 accepted. Preparing "Install NDK (Side by side) 22.1.7171670 (revision: 22.1.7171670)". Warning: Failed to read or create install properties file. FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > java.lang.RuntimeException: com.android.builder.sdk.InstallFailedException: Failed to install the following SDK components: ndk;22.1.7171670 NDK (Side by side) 22.1.7171670 The SDK directory is not writable (/usr/lib/android-sdk) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s ```
sudo chown benjamin_loison: /usr/lib/android-sdk/ -R
./gradlew assembleDebug
Output: ``` > Configure project :app Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Checking the license for package NDK (Side by side) 22.1.7171670 in /usr/lib/android-sdk/licenses License for package NDK (Side by side) 22.1.7171670 accepted. Preparing "Install NDK (Side by side) 22.1.7171670 (revision: 22.1.7171670)". "Install NDK (Side by side) 22.1.7171670 (revision: 22.1.7171670)" ready. Installing NDK (Side by side) 22.1.7171670 in /usr/lib/android-sdk/ndk/22.1.7171670 "Install NDK (Side by side) 22.1.7171670 (revision: 22.1.7171670)" complete. "Install NDK (Side by side) 22.1.7171670 (revision: 22.1.7171670)" finished. Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> > Task :app:downloadBootstraps Downloading https://github.com/termux/termux-packages/releases/download/bootstrap-2022.01.07-r1/bootstrap-aarch64.zip ... Downloading https://github.com/termux/termux-packages/releases/download/bootstrap-2022.01.07-r1/bootstrap-arm.zip ... Downloading https://github.com/termux/termux-packages/releases/download/bootstrap-2022.01.07-r1/bootstrap-i686.zip ... Downloading https://github.com/termux/termux-packages/releases/download/bootstrap-2022.01.07-r1/bootstrap-x86_64.zip ... > Task :terminal-emulator:externalNativeBuildDebug Build termux_armeabi-v7a Build termux_arm64-v8a Build termux_x86 Build termux_x86_64 > Task :app:externalNativeBuildDebug Build termux-bootstrap_armeabi-v7a Build termux-bootstrap_arm64-v8a Build termux-bootstrap_x86 Build termux-bootstrap_x86_64 > Task :app:processDebugMainManifest FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugMainManifest'. > Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @6e875567 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1m 31s 75 actionable tasks: 75 executed ```
./gradlew assembleDebug
Output: ``` > Configure project :terminal-emulator WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL. > Configure project :terminal-view WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL. > Configure project :termux-shared WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL. > Task :terminal-emulator:processDebugManifest package="com.termux.terminal" found in source AndroidManifest.xml: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-app/terminal-emulator/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :termux-shared:processDebugManifest package="com.termux.shared" found in source AndroidManifest.xml: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-app/termux-shared/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :terminal-view:processDebugManifest package="com.termux.view" found in source AndroidManifest.xml: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-app/terminal-view/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :app:processDebugMainManifest package="com.termux" found in source AndroidManifest.xml: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-app/app/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :terminal-emulator:compileDebugJavaWithJavac Note: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-app/terminal-emulator/src/main/java/com/termux/terminal/TerminalSession.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. > Task :terminal-view:compileDebugJavaWithJavac Note: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-app/terminal-view/src/main/java/com/termux/view/TerminalView.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. > Task :termux-shared:compileDebugJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. > Task :app:compileDebugJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. BUILD SUCCESSFUL in 46s 133 actionable tasks: 133 executed ```
ls -lh termux-shared/build/outputs/aar/
total 324K
-rw-r--r-- 1 benjamin_loison benjamin_loison 321K Sep 19 03:21 termux-shared-debug.aar
Benjamin-Loison commented 4 days ago

termux-api/blob/e7a684a9942e3d720975eb90e14e5f71bd6cb9b0/app/build.gradle#L70-L74 seems helpful.

below should be above, right?

Benjamin-Loison commented 4 days ago

termux-app/wiki/Termux-Libraries/c3a3fb546086e1b78a1d8d7c3df478d46e63529f seems helpful as well.

Benjamin-Loison commented 4 days ago
git diff app/build.gradle
Output: ```diff diff --git a/app/build.gradle b/app/build.gradle index deb98cb..5bce1e8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,7 +67,7 @@ dependencies { implementation 'androidx.biometric:biometric:1.2.0-alpha03' implementation 'androidx.media:media:1.4.3' - implementation 'com.termux.termux-app:termux-shared:760ae78aff' + implementation 'com.github.termux.termux-app:termux-shared:760ae78aff' // Use if below libraries are published locally by termux-app with `./gradlew publishReleasePublicationToMavenLocal` and used with `mavenLocal()`. // If updates are done, republish there and sync project with gradle files here // https://github.com/termux/termux-app/wiki/Termux-Libraries ```

Source: termux-app/wiki/Termux-Libraries/c3a3fb546086e1b78a1d8d7c3df478d46e63529f#termux-shared

solves the issue.

Benjamin-Loison commented 4 days ago
git bisect bad
Bisecting: 22 revisions left to test after this (roughly 5 steps)
[187e691cf957f8267ca215024a8691260bc0abd3] Changed: Rename PlayerService to MediaPlayerService
Benjamin-Loison commented 4 days ago
git bisect good
Bisecting: 11 revisions left to test after this (roughly 4 steps)
[d606d131f5e2407d41e0d427a048c51353d211e6] Changed: Suppress build.gradle validateVersionName() warnings
Benjamin-Loison commented 4 days ago
git bisect good
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[3bea194249586a7dcb143e66b46c1694cb6ca21a] Changed: Remove hardcoded `com.termux` values
Benjamin-Loison commented 4 days ago
git bisect bad
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[cfdcab920ef2b82a96096d924d21dbef2bdb6ad1] Fixed: Exit loop after "android.nfc.tech.Ndef" found in tech list
Benjamin-Loison commented 4 days ago
git bisect good
Bisecting: 0 revisions left to test after this (roughly 1 step)
[9a1e19cf5616fef1e7e5fbf78742bf007277f14c] Changed: Remove unused imports
Benjamin-Loison commented 4 days ago
./gradlew assembleDebug
Output: ``` > Task :app:compileDebugJavaWithJavac FAILED /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-api/app/src/main/java/com/termux/api/apis/NotificationAPI.java:416: error: cannot find symbol .appendQueryParameter("arguments", Arrays.toString(arguments)) ^ symbol: variable Arrays location: class NotificationAPI Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-api/app/src/main/java/com/termux/api/apis/NotificationAPI.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 699ms 13 actionable tasks: 1 executed, 12 up-to-date ```
Benjamin-Loison commented 4 days ago
git diff HEAD~ HEAD app/src/main/java/com/termux/api/apis/NotificationAPI.java
Output: ```diff diff --git a/app/src/main/java/com/termux/api/apis/NotificationAPI.java b/app/src/main/java/com/termux/api/apis/NotificationAPI.java index 979590d..f101d89 100644 --- a/app/src/main/java/com/termux/api/apis/NotificationAPI.java +++ b/app/src/main/java/com/termux/api/apis/NotificationAPI.java @@ -27,7 +27,6 @@ import com.termux.shared.logger.Logger; import java.io.File; import java.io.PrintWriter; import java.lang.reflect.Field; -import java.util.Arrays; import java.util.Objects; import java.util.UUID; ```

termux-api/commit/9a1e19cf5616fef1e7e5fbf78742bf007277f14c#diff-343e04246aa27ee11598690b750ef754846d37f1107456982925ae4526689ce7

git checkout HEAD~ app/src/main/java/com/termux/api/apis/NotificationAPI.java

solves the issue.

Benjamin-Loison commented 4 days ago
git bisect good
3bea194249586a7dcb143e66b46c1694cb6ca21a is the first bad commit
commit 3bea194249586a7dcb143e66b46c1694cb6ca21a
Author: agnostic-apollo <agnosticapollo@gmail.com>
Date:   Mon Mar 14 21:56:45 2022 +0500

    Changed: Remove hardcoded `com.termux` values

 .../main/java/com/termux/api/SocketListener.java   |  3 +-
 .../java/com/termux/api/TermuxAPIConstants.java    | 14 +++++++++
 .../activities/TermuxApiPermissionActivity.java    |  3 +-
 .../main/java/com/termux/api/apis/DialogAPI.java   |  3 +-
 .../java/com/termux/api/apis/JobSchedulerAPI.java  | 27 ++++++++--------
 .../java/com/termux/api/apis/NotificationAPI.java  | 36 +++++++++++-----------
 .../java/com/termux/api/apis/StorageGetAPI.java    |  3 +-
 app/src/main/java/com/termux/api/apis/UsbAPI.java  |  3 +-
 8 files changed, 57 insertions(+), 35 deletions(-)
 create mode 100644 app/src/main/java/com/termux/api/TermuxAPIConstants.java
Benjamin-Loison commented 4 days ago

commit/3bea194249586a7dcb143e66b46c1694cb6ca21a#diff-343e04246aa27ee11598690b750ef754846d37f1107456982925ae4526689ce7

Benjamin-Loison commented 4 days ago
git reset --hard 3bea194249586a7dcb143e66b46c1694cb6ca21a
HEAD is now at 3bea194 Changed: Remove hardcoded `com.termux` values

After manual build, 3bea194249586a7dcb143e66b46c1694cb6ca21a has the issue.

git reset --hard 3bea194249586a7dcb143e66b46c1694cb6ca21a~
HEAD is now at 9a1e19c Changed: Remove unused imports

3bea194249586a7dcb143e66b46c1694cb6ca21a~ does not have the issue.

So it confirms git bisect result that is 3bea194249586a7dcb143e66b46c1694cb6ca21a is to blame.

Benjamin-Loison commented 4 days ago

So the last working release is from 31 Dec, 2021 (termux-api/releases/tag/v0.50.1), the commit to blame (3bea194249586a7dcb143e66b46c1694cb6ca21a) is from Mar 14, 2022, 6:57 PM GMT+1, hence the last working commit (9a1e19cf5616fef1e7e5fbf78742bf007277f14c) is from Mar 14, 2022, 6:57 PM GMT+1.

The same time for these commits is not an error from my side.

Benjamin-Loison commented 4 days ago

The reason why I switched to more recent commits is #18 which has been patched on Sep 23, 2022, 11:32 PM GMT+2 (11eff5658cae1a2f0f2031a5da8df9351d4cb9e5) it seems, hence after the introduced issue, so have to investigate what went wrong in this commit.

Benjamin-Loison commented 4 days ago

https://github.com/termux/termux-app/blob/8c1749ef9699e2953c7ca12a976c2fb70a6107e5/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java#L360-L361

https://github.com/termux/termux-app/blob/8c1749ef9699e2953c7ca12a976c2fb70a6107e5/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java#L346-L347

So TERMUX_API_PACKAGE_NAME is equivalent to com.termux.api.

Benjamin-Loison commented 4 days ago

So only still have to review:

Benjamin-Loison commented 4 days ago

commit/3bea194249586a7dcb143e66b46c1694cb6ca21a#diff-0dffbfbbf03868ae99fdf8ab411c64fa63d13590c7a1d8d2f11082d55e1eafc2R5 does not seem used at least in the 3 mentioned files.

Benjamin-Loison commented 4 days ago

app/src/main/java/com/termux/api/TermuxAPIConstants.java on its own look right.

Benjamin-Loison commented 4 days ago

app/src/main/java/com/termux/api/apis/JobSchedulerAPI.java has less changes than app/src/main/java/com/termux/api/apis/NotificationAPI.java.

Benjamin-Loison commented 4 days ago

Can revert the problematic part of this commit on most recent commit to have the best of both worlds in theory.