Skip to content

Replace prebuilt libft8cn.so and rename packages to ft8af#277

Merged
patrickrb merged 8 commits into
devfrom
libft8af
Jun 17, 2026
Merged

Replace prebuilt libft8cn.so and rename packages to ft8af#277
patrickrb merged 8 commits into
devfrom
libft8af

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

Summary

  • Replaces prebuilt libft8cn.so with from-source libft8af.so built via CMake/NDK
  • Renames Java package com.bg7yoz.ft8cncom.k1af.ft8af
  • Renames Kotlin package radio.ks3ckc.ft8usradio.ks3ckc.ft8af
  • Renames module directory ft8cn/ft8af/, C++ glue ft8cn_glue/ft8af_glue/
  • Updates all 44 JNI function prefixes, class names, theme, Gradle config, CI workflows, and desktop build

Test plan

  • ./gradlew assembleDebug — clean build
  • ./gradlew testDebugUnitTest — all unit tests pass
  • bash ft8af/app/src/main/cpp/ft8af_glue/run_host_tests.sh — native tests pass
  • On-device smoke: install, launch, verify FT8 RX/TX, waterfall renders

🤖 Generated with Claude Code

patrickrb and others added 6 commits June 16, 2026 16:13
MonoResampler and resample_buffer() silently returned un-resampled
samples when FftFixedIn creation failed with mismatched rates, which
would feed wrong-rate audio into the FT8 DSP pipeline. Now both paths
log the error and return empty buffers (fail closed). Also sets an
explicit CSP in tauri.conf.json instead of disabling it entirely.

Addresses Copilot review comments on PR #252.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delete the closed-source prebuilt libft8cn.so (4 ABIs) and build all
native FT8/FT4/FT2 functionality from the in-tree kgoba ft8_lib
(pinned at 6f528128). Five new JNI wrapper files replace the 21 entry
points the prebuilt provided:

- ft8_encode_jni.cpp: pack77, packFreeTextTo77, ft8/ft4_encode, synth_gfsk
- ft8_hash_jni.cpp: getHash10/12/22 (WSJT-X n22 algorithm)
- ft8_fft_jni.cpp: 8 FFT display methods on SpectrumView/SpectrumFragment
- ft8_resample_jni.cpp: 6 windowed-sinc resampler methods on FT8Resample
- ft8_decode_jni.cpp: 9 decoder methods + doSubtractSignal for FT8

The two shared libraries (libft8cn.so + libft8af_usb.so) merge into a
single libft8af.so. CMakeLists.txt adds encode.c to ft8af_dsp, removes
the prebuilt import block and -fvisibility=hidden, and renames the
output library. All 10 Java loadLibrary call sites updated from
"ft8cn"/"ft8af_usb" to "ft8af". build.gradle drops jniLibs.srcDirs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Return empty arrays instead of nullptr on error paths in all 6
  FT8Resample JNI methods to prevent NPE in Java callers.
- Remove dead first assignment in resample_float_to_float (output[i]
  was written twice; the first complex normalization was immediately
  overwritten).
- Replace O(n*win) inner loop in FFT denoising with prefix-sum for
  O(1) per-bin window average computation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Java package: com.bg7yoz.ft8cn → com.k1af.ft8af
- Kotlin package: radio.ks3ckc.ft8us → radio.ks3ckc.ft8af
- Module directory: ft8cn/ → ft8af/
- C++ glue directory: ft8cn_glue/ → ft8af_glue/
- JNI function prefix: Java_com_bg7yoz_ft8cn_ → Java_com_k1af_ft8af_
- Class renames: RadioGroupFt8cn → RadioGroupFt8af, FT8US* → FT8AF*
- Theme: Theme.Ft8CN → Theme.Ft8AF
- Gradle rootProject: Ft8CN → Ft8AF
- CI workflows, desktop build, and docs updated accordingly

