Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Offline money app #146

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
ae3560a
added offline money app
AdiDumi Mar 8, 2023
b7ade06
revert to normal
AdiDumi Mar 10, 2023
610931b
added first basic app hello world
AdiDumi Mar 15, 2023
6b6dec7
change color and layour
AdiDumi Mar 15, 2023
5a5e524
styles added
AdiDumi Mar 15, 2023
f31b0ce
added navigation and fragments to app
AdiDumi Mar 17, 2023
eb7d06a
correct get button error
AdiDumi Mar 17, 2023
4e6e9b5
qr code scanner and add ammount to balance
Robert-ML Mar 17, 2023
79e59b0
Created QR encoder
Mar 17, 2023
fa6b163
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
Mar 17, 2023
2200400
Got QR encoding to work
Mar 17, 2023
ecbe168
add public key QR
AdiDumi Mar 18, 2023
8a7c668
initial push for request payload and promise payload
Robert-ML Mar 18, 2023
d91cf76
finished RequestPayload and Promise but not tested
Robert-ML Mar 18, 2023
c37d9a8
delete sending amount
AdiDumi Mar 18, 2023
f9cda99
Merge remote-tracking branch 'origin/adrians' into adrians
AdiDumi Mar 18, 2023
271b00c
added new page and promise
AdiDumi Mar 18, 2023
5e07c79
Changed from stand alone application to library and integrated into t…
Robert-ML Mar 19, 2023
cc74d05
Changed the defaultCryptoProvider to something global that probably i…
Robert-ML Mar 19, 2023
7df22be
clean code and added named fragments
AdiDumi Mar 19, 2023
c72d074
added navigation menu
AdiDumi Mar 19, 2023
d725b6f
added strings notations for constants
AdiDumi Mar 19, 2023
23606da
Made a logo for the offline money sub-app trial
Robert-ML Mar 19, 2023
111b290
change logic to token based app
AdiDumi Mar 22, 2023
2ea82b2
Merge remote-tracking branch 'origin/adrians' into adrians
AdiDumi Mar 22, 2023
6095d20
Token + Wallet
naklecha Mar 22, 2023
e83f935
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
naklecha Mar 22, 2023
cac3438
Added database files
Mar 22, 2023
b61a055
Merge pull request #1 from naklecha/adrians
naklecha Mar 22, 2023
9af9f39
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
Mar 22, 2023
148cc04
Revert "Merge branch 'adrians' of https://github.com/AdiDumi/trustcha…
Mar 22, 2023
57fe85b
Private Key in QR code
naklecha Mar 22, 2023
785d821
Revert "Revert "Merge branch 'adrians' of https://github.com/AdiDumi/…
AdiDumi Mar 23, 2023
7d5b6eb
Added tokens table
Mar 23, 2023
40bfaf5
adding number picker and print money page
AdiDumi Mar 26, 2023
8aa68c7
Merge remote-tracking branch 'origin/adrians' into adrians
AdiDumi Mar 26, 2023
15c0f5b
update working demo
AdiDumi Mar 29, 2023
32235be
Update
naklecha Mar 29, 2023
65edd7e
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
naklecha Mar 29, 2023
5463321
Fixing json errors
naklecha Mar 29, 2023
0df4484
Merge pull request #2 from naklecha/adrians
naklecha Mar 29, 2023
e84497f
transfer QR create
Robert-ML Mar 29, 2023
3cc0033
token in QR
Robert-ML Mar 29, 2023
88b7501
Added PrintMoney Function in PrintMoneyFragment
tudelftstudent Mar 29, 2023
5126de3
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
tudelftstudent Mar 29, 2023
22276a5
token in QR
Robert-ML Mar 29, 2023
8bf2c6c
fixed double loop
tudelftstudent Mar 29, 2023
7d41ade
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
tudelftstudent Mar 29, 2023
ef50ff9
changed string length for verifier and genesisHash
tudelftstudent Mar 29, 2023
54e16c6
transfer QR from json
Robert-ML Mar 29, 2023
975e918
Fix token
naklecha Mar 29, 2023
3f05c17
transfer QR from json
Robert-ML Mar 29, 2023
7445201
Working Database!!!! :)
Mar 29, 2023
cb8779c
Merge remote-tracking branch 'origin/adrians' into adrians
Mar 29, 2023
abfa4e2
Changed print money function and number picker max
Mar 29, 2023
d79a675
tokens are transferred along with the private wallet
Robert-ML Apr 2, 2023
33d97df
Merge branch 'Tribler:master' into adrians
Robert-ML Apr 2, 2023
c18e232
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
naklecha Apr 7, 2023
cd695b6
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
naklecha Apr 7, 2023
b5e6dce
Added delete function
Apr 7, 2023
b9aee50
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
naklecha Apr 7, 2023
176a721
Fixed token check
naklecha Apr 7, 2023
a691dbe
Merge pull request #3 from naklecha/adrians
naklecha Apr 7, 2023
e28c8ff
Updated receiving token_id to hex
Apr 7, 2023
fd79990
public authority private and public key
Robert-ML Apr 8, 2023
77f1a04
renamed from offlinemoney to offlinedigitaleuro
Robert-ML Apr 8, 2023
5afddb8
renamed packages from offlinemoney to offlinedigitaleuro
Robert-ML Apr 8, 2023
04cc032
added money icons and 10 euro
AdiDumi Apr 19, 2023
6605325
Added Web of Trust database structure
Apr 20, 2023
b595d0c
restore file i deleted ups
AdiDumi Apr 20, 2023
c560198
Updated UI token images
Apr 20, 2023
ac18a6a
added list of trust users
AdiDumi Apr 20, 2023
dfd5ba9
added title to the web of trust page
AdiDumi Apr 20, 2023
0418d5b
Merge remote-tracking branch 'origin/adrians' into adrians
AdiDumi Apr 20, 2023
485e9af
added acceptance page and changed logic to be in that
AdiDumi Apr 20, 2023
352aaed
modularized functionality out of fragments to have everything in one …
Robert-ML Apr 22, 2023
183742f
Added token check function
Apr 22, 2023
5f390ee
Refactoring database code
naklecha Apr 22, 2023
5c2e57a
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
naklecha Apr 22, 2023
5d4e595
Merge pull request #4 from naklecha/adrians
naklecha Apr 22, 2023
6ce4aec
done insertion and integrated token finidng
Robert-ML Apr 22, 2023
3e548ff
Update PrintDigitalEuroFragment.kt
tudelftstudent Apr 22, 2023
894bd92
Merge branch 'adrians' of https://github.com/AdiDumi/trustchain-super…
tudelftstudent Apr 22, 2023
554a738
Update PrintDigitalEuroFragment.kt
tudelftstudent Apr 22, 2023
95fdc8d
new querry for the transactions DB
Robert-ML Apr 22, 2023
c312f4f
Changed name of database to OfflineDigitalEuroRoomDatabase
Apr 22, 2023
3cba662
added text box for error in print and solve db name
AdiDumi Apr 22, 2023
1b779c6
removed "verify money" button
tudelftstudent Apr 23, 2023
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
11 changes: 0 additions & 11 deletions .github/actions/checkout_submodules/action.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/apk_main.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/apk_pr.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/build.yml

