Skip to content

Commit fe16f82

Browse files
JavonneMart-shen
authored andcommitted
Fixed sample app for 0.9.8
1 parent 2d9c735 commit fe16f82

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
'minSdk' : 14,
1010
'compileSdk' : 28,
1111
'buildTools' : '28.0.3',
12-
'androidPlugin' : '3.4.0',
12+
'androidPlugin' : '4.0.0',
1313

1414
androidx_app_compat : '1.0.2',
1515
androidx_card_view : '1.0.0',
@@ -28,14 +28,18 @@ buildscript {
2828
'gradlePlugin': "com.android.tools.build:gradle:${versions.androidPlugin}",
2929
]
3030
]
31+
versions.kotlin = '1.3.72'
3132
}
3233

3334
repositories {
35+
google()
36+
jcenter()
3437
gradlePluginPortal()
35-
mavenCentral()
38+
mavenCentral()
3639
}
3740

3841
dependencies {
42+
classpath 'com.android.tools.build:gradle:4.0.0'
3943
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
4044
classpath 'com.github.ben-manes:gradle-versions-plugin:0.38.0'
4145
// How can we move this to the sample folder

lib/src/main/kotlin/org/walletconnect/Session.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ interface Session {
3535
val key: String,
3636
val protocol: String = "wc",
3737
val version: Int = 1
38-
)
38+
) {
39+
fun toWCUri() = "wc:$handshakeTopic@$version?bridge=${URLEncoder.encode(bridge, "UTF-8")}&key=$key"
40+
}
3941

4042
data class Config(
4143
val handshakeTopic: String,

sample/app/gradle.properties

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## For more details on how to configure your build environment visit
2+
# http://www.gradle.org/docs/current/userguide/build_environment.html
3+
#
4+
# Specifies the JVM arguments used for the daemon process.
5+
# The setting is particularly useful for tweaking memory settings.
6+
# Default value: -Xmx1024m -XX:MaxPermSize=256m
7+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
8+
#
9+
# When configured, Gradle will run in incubating parallel mode.
10+
# This option should only be used with decoupled projects. More details, visit
11+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
12+
# org.gradle.parallel=true
13+
#Fri May 21 10:30:53 SAST 2021
14+
android.enableJetifier=true
15+
android.useAndroidX=true

sample/app/src/main/java/io/walletconnect/example/ExampleApplication.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ class ExampleApplication : MultiDexApplication() {
4343
private lateinit var moshi: Moshi
4444
private lateinit var bridge: BridgeServer
4545
private lateinit var storage: WCSessionStore
46-
lateinit var config: Session.Config
46+
lateinit var config: Session.FullyQualifiedConfig
4747
lateinit var session: Session
4848

4949
fun resetSession() {
5050
nullOnThrow { session }?.clearCallbacks()
5151
val key = ByteArray(32).also { Random().nextBytes(it) }.toNoPrefixHexString()
52-
config = Session.Config(UUID.randomUUID().toString(), "http://localhost:${BridgeServer.PORT}", key)
52+
config = Session.FullyQualifiedConfig(UUID.randomUUID().toString(), "http://localhost:${BridgeServer.PORT}", key)
5353
session = WCSession(config,
5454
MoshiPayloadAdapter(moshi),
5555
storage,

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include ':lib' //, ':sample:app'
1+
include ':lib', ':sample:app'
22

0 commit comments

Comments
 (0)