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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
contracts/contracts/RegisterASCII.txt
sdk/.env
.DS_Store
# Exception: Include mobile-sdk-alpha AAR files
!packages/mobile-sdk-alpha/dist/android/*.aar
dist
**/node_modules
**/node_modules/
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "packages/mobile-sdk-alpha/mobile-sdk-native"]
path = packages/mobile-sdk-alpha/mobile-sdk-native
url = [email protected]:selfxyz/mobile-sdk-native.git
branch = main
2 changes: 2 additions & 0 deletions app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ include ':react-native-passport-reader'
project(':react-native-passport-reader').projectDir = new File(rootProject.projectDir, './react-native-passport-reader/android')
include ':passportreader'
project(':passportreader').projectDir = new File(rootProject.projectDir, './android-passport-nfc-reader/app')
include ':mobile-sdk-alpha'
project(':mobile-sdk-alpha').projectDir = new File(rootProject.projectDir, '../../packages/mobile-sdk-alpha/android')
6 changes: 6 additions & 0 deletions packages/mobile-sdk-alpha/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,9 @@ yarn-error.log

# Maestro
maestro-results.xml

# Exception: Include AAR files in dist/android/
!dist/android/*.aar

android/src
android/libs
16 changes: 16 additions & 0 deletions packages/mobile-sdk-alpha/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
# SPDX-License-Identifier: BUSL-1.1
# NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

android/src/
android/build.gradle.source
android/gradle.properties
android/proguard-rules.pro
android/libs/

# Exclude build artifacts
android/build/

# Keep only:
# - android/build.gradle (prebuilt wrapper)
# - dist/android/*.aar (prebuilt AAR files)
28 changes: 28 additions & 0 deletions packages/mobile-sdk-alpha/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ allprojects {
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
// When building from SDK: ../../../node_modules
// $rootDir is packages/mobile-sdk-alpha/android
url("$rootDir/../../../node_modules/react-native/android")
}
maven {
Expand Down Expand Up @@ -64,6 +66,16 @@ android {
}
}

// Configure AAR generation for split AAB support
splits {
abi {
enable true
reset()
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
universalApk false
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -153,6 +165,22 @@ dependencies {
implementation 'com.google.guava:guava:31.1-android'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'com.google.android.material:material:1.9.0'

implementation 'com.github.mhshams:jnbis:2.0.2'
}


// Task to copy AAR files to dist directory for prebuilt distribution
task copyAarToDist(type: Copy) {
from 'build/outputs/aar'
into '../dist/android'
include '*.aar'
}

// Ensure AAR is copied after assembleRelease
afterEvaluate {
tasks.named('assembleRelease').configure {
finalizedBy copyAarToDist
}
}
186 changes: 186 additions & 0 deletions packages/mobile-sdk-alpha/android/build.gradle.source
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 23
compileSdkVersion = 35
targetSdkVersion = 35
ndkVersion = "27.0.12077973"
kotlinVersion = "1.9.24"
}
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.0")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
// When building from SDK: ../../../node_modules
// $rootDir is packages/mobile-sdk-alpha/android
url("$rootDir/../../../node_modules/react-native/android")
}
maven {
url("$rootDir/../../../node_modules/jsc-android/dist")
}
}
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
substitute(platform(module('com.gemalto.jp2:jp2-android'))) using module('com.github.Tgo1014:JP2ForAndroid:1.0.4')
}
resolutionStrategy.force 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
ndkVersion rootProject.ext.ndkVersion

namespace "com.selfxyz.selfSDK"

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

// Configure AAR generation for split AAB support
splits {
abi {
enable true
reset()
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
universalApk false
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
// sourceCompatibility JavaVersion.VERSION_17
// targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
// jvmTarget = '1.8'
}

lintOptions {
abortOnError false
}

sourceSets {
main {
java.srcDirs = ['src/main/java']
res.srcDirs = ['src/main/res']
}
}

buildFeatures {
viewBinding true
}

packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
exclude 'META-INF/androidx.exifinterface_exifinterface.version'
pickFirst '**/libc++_shared.so'
pickFirst '**/libjsc.so'
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

// React Native
implementation 'com.facebook.react:react-native:+'