The applicationId (radio.ks3ckc.ft8af), System.loadLibrary("ft8af"),
and BG7YOZ attribution are unchanged. Historical references to
libft8cn.so and Xiegu ft8cns protocol names are intentionally kept.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace prebuilt libft8cn.so with from-source libft8af.so
Rename packages and module directory to new identity
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 21.73913% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.60%. Comparing base (d72a7e1) to head (679f8dc).

Files with missing lines Patch % Lines
...main/java/com/k1af/ft8af/database/DatabaseOpr.java 0.00% 5 Missing ⚠️
...pp/src/main/java/com/k1af/ft8af/MainViewModel.java 0.00% 3 Missing ⚠️
...in/java/com/k1af/ft8af/database/OperationBand.java 50.00% 2 Missing ⚠️
...f/ft8af/ft8transmit/MeterProtectionController.java 0.00% 2 Missing ⚠️
.../com/k1af/ft8af/ft8listener/FT8SignalListener.java 0.00% 1 Missing ⚠️
...java/com/k1af/ft8af/ft8listener/ReBuildSignal.java 0.00% 1 Missing ⚠️
...main/java/com/k1af/ft8af/ft8signal/FT8Package.java 50.00% 1 Missing ⚠️
.../com/k1af/ft8af/ft8transmit/FT8TransmitSignal.java 50.00% 1 Missing ⚠️
...n/java/com/k1af/ft8af/ft8transmit/GenerateFT8.java 50.00% 1 Missing ⚠️
...a/com/k1af/ft8af/ft8transmit/TransmitCallsign.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##               dev    #277   +/-   ##
=======================================
  Coverage     8.60%   8.60%           
  Complexity     839     839           
=======================================
  Files          292     292           
  Lines        33142   33139    -3     
  Branches      5303    5303           
=======================================
  Hits          2853    2853           
+ Misses       30059   30056    -3     
  Partials       230     230           
Files with missing lines Coverage Δ
.../app/src/main/java/com/k1af/ft8af/FAQActivity.java 0.00% <ø> (ø)
...af/app/src/main/java/com/k1af/ft8af/FT8Common.java 0.00% <ø> (ø)
...f/app/src/main/java/com/k1af/ft8af/Ft8Message.java 52.54% <ø> (ø)
...src/main/java/com/k1af/ft8af/GeneralVariables.java 37.73% <ø> (ø)
...app/src/main/java/com/k1af/ft8af/MainActivity.java 0.00% <ø> (ø)
...p/src/main/java/com/k1af/ft8af/MessageHashMap.java 100.00% <ø> (ø)
.../app/src/main/java/com/k1af/ft8af/ModeProfile.java 85.71% <ø> (ø)
.../src/main/java/com/k1af/ft8af/OwnTxEchoFilter.java 100.00% <ø> (ø)
...ain/java/com/k1af/ft8af/alert/DxAlertNotifier.java 0.00% <ø> (ø)
...a/com/k1af/ft8af/bluetooth/BluetoothConstants.java 0.00% <ø> (ø)
... and 71 more

... and 422 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

patrickrb and others added 2 commits June 16, 2026 20:55
Two compounding bugs in ft8_snr() inflated FT8 signal reports:

1. Data symbols (58 of 79) used max-of-8-tones as "signal", adding a
   constant positive bias even for noise — dominating the 21 sync
   symbols where the expected tone is known.

2. Waterfall magnitudes are 0.5 dB/unit (monitor_process: 2*db+240)
   but the return value was not halved, doubling all reports.

Restrict estimation to Costas sync symbols only (matching the FT4 path
and ft8_sync_score's structure) and divide by 2 for real dB.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep the ft8af_usb → ft8af target rename from this branch while
incorporating the 16KB page-size link option added on dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@patrickrb patrickrb requested a review from Copilot June 17, 2026 01:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@patrickrb patrickrb merged commit f7e7ead into dev Jun 17, 2026
7 checks passed
@patrickrb patrickrb deleted the libft8af branch June 17, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants