Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
5bc6aca
Self hosted windows runner
itsafuu Feb 2, 2026
622a87e
Checkbox for platforms in CI run
itsafuu Jan 30, 2026
08515ca
trial for docker
itsafuu Jan 30, 2026
3149478
Return to normal credentials
itsafuu Jan 30, 2026
892f04e
Try using token for git
itsafuu Jan 30, 2026
5ef03cf
Remove permissions block
itsafuu Jan 30, 2026
648d2c5
Initial attempt at updating release tag build with changes from main …
itsafuu Feb 6, 2026
1382ffc
Added PCH to genius account
EduMenges Jan 27, 2026
a722393
Don't specify threads, hopefully reduce memory usage of build on arm
itsafuu Feb 6, 2026
13b4a8f
Some initial structure for processing data types with string(bert tiny)
itsafuu Feb 11, 2026
6934c83
Test for processing string types, need tokenizer
itsafuu Feb 11, 2026
4c65043
Adjustments to expect pre-tokenized inputs, if we want to take raw st…
itsafuu Feb 11, 2026
780ae72
Update procmgr submodule
itsafuu Feb 11, 2026
a7e2aa6
Initial attempt at texture3d, no errors but the output is not sane
itsafuu Feb 12, 2026
289fbba
Update submodule
itsafuu Feb 12, 2026
fc4f34a
Implement slices for texture 3d, creates chunking, allows usage of la…
itsafuu Feb 12, 2026
b06d74b
Update submodule
itsafuu Feb 12, 2026
21f9fc5
Example conversion util
itsafuu Feb 12, 2026
1be3b6d
Updated to use smaller strides for overlap
itsafuu Feb 12, 2026
39f29a2
After a lot of work, I think this works to find a spleen
itsafuu Feb 13, 2026
1f34344
Update submodule
itsafuu Feb 13, 2026
34e7596
Updates for saving out data using asynciomanager
itsafuu Feb 13, 2026
4085063
Update submodule
itsafuu Feb 13, 2026
ad2ecda
Initial texture1d setup
itsafuu Feb 13, 2026
2e05cb1
texture1d output directly compares to pytorch output for validation
itsafuu Feb 13, 2026
886bbaa
Bool datatype + generators for onnx/mnn
itsafuu Feb 16, 2026
2780790
Update submodule
itsafuu Feb 16, 2026
4f794e2
Buffer datatype setup
itsafuu Feb 16, 2026
70602f6
Float and int datatypes
itsafuu Feb 16, 2026
dba7760
Mat2 implementation, updated claude.md
itsafuu Feb 17, 2026
ac2ca4a
Mat3 implementation
itsafuu Feb 17, 2026
b2540ac
Mat4 implementation
itsafuu Feb 17, 2026
2539f95
Adds tensor datatype
itsafuu Feb 17, 2026
e98ef8b
Added texture cube type
itsafuu Feb 17, 2026
01eb859
Vec2 support
itsafuu Feb 17, 2026
f1ab917
Vec3 support and vec2 fixes
itsafuu Feb 17, 2026
8ac66bf
Vec4 support
itsafuu Feb 17, 2026
67b1c52
Update without texture arrays as we can already make those with multi…
itsafuu Feb 17, 2026
deaff7f
Switch to arm linux self hosted
itsafuu Feb 23, 2026
3743862
Updating to use snappy for SuperGenius rocksdb compression and rlpx c…
Super-Genius Mar 11, 2026
0e91585
adding rlp as submodule
Super-Genius Mar 18, 2026
3f59a6c
Deleted unused `mp_utils`
EduMenges Mar 18, 2026
628c16d
Added mnemonic address derivation
EduMenges Mar 18, 2026
1bbf2b9
Reduced warnings
EduMenges Mar 19, 2026
a5e8d53
Merge pull request #247 from GeniusVentures:dev_mnemonics
henriqueaklein Mar 19, 2026
9a6903d
Fixed random header inclusion
EduMenges Mar 12, 2026
2882b3e
Fixed log syntax
EduMenges Mar 12, 2026
2de1834
Changed gRPC to protobuf
EduMenges Mar 12, 2026
160f477
Fixed Windows builds
EduMenges Mar 13, 2026
6b83ace
Deleted unused `node` files
EduMenges Mar 13, 2026
908394a
Removed unused files
EduMenges Mar 13, 2026
61682bb
Removed empty lines on the beginning of files
EduMenges Mar 15, 2026
9535875
Fixed `zlib` for Windows
EduMenges Mar 15, 2026
2b00971
Deleted unused `mp_utils`
EduMenges Mar 18, 2026
1b7a7f4
Added mnemonic address derivation
EduMenges Mar 18, 2026
1d49fbf
updated version of rlp and trying to fix protobuf directory
Super-Genius Mar 18, 2026
67b4bf6
update rlp ref-id
Super-Genius Mar 19, 2026
bf6fd30
External project version of rlp additions
itsafuu Mar 18, 2026
97b31b5
Subdirectory version
itsafuu Mar 18, 2026
3106c20
Updated build system to add rlp
Super-Genius Mar 19, 2026
0284ea4
Updating SGProcessingManager ref-id
Super-Genius Mar 19, 2026
8d9b295
Merge branch 'develop' into rlp_integration
Super-Genius Mar 19, 2026
6ff7b4c
Merge pull request #250 from GeniusVentures/rlp_integration
Super-Genius Mar 20, 2026
024f82c
Added account generation from random mnemonic if no previous address was
EduMenges Mar 20, 2026
ec28551
Merge pull request #248 from GeniusVentures:remove-warnings
henriqueaklein Mar 20, 2026
2da69e2
Feat: Creating UTXO access methods in transactions
henriqueaklein Mar 19, 2026
a3106b5
Feat: Creating MintV2 transaction
henriqueaklein Mar 19, 2026
6e8d4dd
Feat: Integrating MintV2
henriqueaklein Mar 19, 2026
eed43df
Fix: Build errors
henriqueaklein Mar 19, 2026
d426771
Fix: Issues found on review
henriqueaklein Mar 20, 2026
a163d08
Merge pull request #249 from GeniusVentures/dev_fix_transaction_types
henriqueaklein Mar 20, 2026
7d982b9
Fixes from review
EduMenges Mar 23, 2026
814cd7d
updating build dependency injection into cmake files.
Super-Genius Mar 24, 2026
ffbb725
Merge pull request #252 from GeniusVentures/fix_account_startup
henriqueaklein Mar 24, 2026
58cfc5a
This should build and install all the submodules now
Super-Genius Mar 26, 2026
f19e71e
Using Boost's macros for outcome instead of libp2p's
EduMenges Mar 26, 2026
f5a4407
Do not broadcast during migration
itsafuu Mar 26, 2026
df2f7e4
Chore: Removed remaining warnings
henriqueaklein Mar 27, 2026
bd610b8
Merge develop
itsafuu Mar 27, 2026
635593f
Update sgprocmgr
itsafuu Mar 27, 2026
8120391
Update tests to handle running binary from different directories
itsafuu Mar 27, 2026
621d1d4
Update ref id for fix in SGProcessingManager
Super-Genius Mar 27, 2026
a479ecc
Fixed seg fault
EduMenges Mar 30, 2026
a2489d5
Merge remote-tracking branch 'origin/develop' into dev_proc_data_types
itsafuu Apr 1, 2026
e1fcc04
Merge pull request #256 from GeniusVentures/dev_proc_data_types
itsafuu Apr 1, 2026
26a4bde
Fix targets
itsafuu Apr 1, 2026
f91cbd6
Due to changes in commonbuildparameters protobuf .h files were not in…
itsafuu Apr 1, 2026
99ce84d
Fix nested include proofsystem directory
itsafuu Apr 1, 2026
c824c00
Some experimental java keystore helper compilation
itsafuu Feb 27, 2026
9735eec
Classloader now uses helper to load java instead of findclass for usa…
itsafuu Feb 27, 2026
8e65be7
Use keystorehelper java in src
itsafuu Mar 4, 2026
27333c9
Readme
itsafuu Mar 4, 2026
55ee747
Change linking of android and android log libs to avoid absolute paths
itsafuu Mar 9, 2026
d946ae3
Need android SDK download
itsafuu Apr 1, 2026
f3de8f0
Merge pull request #257 from GeniusVentures/dev_mergeandroid
itsafuu Apr 2, 2026
69d0f23
Updated libp2p
EduMenges Mar 31, 2026
1b72011
Fixed `multi_account_sync`
EduMenges Apr 1, 2026
884eb4c
Added sanitizer for MSVC and Windows version setting
EduMenges Apr 1, 2026
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
35 changes: 35 additions & 0 deletions .github/workflows/build-release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,39 @@ jobs:
- name: Add Android toolchain
if: ${{ matrix.target == 'Android' }}
run: |
# Setup Android SDK
ANDROID_SDK_ROOT="$HOME/android-sdk"