// NFC and Passport Reading dependencies
// implementation 'org.jmrtd:jmrtd:1.7.4'
implementation 'org.jmrtd:jmrtd:0.7.35'

implementation 'net.sf.scuba:scuba-sc-android:0.0.23'

// Bouncy Castle for cryptography
implementation 'org.bouncycastle:bcprov-jdk18on:1.78.1'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.78.1'

// Commons IO for utilities
implementation 'commons-io:commons-io:2.11.0'

// OkHttp for network operations
implementation 'com.squareup.okhttp3:okhttp:4.12.0'

// Gson for JSON handling
implementation 'com.google.code.gson:gson:2.10.1'

implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.2'
implementation "com.github.fotoapparat:fotoapparat:2.7.0"

implementation 'androidx.multidex:multidex:2.0.1'

// RxJava dependencies
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

// React Native dependencies
implementation 'com.facebook.react:react-android'
implementation 'com.facebook.react:react-native:+'

// MLKit dependencies
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.2'
implementation 'com.google.mlkit:text-recognition:16.0.0'

// Camera dependencies
implementation "androidx.camera:camera-core:1.3.2"
implementation "androidx.camera:camera-camera2:1.3.2"
implementation "androidx.camera:camera-lifecycle:1.3.2"
implementation "androidx.camera:camera-view:1.3.2"

// Utility dependencies
implementation 'com.google.guava:guava:31.1-android'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'com.google.android.material:material:1.9.0'

implementation 'com.github.mhshams:jnbis:2.0.2'
}


// Task to copy AAR files to dist directory for prebuilt distribution
task copyAarToDist(type: Copy) {
from 'build/outputs/aar'
into '../dist/android'
include '*.aar'
}

// Ensure AAR is copied after assembleRelease
afterEvaluate {
tasks.named('assembleRelease').configure {
finalizedBy copyAarToDist
}
}
Binary file not shown.
64 changes: 64 additions & 0 deletions packages/mobile-sdk-alpha/android/mobile-sdk-alpha-bom.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

// Mobile SDK Alpha - Bill of Materials (BOM)
// This file provides all required dependencies for the mobile-sdk-alpha AAR
// Usage: apply from: 'path/to/mobile-sdk-alpha-bom.gradle'

// Enable ViewBinding in the consuming app
android {
buildFeatures {
viewBinding true
}
}

dependencies {
// Mobile SDK Alpha AAR
// Detect if we're in monorepo or published package
def sdkRoot = file("$projectDir/../../../mobile-sdk-alpha").exists() ?
"$projectDir/../../../mobile-sdk-alpha" : // Monorepo (workspace dependency)
"$projectDir/../../node_modules/@selfxyz/mobile-sdk-alpha" // Published package

implementation files("${sdkRoot}/dist/android/mobile-sdk-alpha-release.aar")

// All required dependencies for mobile-sdk-alpha AAR

// Core JMRTD library for passport reading
implementation 'org.jmrtd:jmrtd:0.7.35'
implementation 'net.sf.scuba:scuba-sc-android:0.0.23'

// Cryptography libraries
implementation 'org.bouncycastle:bcprov-jdk18on:1.78.1'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.78.1'

// Utility libraries
implementation 'commons-io:commons-io:2.11.0'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.google.code.gson:gson:2.10.1'

// ML Kit for text recognition
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.2'
implementation 'com.google.mlkit:text-recognition:16.0.0'

// Camera functionality
implementation "com.github.fotoapparat:fotoapparat:2.7.0"
implementation "androidx.camera:camera-core:1.3.2"
implementation "androidx.camera:camera-camera2:1.3.2"
implementation "androidx.camera:camera-lifecycle:1.3.2"
implementation "androidx.camera:camera-view:1.3.2"

// Android support libraries
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'com.google.android.material:material:1.9.0'

// Reactive programming
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

// Additional utilities
implementation 'com.google.guava:guava:31.1-android'
implementation 'com.github.mhshams:jnbis:2.0.2'
}
23 changes: 0 additions & 23 deletions packages/mobile-sdk-alpha/android/src/main/AndroidManifest.xml

This file was deleted.

Binary file not shown.
Loading
Loading