This file was deleted.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ dependencies {
implementation project(':atomic-swap')
implementation project(':literaturedao')
implementation project(':detoks')
implementation project(':offlinedigitaleuro')
api(project(':common')) {
exclude group: 'net.java.dev.jna'
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
android:parentActivityName=".ui.dashboard.DashboardActivity"
android:theme="@style/Fullscreen" />

<activity
android:name="nl.tudelft.trustchain.offlinedigitaleuro.MainActivityOfflineDigitalEuro"
android:parentActivityName=".ui.dashboard.DashboardActivity"
android:theme="@style/Theme.PeerChat" />

<activity
android:name="nl.tudelft.trustchain.valuetransfer.ValueTransferMainActivity"
android:exported="true"
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/nl/tudelft/trustchain/app/AppDefinition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import nl.tudelft.trustchain.trader.ui.TrustChainTraderActivity
import nl.tudelft.trustchain.valuetransfer.ValueTransferMainActivity
import nl.tudelft.trustchain.voting.VotingActivity
import nl.tudelft.trustchain.detoks.DeToksActivity
import nl.tudelft.trustchain.offlinedigitaleuro.MainActivityOfflineDigitalEuro

enum class AppDefinition(
@DrawableRes val icon: Int,
Expand All @@ -36,6 +37,13 @@ enum class AppDefinition(
DeToksActivity::class.java,
true,
),
OFFLINE_MONEY(
R.drawable.ic_offline_money,
"offline money",
R.color.black,
MainActivityOfflineDigitalEuro::class.java,
true,
),
EIGHTEEN_PLUS(
R.drawable.ic_18_plus,
"18+",
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/nl/tudelft/trustchain/app/AppLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class AppLoader(
val PREFERRED_APPS = stringSetPreferencesKey("preferred_apps")
val DEFAULT_APPS = setOf(
AppDefinition.DETOKS.appName,
AppDefinition.OFFLINE_MONEY.appName,
AppDefinition.VALUETRANSFER.appName,
AppDefinition.MUSIC_DAO.appName,
AppDefinition.EIGHTEEN_PLUS.appName
Expand Down
36 changes: 36 additions & 0 deletions common/src/main/res/drawable/ic_offline_money.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="83dp"
android:height="83dp"
android:viewportWidth="83"
android:viewportHeight="83">
<path
android:pathData="M1.5,41.5a40,40 0,1 0,80 0a40,40 0,1 0,-80 0z"
android:strokeWidth="3"
android:fillColor="#00000000"
android:strokeColor="#ffff00"/>
<path
android:pathData="M6.5,41.5a35,35 0,1 0,70 0a35,35 0,1 0,-70 0z"
android:strokeWidth="3"
android:fillColor="#00000000"
android:strokeColor="#ffff00"/>
<path
android:pathData="M41.5,61.75L37.45,57.7C39.7,55.5 43.3,55.5 45.55,57.7ZM49.72,53.65C47.54,51.46 44.59,50.23 41.5,50.23C38.41,50.23 35.46,51.46 33.28,53.65L29.23,49.49C36.01,42.72 46.99,42.72 53.77,49.49ZM57.93,45.44C53.59,41.06 47.67,38.59 41.5,38.59C35.33,38.59 29.41,41.06 25.07,45.44L21.13,41.21C32.41,30.04 50.59,30.04 61.87,41.21ZM66.03,37.16C52.48,23.63 30.52,23.63 16.97,37.16L12.86,33.11C20.46,25.52 30.76,21.25 41.5,21.25C52.24,21.25 62.54,25.52 70.14,33.11Z"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#0080f0"/>
<path
android:pathData="M4,41.5a37.5,37.5 0,1 0,75 0a37.5,37.5 0,1 0,-75 0z"
android:strokeWidth="3"
android:fillColor="#00000000"
android:strokeColor="#ffff00"/>
<path
android:pathData="M36.5,66.5L36.5,16.5"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#007fff"/>
<path
android:pathData="M46.5,66.5L46.5,16.5"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#007fff"/>
</vector>
1 change: 1 addition & 0 deletions offlinedigitaleuro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
93 changes: 93 additions & 0 deletions offlinedigitaleuro/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdk 33

defaultConfig {
minSdkVersion 22
targetSdkVersion 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}

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

buildFeatures {
viewBinding = true
}
// viewBinding {
// enabled = true
// }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// kotlinOptions {
// jvmTarget = '1.8'
// }
namespace 'nl.tudelft.trustchain.offlinedigitaleuro'
}

dependencies {

implementation project(':common')

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.2.0'

implementation 'androidx.legacy:legacy-support-v4:1.0.0'

implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation "androidx.room:room-runtime:$room_version"

implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"

implementation 'com.github.MattSkala:recyclerview-itemadapter:0.4'

// Material
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

// Logging
implementation 'io.github.microutils:kotlin-logging:1.7.7'

testImplementation 'junit:junit:4.12'

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'


implementation 'androidx.room:room-common:2.5.0'
implementation 'androidx.room:room-ktx:2.5.0'
kapt "androidx.room:room-compiler:2.5.0"
implementation "androidx.activity:activity-ktx:1.6.1"
implementation "androidx.fragment:fragment-ktx:1.5.5"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
implementation "androidx.room:room-runtime:2.5.0"

annotationProcessor "androidx.room:room-compiler:$room_version"

implementation 'com.github.travijuu:numberpicker:1.0.7'
}
21 changes: 21 additions & 0 deletions offlinedigitaleuro/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package nl.tudelft.trustchain.offlinedigitaleuro

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("nl.tudelft.trustchain.offlinemoney", appContext.packageName)
}
}
8 changes: 8 additions & 0 deletions offlinedigitaleuro/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity android:name=".MainActivityOfflineDigitalEuro" />
</application>

</manifest>
Loading