# Download command-line tools if not present
if [ ! -d "$ANDROID_SDK_ROOT/cmdline-tools/latest" ]; then
echo "Downloading Android command-line tools..."
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools"
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdline-tools.zip
unzip -q cmdline-tools.zip -d "$ANDROID_SDK_ROOT/cmdline-tools"
mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest"
rm cmdline-tools.zip
else
echo "Android command-line tools already exist"
fi

# Always accept licenses and install/update required SDK components
echo "Installing/updating Android SDK components..."
yes | "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --licenses || true
"$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" "platform-tools" "platforms;android-34" "build-tools;34.0.0"

# Set environment variables
echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
echo "$ANDROID_SDK_ROOT/platform-tools" >> $GITHUB_PATH
echo "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin" >> $GITHUB_PATH

# Verify SDK installation
echo "=== Android SDK Setup ==="
echo "ANDROID_HOME: $ANDROID_SDK_ROOT"
echo "SDK contents:"
ls -la "$ANDROID_SDK_ROOT"

# Download and setup Android NDK
NDK_VERSION="r27b"
NDK_DIR="$HOME/android-ndk-$NDK_VERSION"

Expand All @@ -308,6 +341,8 @@ jobs:
echo "Android NDK already exists at $NDK_DIR, skipping download"
fi

