Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions jniLibs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# README

This directory vendors JNA's Android native library, `libjnidispatch.so`, for the ABIs the app ships. **Do not delete these files** — the app builds without them, but crashes at runtime on the first call into bdk.

## Where the files come from

They are copied verbatim out of the JNA aar — same bytes, no patching:

```sh
curl -sLO https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.14.0/jna-5.14.0.aar
unzip -j jna-5.14.0.aar 'jni/arm64-v8a/libjnidispatch.so' -d jniLibs/arm64-v8a
unzip -j jna-5.14.0.aar 'jni/x86_64/libjnidispatch.so' -d jniLibs/x86_64
```

Keep the version in sync with whatever JNA version `bdk-android` depends on. Check it with:

```sh
grep -A3 'net.java.dev.jna' ~/Library/Caches/JetBrains/Kotlin/.m2.cache/org/bitcoindevkit/bdk-android/<version>/bdk-android-<version>.pom
```
4 changes: 2 additions & 2 deletions kotlin
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
set -e -u

# The version of the Kotlin Toolchain (and CLI) distribution to provision and use
kotlin_cli_version=0.11.0
kotlin_cli_version=0.12.2
# Establish chain of trust from here by specifying exact checksum of Kotlin Toolchain (and CLI) distribution to be run
kotlin_cli_sha256=ff872a5bf42ad1a8fac90ccca6ac38a4d4a6aafefc39167860f66a77b1653d74
kotlin_cli_sha256=9fec42de4f378a27240b78c1b66ffef0c2aca66a4a6390ca67fe51aacb75677e

KOTLIN_CLI_DOWNLOAD_ROOT="${KOTLIN_CLI_DOWNLOAD_ROOT:-https://packages.jetbrains.team/maven/p/amper/amper}"

Expand Down
17 changes: 12 additions & 5 deletions kotlin.bat
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
setlocal

@rem The version of the Kotlin Toolchain distribution to provision and use
set kotlin_cli_version=0.11.0
set kotlin_cli_version=0.12.2
@rem Establish chain of trust from here by specifying the exact checksum of the Kotlin Toolchain distribution to be run
set kotlin_cli_sha256=ff872a5bf42ad1a8fac90ccca6ac38a4d4a6aafefc39167860f66a77b1653d74
set kotlin_cli_sha256=9fec42de4f378a27240b78c1b66ffef0c2aca66a4a6390ca67fe51aacb75677e

if not defined KOTLIN_CLI_DOWNLOAD_ROOT set KOTLIN_CLI_DOWNLOAD_ROOT=https://packages.jetbrains.team/maven/p/amper/amper
if not defined KOTLIN_CLI_BOOTSTRAP_CACHE_DIR set KOTLIN_CLI_BOOTSTRAP_CACHE_DIR=%LOCALAPPDATA%\JetBrains\Kotlin\cli
Expand Down Expand Up @@ -175,7 +175,7 @@ if exist "%wrapper_candidate%" (

if exist "%project_dir%\project.yaml" (
@rem Found project.yaml but no wrapper alongside it
echo WARNING: Found a project.yaml in '%project_dir%', but the wrapper script is missing; using Kotlin Toolchain v$kotlin_cli_version. >&2
echo WARNING: Found a project.yaml in '%project_dir%', but the wrapper script is missing; using Kotlin Toolchain v%kotlin_cli_version%. >&2
exit /b 1
)

Expand Down Expand Up @@ -253,5 +253,12 @@ if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
rem We use busybox here because it doesn't reinterpret the user-passed command-line arguments (that we pass via %*).
rem Also this way we can use the unified launcher script (.sh)
set KOTLIN_CLI_WRAPPER_PATH=%~f0
"%busybox_exe%" sh "%kotlin_cli_target_dir%\bin\launcher.sh" %*
exit /B %ERRORLEVEL%

rem The '& call' after the app run is to avoid the "Terminate batch job (Y/N)?" prompt
"%busybox_exe%" sh "%kotlin_cli_target_dir%\bin\launcher.sh" %* & call :exitWithErrorLevel

:exitWithErrorLevel
@rem We use "%COMSPEC%" /d /c exit so that and/or operators work properly when calling kotlin.bat directly from a script
@rem without the `call` command. With a plain `exit /B %ERRORLEVEL%`, using `kotlin.bat && echo success` would print
@rem 'success' even in case of failure. Consumers would have to use `call kotlin.bat && echo success` for it to work.`
"%COMSPEC%" /d /c exit %ERRORLEVEL%
Loading