Skip to content

Commit

Permalink
chore/update-android-12
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamol authored and godenzim committed Oct 25, 2021
1 parent 32ed4bc commit 43ce0b8
Show file tree
Hide file tree
Showing 37 changed files with 764 additions and 852 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 31
defaultConfig {
applicationId "it.airgap.wallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 31
versionCode 1
versionName "0.0.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand Down
11 changes: 10 additions & 1 deletion android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ android {

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {

implementation project(':capacitor-app')
implementation project(':capacitor-app-launcher')
implementation project(':capacitor-browser')
implementation project(':capacitor-clipboard')
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-push-notifications')
implementation project(':capacitor-share')
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation "androidx.legacy:legacy-support-v4:1.+"
implementation "androidx.appcompat:appcompat:1.+"
}
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:screenOrientation="portrait"
android:exported="true"
android:launchMode="singleTask">

<intent-filter>
Expand Down
38 changes: 18 additions & 20 deletions android/app/src/main/assets/capacitor.config.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
{
"appId": "it.airgap.wallet",
"appName": "AirGap Wallet",
"bundledWebRuntime": false,
"npmClient": "npm",
"webDir": "www",
"plugins": {
"PushNotifications": {
"presentationOptions": ["alert"]
},
"SplashScreen": {
"launchAutoHide": false,
"androidSplashResourceName": "screen"
}
},
"android": {
"allowMixedContent": true
},
"ios": {
"cordovaSwiftVersion": "5.0"
}
"appId": "it.airgap.wallet",
"appName": "AirGap Wallet",
"bundledWebRuntime": false,
"webDir": "www",
"plugins": {
"PushNotifications": {
"presentationOptions": [
"alert"
]
},
"SplashScreen": {
"launchAutoHide": false,
"androidSplashResourceName": "screen"
}
},
"android": {
"allowMixedContent": true
}
}
42 changes: 42 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"pkg": "@capacitor/app",
"classpath": "com.capacitorjs.plugins.app.AppPlugin"
},
{
"pkg": "@capacitor/app-launcher",
"classpath": "com.capacitorjs.plugins.applauncher.AppLauncherPlugin"
},
{
"pkg": "@capacitor/browser",
"classpath": "com.capacitorjs.plugins.browser.BrowserPlugin"
},
{
"pkg": "@capacitor/clipboard",
"classpath": "com.capacitorjs.plugins.clipboard.ClipboardPlugin"
},
{
"pkg": "@capacitor/haptics",
"classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin"
},
{
"pkg": "@capacitor/keyboard",
"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
},
{
"pkg": "@capacitor/push-notifications",
"classpath": "com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin"
},
{
"pkg": "@capacitor/share",
"classpath": "com.capacitorjs.plugins.share.SharePlugin"
},
{
"pkg": "@capacitor/splash-screen",
"classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin"
},
{
"pkg": "@capacitor/status-bar",
"classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin"
}
]
9 changes: 2 additions & 7 deletions android/app/src/main/java/it/airgap/wallet/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ public class MainActivity extends BridgeActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(AppInfo.class);
add(SaplingNative.class);
}});
registerPlugin(AppInfo.class);
registerPlugin(SaplingNative.class);
}
}
4 changes: 2 additions & 2 deletions android/app/src/main/java/it/airgap/wallet/plugin/AppInfo.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package it.airgap.wallet.plugin

import com.getcapacitor.NativePlugin
import com.getcapacitor.Plugin
import com.getcapacitor.PluginCall
import com.getcapacitor.PluginMethod
import com.getcapacitor.annotation.CapacitorPlugin
import it.airgap.wallet.BuildConfig
import it.airgap.wallet.util.applicationContext
import it.airgap.wallet.util.resolveWithData