echo "ANDROID_HOME=$ANDROID_SDK_ROOT"
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
echo "ANDROID_NDK_HOME=$NDK_DIR" >> $GITHUB_ENV

rustup target add aarch64-linux-android
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,39 @@ jobs:
- name: Add Android toolchain
if: ${{ matrix.target == 'Android' }}
run: |
# Setup Android SDK
ANDROID_SDK_ROOT="$HOME/android-sdk"

# Download command-line tools if not present
if [ ! -d "$ANDROID_SDK_ROOT/cmdline-tools/latest" ]; then
echo "Downloading Android command-line tools..."
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools"
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdline-tools.zip
unzip -q cmdline-tools.zip -d "$ANDROID_SDK_ROOT/cmdline-tools"
mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest"
rm cmdline-tools.zip
else
echo "Android command-line tools already exist"
fi

# Always accept licenses and install/update required SDK components
echo "Installing/updating Android SDK components..."
yes | "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --licenses || true
"$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" "platform-tools" "platforms;android-34" "build-tools;34.0.0"

# Set environment variables
echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
echo "$ANDROID_SDK_ROOT/platform-tools" >> $GITHUB_PATH
echo "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin" >> $GITHUB_PATH

# Verify SDK installation
echo "=== Android SDK Setup ==="
echo "ANDROID_HOME: $ANDROID_SDK_ROOT"
echo "SDK contents:"
ls -la "$ANDROID_SDK_ROOT"

# Download and setup Android NDK
NDK_VERSION="r27b"
NDK_DIR="$HOME/android-ndk-$NDK_VERSION"

Expand All @@ -459,6 +492,8 @@ jobs:
rm ndk.zip
fi

echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
echo "ANDROID_NDK_HOME=$NDK_DIR" >> $GITHUB_ENV

rustup target add aarch64-linux-android
Expand Down
65 changes: 64 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,67 @@ CRDT.Datastore.TEST/
#Data files for deepseek test
example/BpeTokenizer/data/**/*.mnn
example/BpeTokenizer/data/**/*.mnn.weight
example/BpeTokenizer/data/**/*.json
example/BpeTokenizer/data/**/*.json

# Local environment / secrets — never commit
.env
.env.*
!.env.example
examples/.env
examples/.env.*
!examples/.env.example

# Build outputs
build/

# macOS
.DS_Store

# Test log files
/tmp/eth_watch_*.log
examples/*.log

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# github copilot
.idea/**/copilot*
# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# CMake
cmake-build-*/

# File-based project format
*.iws

# IntelliJ
out/

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### CLion+iml Patch ###
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
[submodule "docs"]
path = docs
url = ../sg-docs
[submodule "evmrelay"]
path = evmrelay
url = ../evmrelay
9 changes: 7 additions & 2 deletions AgentDocs/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,15 @@ Your default mode is “tiny, surgical insertion into existing code”.
- Always run the linter before committing.
- Always run the formatter before committing.
- Always run the build before committing.
- Always run in interactive mode with the user on a step by step basis
- Always run in interactive mode with the user on a step-by-step basis
- Always look in AgentDocs for other instructions.
- The files can include SPRINT_PLAN.md, Architecture.md, CHECKPOINT.md, AGENT_MISTAKES.md

