Skip to content

Commit

Permalink
Merge pull request #1 from iden3/0.0.1-alpha.1
Browse files Browse the repository at this point in the history
0.0.1 alpha.1
  • Loading branch information
5eeman authored Jun 25, 2024
2 parents ce4e5f2 + faf14c4 commit 53b7f82
Show file tree
Hide file tree
Showing 29 changed files with 291 additions and 103 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
.externalNativeBuild
.cxx
local.properties

github.properties
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Reads .zkey file directly from filesystem.


```Kotlin
import com.iden3.rapidsnark.*
import io.iden3.rapidsnark.*

// ...

Expand All @@ -41,7 +41,7 @@ val (proof, publicSignals) = groth16ProveWithZKeyFilePath("path/to/zkey", wtns)
Verifies proof and public signals against verification key.

```Kotlin
import com.iden3.rapidsnark.*
import io.iden3.rapidsnark.*

// ...

Expand All @@ -63,7 +63,7 @@ Function that takes zkey and witness files encoded as base64.
>Large circuits might cause OOM. Use with caution.
```Kotlin
import com.iden3.rapidsnark.*
import io.iden3.rapidsnark.*

// ...

Expand All @@ -77,7 +77,7 @@ val (proof, publicSignals) = groth16Prove(zkey, wtns)
Calculates public buffer size for specified zkey.

```Kotlin
import com.iden3.rapidsnark.*
import io.iden3.rapidsnark.*

// ...

Expand Down
15 changes: 12 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ plugins {
id("org.jetbrains.kotlin.android")
}

repositories {
google()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/iden3/android-rapidsnark")
}
}

android {
namespace = "com.example.rapidsnark_example"
namespace = "com.example.android_rapidsnark"
compileSdk = 34

defaultConfig {
applicationId = "com.example.rapidsnark_example"
applicationId = "com.example.android_rapidsnark"
minSdk = 24
targetSdk = 34
versionCode = 1
Expand Down Expand Up @@ -47,7 +56,7 @@ android {
}

dependencies {
implementation(project(":rapidsnark_android"))
implementation("io.iden3:rapidsnark:0.0.1-alpha.1")

implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Rapidsnark_example"
android:theme="@style/Theme.android_rapidsnark"
tools:targetApi="31">
<activity
android:name="com.example.rapidsnark_example.MainActivity"
android:name="com.example.android_rapidsnark.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Rapidsnark_example">
android:theme="@style/Theme.android_rapidsnark">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/com/example/rapidsnark_example/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.rapidsnark_example
package com.example.android_rapidsnark

import android.content.ClipData
import android.content.ClipboardManager
Expand Down Expand Up @@ -29,20 +29,22 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.rapidsnark_example.ui.theme.Rapidsnark_exampleTheme
import com.iden3.rapidsnark.*
import com.example.android_rapidsnark.ui.theme.android_rapidsnarkTheme

import java.io.ByteArrayOutputStream
import java.io.File
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream

import io.iden3.rapidsnark.*


class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Rapidsnark_exampleTheme {
android_rapidsnarkTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
Expand Down Expand Up @@ -119,7 +121,7 @@ fun Greeting() {
@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
Rapidsnark_exampleTheme {
android_rapidsnarkTheme {
Greeting()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.rapidsnark_example.ui.theme
package com.example.android_rapidsnark.ui.theme

import androidx.compose.ui.graphics.Color

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.rapidsnark_example.ui.theme
package com.example.android_rapidsnark.ui.theme

import android.app.Activity
import android.os.Build
Expand Down Expand Up @@ -38,7 +38,7 @@ private val LightColorScheme = lightColorScheme(
)

@Composable
fun Rapidsnark_exampleTheme(
fun android_rapidsnarkTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.rapidsnark_example.ui.theme
package com.example.android_rapidsnark.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">rapidsnark_example</string>
<string name="app_name">android_rapidsnark</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.Rapidsnark_example" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Theme.android_rapidsnark" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ plugins {
id("com.android.application") version "8.2.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
id("com.android.library") version "8.2.1" apply false
`maven-publish`
}
24 changes: 23 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,26 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true

VERSION_NAME=0.0.1-alpha.1
VERSION_CODE=1
GROUP=io.iden3

POM_DESCRIPTION=This library is Android Kotlin wrapper for the [Rapidsnark](https://github.com/iden3/rapidsnark). It enables the generation of proofs for specified circuits within an Android environment.
POM_URL=https://github.com/iden3/android-rapidsnark
POM_SCM_URL=https://github.com/iden3/android-rapidsnark
POM_SCM_CONNECTION=scm:[email protected]:iden3/android-rapidsnark.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:iden3/android-rapidsnark.git
POM_LICENCE_NAME=GNU General Public License v3.0
POM_LICENCE_URL=https://github.com/iden3/android-rapidsnark/COPYING
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=<user id that is created on jira>
POM_DEVELOPER_NAME=<Developer Name>
POM_DEVELOPER_EMAIL=<Developer E-Mail Address>
ossrhUsername=''
ossrhPassword=''

signing.keyId=46C550A2
signing.password=somepassphrase
signing.secretKeyRingFile=/Users/moria/.gnupg/secring.gpg
File renamed without changes.
110 changes: 110 additions & 0 deletions rapidsnark/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
}

val githubProperties = Properties()
githubProperties.load(FileInputStream(rootProject.file("github.properties"))) //Set env variable GPR_USER & GPR_API_KEY if not adding a properties file

repositories {
google()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/iden3/android-rapidsnark")
credentials {
username = githubProperties.getProperty("gpr.user")
password = githubProperties.getProperty("gpr.key")
}
}
}

android {
namespace = "io.iden3.rapidsnark"
compileSdk = 34

defaultConfig {
minSdk = 24

consumerProguardFiles("consumer-rules.pro")

externalNativeBuild {
cmake {
cppFlags += "-O2 -frtti -fexceptions -Wall -fstack-protector-all"
abiFilters += listOf("x86_64", "arm64-v8a")
}
}
ndk {
//noinspection ChromeOsAbiSupport
abiFilters += listOf("x86_64", "arm64-v8a")
}
}

sourceSets {
getByName("main") {
java.srcDir("src/main/java")
jniLibs.srcDir("src/main/libs")
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}

publishing {
singleVariant("release") {
withJavadocJar()
withSourcesJar()
}
}
}

dependencies {
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.appcompat:appcompat:1.6.1")
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "io.iden3"
artifactId = "rapidsnark"
version = "0.0.1-alpha.1"
artifact("$buildDir/outputs/aar/rapidsnark-release.aar")
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/iden3/android-rapidsnark")
credentials {
username = githubProperties.getProperty("gpr.user")
password = githubProperties.getProperty("gpr.key")
}
}
}
}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 53b7f82

Please sign in to comment.