@NativePlugin
@CapacitorPlugin
class AppInfo : Plugin() {

@PluginMethod
Expand Down
26 changes: 13 additions & 13 deletions android/app/src/main/java/it/airgap/wallet/plugin/SaplingNative.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package it.airgap.wallet.plugin

import com.getcapacitor.NativePlugin
import com.getcapacitor.Plugin
import com.getcapacitor.PluginCall
import com.getcapacitor.PluginMethod
import com.getcapacitor.annotation.CapacitorPlugin
import it.airgap.sapling.Sapling
import it.airgap.wallet.util.*
import kotlin.concurrent.thread

@NativePlugin
@CapacitorPlugin
class SaplingNative : Plugin() {
private val sapling: Sapling by lazy { Sapling() }

Expand Down Expand Up @@ -115,37 +115,37 @@ class SaplingNative : Plugin() {
}

private val PluginCall.context: Long
get() = getString(Param.CONTEXT).toLong()
get() = getString(Param.CONTEXT)!!.toLong()

private val PluginCall.spendingKey: ByteArray
get() = getString(Param.SPENDING_KEY).asByteArray()
get() = getString(Param.SPENDING_KEY)!!.asByteArray()

private val PluginCall.address: ByteArray
get() = getString(Param.ADDRESS).asByteArray()
get() = getString(Param.ADDRESS)!!.asByteArray()

private val PluginCall.rcm: ByteArray
get() = getString(Param.RCM).asByteArray()
get() = getString(Param.RCM)!!.asByteArray()

private val PluginCall.ar: ByteArray
get() = getString(Param.AR).asByteArray()
get() = getString(Param.AR)!!.asByteArray()

private val PluginCall.esk: ByteArray
get() = getString(Param.ESK).asByteArray()
get() = getString(Param.ESK)!!.asByteArray()

private val PluginCall.value: Long
get() = getString(Param.VALUE).toLong()
get() = getString(Param.VALUE)!!.toLong()

private val PluginCall.root: ByteArray
get() = getString(Param.ROOT).asByteArray()
get() = getString(Param.ROOT)!!.asByteArray()

private val PluginCall.merklePath: ByteArray
get() = getString(Param.MERKLE_PATH).asByteArray()
get() = getString(Param.MERKLE_PATH)!!.asByteArray()

private val PluginCall.balance: Long
get() = getString(Param.BALANCE).toLong()
get() = getString(Param.BALANCE)!!.toLong()

private val PluginCall.sighash: ByteArray
get() = getString(Param.SIGHASH).asByteArray()
get() = getString(Param.SIGHASH)!!.asByteArray()

private object Param {
const val CONTEXT = "context"
Expand Down
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.5.31'

repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -22,7 +22,7 @@ apply from: "variables.gradle"
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Expand Down
30 changes: 30 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')

include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')

include ':capacitor-app-launcher'
project(':capacitor-app-launcher').projectDir = new File('../node_modules/@capacitor/app-launcher/android')

include ':capacitor-browser'
project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/browser/android')

include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android')

include ':capacitor-haptics'
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')

include ':capacitor-keyboard'
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')

include ':capacitor-push-notifications'
project(':capacitor-push-notifications').projectDir = new File('../node_modules/@capacitor/push-notifications/android')

include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android')

include ':capacitor-splash-screen'
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')

include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
8 changes: 4 additions & 4 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Tue Sep 22 13:19:24 CEST 2020
#Wed Oct 20 12:28:59 CEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionSha256Sum=10065868c78f1207afb3a92176f99a37d753a513dff453abb6b5cceda4058cda
zipStoreBase=GRADLE_USER_HOME
distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b
22 changes: 11 additions & 11 deletions android/variables.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ ext {
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
androidxAppCompatVersion = '1.2.0'
androidxCoreVersion = '1.2.0'
androidxMaterialVersion = '1.1.0-rc02'
androidxBrowserVersion = '1.2.0'
androidxLocalbroadcastmanagerVersion = '1.0.0'
firebaseMessagingVersion = '20.1.2'
playServicesLocationVersion = '17.0.0'
junitVersion = '4.13'
androidxTestCoreVersion = '1.2.0'
androidxJunitVersion = '1.1.1'
androidxEspressoCoreVersion = '3.2.0'
androidxActivityVersion = '1.2.0'
androidxAppCompatVersion = '1.3.1'
androidxBrowserVersion = '1.3.0'
androidxCoordinatorLayoutVersion = '1.1.0'
androidxCoreVersion = '1.3.2'
androidxFragmentVersion = '1.3.0'
firebaseMessagingVersion = '21.0.1'
junitVersion = '4.13.2'
androidxTestCoreVersion = '1.4.0'
androidxJunitVersion = '1.1.3'
androidxEspressoCoreVersion = '3.4.0'
cordovaAndroidVersion = '7.0.0'
}
2 changes: 1 addition & 1 deletion build/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN mkdir /app
WORKDIR /app

# using npm 6.5.0 to fix installing certain cordova/ionic plugins
RUN npm install -g [email protected] [email protected] @capacitor/core@2.4.0 @capacitor/[email protected] @capacitor/cli@2.4.0
RUN npm install -g [email protected] [email protected] @capacitor/core@3.2.5 @capacitor/[email protected] @capacitor/cli@3.2.5
RUN npm cache clean -f
RUN npm install -g n
RUN n 15.14.0
Expand Down
22 changes: 0 additions & 22 deletions capacitor.config.json

This file was deleted.

22 changes: 22 additions & 0 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { CapacitorConfig } from '@capacitor/cli'

const config: CapacitorConfig = {
appId: "it.airgap.wallet",
appName: "AirGap Wallet",
bundledWebRuntime: false,
webDir: "www",
plugins: {
PushNotifications: {
presentationOptions: ["alert"]
},
SplashScreen: {
launchAutoHide: false,
androidSplashResourceName: "screen"
}
},
android: {
allowMixedContent: true
}
}

export default config
3 changes: 2 additions & 1 deletion ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

App/build
App/Pods
App/public
App/App/public
App/Podfile.lock
DerivedData
xcuserdata

# Cordova plugins for Capacitor
Expand Down
Loading

0 comments on commit 43ce0b8

Please sign in to comment.