- Always look in AgentDocs for other instructions.
- The files can include SPRINT_PLAN.md, Architecture.md, CHECKPOINT.md, AGENT_MISTAKES.md
- Always make sure to only use C++17 features and below.
- For instance boost::coroutines only work in C++20, do NOT use it.
- Make sure not to use other C++ versions' features above C++17

## Build Commands

> **See `README.md` → "Building the Project" for the full authoritative build instructions.**
Expand Down
2 changes: 1 addition & 1 deletion GeniusKDF
2 changes: 1 addition & 1 deletion SGProcessingManager
Submodule SGProcessingManager updated 51 files
+3 −2 CMakeLists.txt
+1 −1 build
+55 −43 cmake/CommonBuildParameters.cmake
+4 −4 cmake/functions.cmake
+375 −0 doc/processing-json-guide.md
+1 −1 generated/DataType.hpp
+2 −6 generated/Generators.hpp
+1 −1 generated/InputFormat.hpp
+1 −2 gnus-processing-schema.json
+15 −0 include/processingbase/ProcessingManager.hpp
+13 −4 include/processors/processing_processor.hpp
+5 −4 include/processors/processing_processor_mnn_audio.hpp
+31 −0 include/processors/processing_processor_mnn_bool.hpp
+31 −0 include/processors/processing_processor_mnn_buffer.hpp
+31 −0 include/processors/processing_processor_mnn_float.hpp
+5 −4 include/processors/processing_processor_mnn_image.hpp
+31 −0 include/processors/processing_processor_mnn_int.hpp
+31 −0 include/processors/processing_processor_mnn_mat2.hpp
+31 −0 include/processors/processing_processor_mnn_mat3.hpp
+31 −0 include/processors/processing_processor_mnn_mat4.hpp
+5 −4 include/processors/processing_processor_mnn_ml.hpp
+56 −0 include/processors/processing_processor_mnn_string.hpp
+31 −0 include/processors/processing_processor_mnn_tensor.hpp
+31 −0 include/processors/processing_processor_mnn_texture1d.hpp
+34 −0 include/processors/processing_processor_mnn_texturecube.hpp
+30 −0 include/processors/processing_processor_mnn_vec2.hpp
+30 −0 include/processors/processing_processor_mnn_vec3.hpp
+30 −0 include/processors/processing_processor_mnn_vec4.hpp
+60 −0 include/processors/processing_processor_mnn_volume.hpp
+0 −1 src/processingbase/CMakeLists.txt
+532 −12 src/processingbase/ProcessingManager.cpp
+31 −0 src/processors/CMakeLists.txt
+9 −5 src/processors/processing_processor_mnn_audio.cpp
+466 −0 src/processors/processing_processor_mnn_bool.cpp
+397 −0 src/processors/processing_processor_mnn_buffer.cpp
+375 −0 src/processors/processing_processor_mnn_float.cpp
+10 −6 src/processors/processing_processor_mnn_image.cpp
+341 −0 src/processors/processing_processor_mnn_int.cpp
+404 −0 src/processors/processing_processor_mnn_mat2.cpp
+404 −0 src/processors/processing_processor_mnn_mat3.cpp
+404 −0 src/processors/processing_processor_mnn_mat4.cpp
+9 −5 src/processors/processing_processor_mnn_ml.cpp
+259 −0 src/processors/processing_processor_mnn_string.cpp
+427 −0 src/processors/processing_processor_mnn_tensor.cpp
+539 −0 src/processors/processing_processor_mnn_texture1d.cpp
+584 −0 src/processors/processing_processor_mnn_texturecube.cpp
+434 −0 src/processors/processing_processor_mnn_vec2.cpp
+434 −0 src/processors/processing_processor_mnn_vec3.cpp
+434 −0 src/processors/processing_processor_mnn_vec4.cpp
+661 −0 src/processors/processing_processor_mnn_volume.cpp
+2 −1 src/util/CMakeLists.txt
10 changes: 8 additions & 2 deletions build/Android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ set(PROTOC_EXECUTABLE "${_THIRDPARTY_BUILD_DIR}/protobuf_host/bin/protoc${CMAKE_

set(TESTING OFF)

find_library(log-lib log)
find_library(android-lib android)
add_library(android::log INTERFACE IMPORTED GLOBAL)
set_target_properties(android::log PROPERTIES IMPORTED_LIBNAME "log")

add_library(android::android INTERFACE IMPORTED GLOBAL)
set_target_properties(android::android PROPERTIES IMPORTED_LIBNAME "android")

# Include common build parameters
include(../CommonBuildParameters.cmake)

# Add Android AAR build for secure storage
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/securestorage ${CMAKE_BINARY_DIR}/android_aar)
18 changes: 18 additions & 0 deletions build/Android/securestorage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Gradle build outputs
.gradle/
build/
library/build/

# Gradle wrapper (download on demand)
.gradle-wrapper.jar
gradlew
gradlew.bat
gradle/

# Local configuration
local.properties

# IDE files
.idea/
*.iml
.DS_Store
33 changes: 33 additions & 0 deletions build/Android/securestorage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Android AAR build for KeyStoreHelper
cmake_minimum_required(VERSION 3.22)

# Check if Gradle wrapper exists, if not, set it up
set(GRADLEW_PATH "${CMAKE_CURRENT_SOURCE_DIR}/gradlew")
if(NOT EXISTS "${GRADLEW_PATH}")
message(STATUS "Gradle wrapper not found, running setup script...")
execute_process(
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/setup-gradle-wrapper.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE SETUP_RESULT
)
if(NOT SETUP_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to set up Gradle wrapper. Please check your internet connection.")
endif()
message(STATUS "Gradle wrapper setup complete")
endif()

# Custom target to build the AAR using Gradle
add_custom_target(build_android_aar ALL
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gradlew :library:assembleRelease
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Building securestorage AAR with Gradle"
BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/library/build/outputs/aar/library-release.aar
)

# Install the AAR to the installation directory
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/library/build/outputs/aar/library-release.aar
DESTINATION lib/android
RENAME securestorage-release.aar
OPTIONAL
)
78 changes: 78 additions & 0 deletions build/Android/securestorage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Android Secure Storage AAR

This directory contains the Android Gradle project for building the SuperGenius secure storage AAR.

## Overview

The AAR contains:
- `ai.gnus.sdk.KeyStoreHelper` - Java class providing secure key storage using Android KeyStore

**Source Location**: The Java source is maintained in `src/local_secure_storage/impl/KeyStoreHelper.java` and referenced by the Gradle build. This ensures a single source of truth alongside the C++ implementation.

## Building

### Via CMake (Recommended)
When building the Android version of SuperGenius, the AAR will be built automatically during `make`:

```bash
cd build/OSX
mkdir -p Android && cd Android
cmake ../.. \
-DCMAKE_ANDROID_NDK=/path/to/ndk \
-DANDROID_ABI=arm64-v8a \
-DCMAKE_BUILD_TYPE=Release
make
make install
```

The Gradle wrapper will be set up automatically if needed during the CMake configure step.
The AAR will be built during `make` and installed to `${CMAKE_INSTALL_PREFIX}/lib/android/securestorage-release.aar` during `make install`.

### Via Gradle Directly
You can also build the AAR directly using Gradle:

```bash
cd build/Android/securestorage
./gradlew :library:assembleRelease
```

Output: `build/Android/securestorage/library/build/outputs/aar/library-release.aar`

## Usage in Unity/GeniusSDK

1. Include the AAR in your Unity project's `Assets/Plugins/Android/` directory
2. Include your SDK `.so` file in `Assets/Plugins/Android/libs/[ABI]/`
3. Initialize KeyStoreHelper before using native secure storage:

```java
import ai.gnus.sdk.KeyStoreHelper;

public class YourUnityActivity extends UnityPlayerActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// This must be called AFTER the native SDK .so is loaded
// It caches the class reference using the app's ClassLoader
KeyStoreHelper.initialize(this);
}
}
```

**Important**: The AAR's `nativeInit` method is implemented in your SDK's `.so` file. Make sure Unity loads the native library before calling `KeyStoreHelper.initialize()`.

## JNI Contract

The C++ code in `src/local_secure_storage/impl/Android.cpp`:
- Implements: `Java_ai_gnus_sdk_KeyStoreHelper_nativeInit` - Caches class reference using app ClassLoader
- Calls these static Java methods:
- `ai.gnus.sdk.KeyStoreHelper.load()Ljava/lang/String;`
- `ai.gnus.sdk.KeyStoreHelper.save(Ljava/lang/String;)Z`
- `ai.gnus.sdk.KeyStoreHelper.delete(Ljava/lang/String;)Z`

**ClassLoader Fix**: The native code now uses the app's ClassLoader (via the Context passed to `initialize()`) instead of the system ClassLoader, which fixes crashes when secure storage is accessed from worker threads.

## Requirements

- Android SDK 33
- Min SDK 28 (Android 9.0)
- Gradle 8.1+
21 changes: 21 additions & 0 deletions build/Android/securestorage/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Top-level build file
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.0'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
4 changes: 4 additions & 0 deletions build/Android/securestorage/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Project-wide Gradle settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=false
Loading
Loading