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

Foc integration Proof of Concept #21

Closed
wants to merge 907 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
907 commits
Select commit Hold shift + click to select a range
18fc44f
fixed linting errors
emieldesmidt Apr 15, 2020
d9455e3
Merge remote-tracking branch 'origin/dao' into cast-Toggle
emieldesmidt Apr 15, 2020
afe3910
fixed merge
emieldesmidt Apr 15, 2020
ae83f20
Fix transfer funds block type bugs, refactor, cleanup
PJvanderLaan Apr 15, 2020
906d8cc
Fix linting issues and completed bitcoin transaction alert
PJvanderLaan Apr 15, 2020
c75bec3
Fix completed transaction check bug
PJvanderLaan Apr 15, 2020
2ec9cec
Merge pull request #9 from emieldesmidt/cast-Toggle
PraveshMoelchand Apr 15, 2020
acd028f
Show tally when clicking on vote
PraveshMoelchand Apr 15, 2020
3669cec
Update kotlin-ipv8 version
PraveshMoelchand Apr 15, 2020
2fe5cdc
Add comments and documentation
PraveshMoelchand Apr 15, 2020
ba41c27
added timestamp to information dialog box
emieldesmidt Apr 16, 2020
b685097
improved styling of information
emieldesmidt Apr 16, 2020
ad4e9ab
generified myPeerHasCasted to castedByPeer, to allow checking if spec…
emieldesmidt Apr 16, 2020
e5130d4
Disable user to cast vote if previously casted
emieldesmidt Apr 16, 2020
363b57a
Provide more clear information about previous cast
emieldesmidt Apr 16, 2020
fb35c7a
set uncasted proposals to be bold
emieldesmidt Apr 16, 2020
2cd51a0
undo boldfacing due to unexpected behaviour
emieldesmidt Apr 16, 2020
41781e4
Cleanup, split coincommunity in helpers, remove redundant methods and…
PJvanderLaan Apr 16, 2020
e29ac51
Fix join wallet UI scrolling bug
PJvanderLaan Apr 16, 2020
4c34f1a
Implemented Pravesh his suggestion
emieldesmidt Apr 16, 2020
f9d13b3
Merge branch 'master' into ui_improvement
InvictusRMC Apr 16, 2020
0866261
Reduce crawling timeout wallet discovery, broadcast signature requests
PJvanderLaan Apr 16, 2020
ee1f6bc
Add tally to dialog instead of toast
PraveshMoelchand Apr 16, 2020
e08f022
Add fab to my wallet
InvictusRMC Apr 16, 2020
0f56be2
Revert changes in CoinCommunity
InvictusRMC Apr 16, 2020
4be745f
Add proposal mokup to myDaos
InvictusRMC Apr 16, 2020
9c09e09
Merge pull request #10 from emieldesmidt/add_vote_tally
emieldesmidt Apr 16, 2020
a477be5
Fix pipeline by temporarily removing tests
MKuijpers Apr 16, 2020
7909fe7
Merge remote-tracking branch 'origin/dao' into more-details
PraveshMoelchand Apr 16, 2020
7ec9a78
Fix formatting
PraveshMoelchand Apr 16, 2020
e767863
Merge pull request #12 from emieldesmidt/more-details
PraveshMoelchand Apr 16, 2020
4dfd34d
Merge pull request #12 from InvictusRMC/fix-join-wallet
brian2509 Apr 16, 2020
1480f8f
Consistent use of 'proposal'
PraveshMoelchand Apr 16, 2020
7610afd
Consistent use of 'proposal' (forgot a couple)
PraveshMoelchand Apr 16, 2020
35f4071
Remove unused files
PraveshMoelchand Apr 16, 2020
99ce22b
Apparently this file is used after all
PraveshMoelchand Apr 16, 2020
1604f95
Merge pull request #13 from emieldesmidt/fix_textual_errors
PraveshMoelchand Apr 16, 2020
1e34dc7
Add more tests
dymbe Apr 16, 2020
42fd2a0
style input box in the alert dialog
emieldesmidt Apr 17, 2020
62b16c7
set margins to better align
emieldesmidt Apr 17, 2020
6243f4c
set margins to better align
emieldesmidt Apr 17, 2020
76e6bd2
more indicative hint
emieldesmidt Apr 17, 2020
a44e1e8
changed list to a cardview list
emieldesmidt Apr 17, 2020
61786b6
Improved layout
emieldesmidt Apr 17, 2020
59c577d
Merge pull request #10 from emieldesmidt/dao
MattSkala Apr 17, 2020
115cae6
removed unused import
emieldesmidt Apr 17, 2020
f810ebc
Improved layout of main screen
emieldesmidt Apr 17, 2020
578a459
removed unused import.
emieldesmidt Apr 17, 2020
41ba7dd
Stripped date to only include day and time
emieldesmidt Apr 17, 2020
28f9e4d
Merge branch 'master' into ui_improvement
InvictusRMC Apr 17, 2020
b91e2ca
Make list entries clickable
InvictusRMC Apr 17, 2020
0a6820c
Merge pull request #11 from InvictusRMC/ui_improvement
MKuijpers Apr 17, 2020
e1551fe
Refresh DAO Login screen and add production/test-net toggle
brian2509 Apr 17, 2020
b863370
Update kotlin-ipv8 submodule
PraveshMoelchand Apr 17, 2020
6951c99
Refresh the Home/Bitcoin screen and add copy to clipboard buttons
brian2509 Apr 17, 2020
884e698
Add white icons for menu bar items in Bitcoin/Home screen
brian2509 Apr 17, 2020
b451e53
Refresh the block-chain download/sync screen
brian2509 Apr 17, 2020
3f3a55e
Refresh the import/create new wallet screen
brian2509 Apr 17, 2020
fdfd652
Add stripped date to dialog
PraveshMoelchand Apr 17, 2020
4d0bd84
Make getTally() private
PraveshMoelchand Apr 17, 2020
26c5836
Refresh MyDAO screen and move proposal information to another tab
brian2509 Apr 17, 2020
75f7aa2
Change bottom bar item to proposal screen and change screen titles
brian2509 Apr 17, 2020
36bacbd
Remove unnecessary 'm' in var names
PraveshMoelchand Apr 17, 2020
9b6064d
Suppress warning
PraveshMoelchand Apr 17, 2020
d3a21df
Refactor 'myWallet' screen to a placeholder proposals screen
brian2509 Apr 17, 2020
4eb555d
Fixed failing input.
emieldesmidt Apr 17, 2020
48c266f
Merge pull request #14 from emieldesmidt/intuitive_list
PraveshMoelchand Apr 17, 2020
e93e51d
Merge pull request #32 from dymbe/create-unit-tests
dymbe Apr 17, 2020
609d248
threshold function
erwinvanthiel Apr 17, 2020
cfb872b
remove peers argument from vote completing check function
erwinvanthiel Apr 17, 2020
1e49613
made threshold argument optional
erwinvanthiel Apr 17, 2020
3d6dd3d
Suppress warning
PraveshMoelchand Apr 17, 2020
f617507
Add button text
PraveshMoelchand Apr 17, 2020
23c1e29
initial setup for threshold vote completeness check.
erwinvanthiel Apr 17, 2020
3c0dd79
Add colour to button
PraveshMoelchand Apr 17, 2020
8cc4b40
Merge pull request #16 from emieldesmidt/fix_layout
KoningR Apr 17, 2020
b7c62c9
Added toggle to switch between voting modes (not functional yet)
emieldesmidt Apr 18, 2020
b07d6fa
Link switch toggle
emieldesmidt Apr 18, 2020
6ad2462
Exported enum to dedicated class
emieldesmidt Apr 18, 2020
c1e47c8
Build fail fix
emieldesmidt Apr 18, 2020
624f88a
Added some more margin
emieldesmidt Apr 18, 2020
f1c26fe
implemented requested change by Pravesh
emieldesmidt Apr 18, 2020
8d52660
Merge pull request #17 from emieldesmidt/voting-mode-toggle
PraveshMoelchand Apr 18, 2020
350b351
wrapped up voteCompleteness function, branch build but error is throw…
erwinvanthiel Apr 18, 2020
8164519
Merge pull request #13 from InvictusRMC/ui_refresh
InvictusRMC Apr 18, 2020
ad4edea
Changed parsing time to use DateFormat as suggested by Matt
emieldesmidt Apr 19, 2020
7e01f28
Merge pull request #11 from emieldesmidt/dao
MattSkala Apr 19, 2020
cc483bd
Improve error catching in UI, and improve consistency across UI
MKuijpers Apr 19, 2020
7e6f9e5
Merge branch 'build-apk' into dao
MattSkala Apr 19, 2020
0193e1e
Merge remote-tracking branch 'origin/master' into dao
MattSkala Apr 19, 2020
616409d
Update GUI and fix AI to make profit instead of loss
martijnbosma Apr 19, 2020
f54a7b7
Initial attempt at converting strings to public keys.
Apr 19, 2020
852414c
Initial README.md
PraveshMoelchand Apr 19, 2020
86d0ce8
Lint error fix
martijnbosma Apr 19, 2020
f184f21
Merge pull request #13 from dymbe/AI_profit
MattSkala Apr 19, 2020
e0cda4a
Add README.md for common
PraveshMoelchand Apr 19, 2020
94817f2
Add img for README
PraveshMoelchand Apr 19, 2020
a961050
Rename img to conform to convention
PraveshMoelchand Apr 19, 2020
baeaf14
Add img to voting/README.md
PraveshMoelchand Apr 19, 2020
8f616f7
Fix typos
PraveshMoelchand Apr 19, 2020
89dfd5d
Added scroll bar for ease of use
tpapak01 Apr 19, 2020
426573c
Add UI and show all proposals from local database
PJvanderLaan Apr 20, 2020
39a7fc6
Fix lint, added space
MKuijpers Apr 20, 2020
585f98e
Show proposal type and add proposal crawling
PJvanderLaan Apr 20, 2020
d059627
Add minimal tx amount as constant
MKuijpers Apr 20, 2020
f47db8d
Remove catch in wallet manager, catch usages of the method
MKuijpers Apr 20, 2020
93ef752
Merge pull request #14 from InvictusRMC/ui_stability
PJvanderLaan Apr 20, 2020
8c73ab5
Add voting functionality onclick
PJvanderLaan Apr 20, 2020
7f0654d
Merge branch 'master' into explicit_proposals
PJvanderLaan Apr 20, 2020
c890584
Implement threshold voting by starting votes using entire public keys…
Apr 20, 2020
7de65ab
Remove automatic voting and improve crawl result UI updates
PJvanderLaan Apr 20, 2020
f1b4397
Adjust tests to new functionality and write new tests for votingCompl…
erwinvanthiel Apr 20, 2020
ea7f909
Added scroll bar for ease of use
tpapak01 Apr 20, 2020
5e4bbc6
Fix proposal block types filtering bug
PJvanderLaan Apr 20, 2020
dc1b762
Fix linting
PJvanderLaan Apr 20, 2020
32303ff
Torrents operations complete
tpapak01 Apr 20, 2020
4fff30f
Extra
tpapak01 Apr 20, 2020
7000337
Extra2
tpapak01 Apr 20, 2020
b71a850
Consistently add change addresses to transactions
MKuijpers Apr 20, 2020
01caa75
Complete
tpapak01 Apr 20, 2020
60b05de
Fix linting
MKuijpers Apr 20, 2020
ff14430
Fixed minor issue
tpapak01 Apr 20, 2020
7dda7da
Reduce trustchain blocksize join voting
PJvanderLaan Apr 21, 2020
184745b
Reduce trustchain block size transfer funds voting
PJvanderLaan Apr 21, 2020
1055de2
Fix build error
PJvanderLaan Apr 21, 2020
b06f94c
Add readme superapp and new images readme trader and payloadgenerator
tijmengit Apr 21, 2020
a63f88a
Readme style fix
tijmengit Apr 21, 2020
c391112
Fix transfer funds wallet hash bug
PJvanderLaan Apr 21, 2020
c4fcb49
Name refactor of vote completeness functions
erwinvanthiel Apr 21, 2020
dbc2ccd
Make threshold optional parameter instead of a nullable one
erwinvanthiel Apr 21, 2020
78a753a
Update README.md
mvanmeerten Apr 21, 2020
e0707cd
Update readme.md
mvanmeerten Apr 21, 2020
1b2150c
Update README.md
mvanmeerten Apr 21, 2020
3feba23
Update readme.md
mvanmeerten Apr 21, 2020
066692c
Merge branch 'dao' of https://github.com/emieldesmidt/trustchain-supe…
Apr 22, 2020
81e4d29
Add input guarding functionality to threshold and yes/no voting.
Apr 22, 2020
620e61e
Update tests according to new functionality
erwinvanthiel Apr 22, 2020
daeae89
Test invalid block type input
erwinvanthiel Apr 22, 2020
1b87118
Build fail fix
emieldesmidt Apr 22, 2020
742c6c5
fixed wrong toggle text (my mistake)
emieldesmidt Apr 22, 2020
b5ae7eb
Merge branches 'AI_profit' and 'master' of github.com:dymbe/trustchai…
martijnbosma Apr 22, 2020
7ada1aa
Final deliverable for the 23rd
tpapak01 Apr 22, 2020
25094c0
Deleted old apk
tpapak01 Apr 22, 2020
8deef9e
Uploaded new apk
tpapak01 Apr 22, 2020
58c17b3
Fixed minor bug
tpapak01 Apr 22, 2020
52a833d
Update Trader UI to include loading view
martijnbosma Apr 22, 2020
f47da3a
Merge pull request #33 from dymbe/AI_profit
tijmengit Apr 22, 2020
5d3f060
Add tests for TraderFragment
mvanmeerten Apr 22, 2020
fac03c8
Merge branch 'trader-fragment-testing' of github.com:dymbe/trustchain…
tijmengit Apr 22, 2020
223c228
Merge pull request #34 from dymbe/trader-fragment-testing
tijmengit Apr 22, 2020
a914f71
Merge branch 'master' of github.com:dymbe/trustchain-superapp
tijmengit Apr 22, 2020
0518543
Changed button name
tpapak01 Apr 22, 2020
fd018ce
New gif and trader png
tijmengit Apr 22, 2020
ab7cef9
Small bug fix
tijmengit Apr 22, 2020
d2a5ef2
Merge pull request #15 from InvictusRMC/change_addresses
brian2509 Apr 22, 2020
79390f6
Remove unused variable to fix linting
brian2509 Apr 22, 2020
7c62bb8
Merge pull request #16 from InvictusRMC/explicit_proposals
brian2509 Apr 22, 2020
4e8768b
Show vote completeness in dialog
erwinvanthiel Apr 22, 2020
34534ca
Implement Emiel's suggestions
PraveshMoelchand Apr 22, 2020
8c444f8
Update kotlin-ipv8
PraveshMoelchand Apr 22, 2020
b39f807
Implement Emiel's suggestion
PraveshMoelchand Apr 22, 2020
dc19fcf
Fix test error caused by kotlin-ipv8 update
PraveshMoelchand Apr 22, 2020
d3ab567
Revert changes
PraveshMoelchand Apr 22, 2020
001b77e
Revert "Update kotlin-ipv8"
PraveshMoelchand Apr 22, 2020
717ccc6
Small bug fix
tijmengit Apr 23, 2020
1f40520
Lint fix
martijnbosma Apr 23, 2020
fb065bb
Merge pull request #16 from dymbe/master
MattSkala Apr 23, 2020
ec4d22a
Build fail fix #2
emieldesmidt Apr 23, 2020
a06ee06
made toast indicating voting status more descriptive.
emieldesmidt Apr 23, 2020
b504957
refactored method name to be more descriptive.
emieldesmidt Apr 23, 2020
a240f6a
Merge pull request #18 from emieldesmidt/doc
emieldesmidt Apr 23, 2020
b4e1357
Try catch to prevent app crashing real bad.
emieldesmidt Apr 23, 2020
3d94749
Minor refactoring (suggested by jetbrains magic)
emieldesmidt Apr 23, 2020
a4b54db
Merge pull request #19 from emieldesmidt/threshold
PraveshMoelchand Apr 23, 2020
95c6b18
Merge branch 'dao'
tpapak01 Apr 23, 2020
dbebd33
Merge remote-tracking branch 'upstream/dao' into merge-upstream
MKuijpers Apr 23, 2020
69806ad
Necessary for push request
tpapak01 Apr 23, 2020
6646549
Merge pull request #15 from tpapak01/master
MattSkala Apr 23, 2020
fadf45d
Merge pull request #17 from InvictusRMC/merge-upstream
PJvanderLaan Apr 23, 2020
c001b72
Force GitHub Actions build
MKuijpers Apr 23, 2020
800ba14
Add initial VotingCommunity extending from TrustchainCommunity.
Apr 24, 2020
16af82d
Merge branch 'dao' of https://github.com/emieldesmidt/trustchain-supe…
Apr 24, 2020
fd9db43
Fix gradle build failure due to imports and whitespace.
Apr 24, 2020
b8cc42a
Add progressbar to voting GUI.
Apr 24, 2020
68144da
Merge branch 'votingcommunity' of https://github.com/emieldesmidt/tru…
Apr 24, 2020
6d3c6a3
Add color to progressbar.
Apr 24, 2020
ba70393
Add tests for votingPercentage check
erwinvanthiel Apr 24, 2020
38007ac
Fix Gradle build error blank lines.
Apr 24, 2020
f381aaf
Merge pull request #32 from emieldesmidt/votingcommunity
PraveshMoelchand Apr 24, 2020
5e44270
Merge branch 'dao' of https://github.com/Tribler/trustchain-superapp …
emieldesmidt Apr 25, 2020
dc68a7a
removed cryptoprovider from test suite
emieldesmidt Apr 25, 2020
c48a59a
Merge pull request #17 from InvictusRMC/master
MattSkala Apr 25, 2020
1445bef
Catch votingcomplete threshold not made case
erwinvanthiel Apr 25, 2020
1e9a719
Merge pull request #33 from emieldesmidt/voting-complete-gui
PraveshMoelchand Apr 25, 2020
49cf48c
Update kotlin-ipv8 to same version as in dao
PraveshMoelchand Apr 25, 2020
9a74ab6
Revert "removed cryptoprovider from test suite"
PraveshMoelchand Apr 25, 2020
d68e042
Merge remote-tracking branch 'upstream/dao' into dao-rebase
PraveshMoelchand Apr 25, 2020
b3167b6
Merge branch 'emieldesmidt/dao' into dao-rebase
PraveshMoelchand Apr 25, 2020
6a148cc
Update kotlin-ipv8 again. Previous merge messed things up
PraveshMoelchand Apr 25, 2020
6dd5c83
Merge pull request #36 from emieldesmidt/dao-rebase
PraveshMoelchand Apr 25, 2020
7b3e400
Update kotlin-ipv8 to https://github.com/Tribler/kotlin-ipv8/commit/1…
PraveshMoelchand Apr 26, 2020
6ac39bd
Remove unnecessary assignment
PraveshMoelchand Apr 26, 2020
3634638
Update Kotlin version
PraveshMoelchand Apr 26, 2020
222e1ba
Update Gradle version
PraveshMoelchand Apr 26, 2020
94e5d29
Change deprecated @UseExperimental to @OptIn (new Kotlin version)
PraveshMoelchand Apr 26, 2020
d900f08
Merge pull request #20 from PraveshMoelchand/update-kotlin-ipv8
MattSkala Apr 26, 2020
0709a6f
Merge branch 'dao' of https://github.com/Tribler/trustchain-superapp …
emieldesmidt Apr 26, 2020
734c4ea
Merge pull request #37 from emieldesmidt/dao-update
PraveshMoelchand Apr 26, 2020
9b30319
Add new indicator
emieldesmidt Apr 26, 2020
48715ba
Build fail fix + new indicator positioning
emieldesmidt Apr 26, 2020
9f39916
limit input to 50 chars
emieldesmidt Apr 26, 2020
3f45887
changed getter to has check as return object is not used anyways
emieldesmidt Apr 26, 2020
e732f93
make getter use the previously made hasField checker
emieldesmidt Apr 26, 2020
3b6e678
typo fix as spotted by prav
emieldesmidt Apr 27, 2020
ab206a6
Fixed duplicate code block
emieldesmidt Apr 27, 2020
7cd23a8
Implement Android Studio suggestions
PraveshMoelchand Apr 27, 2020
368e621
Fix NEW tag being pushed off screen by setting max width
emieldesmidt Apr 27, 2020
17f5534
Only display agree button when dealing with a threshold vote
emieldesmidt Apr 27, 2020
0ca1218
Display current standing dependent on the voting mode.
emieldesmidt Apr 27, 2020
bc29871
build fail fix, sorry :P
emieldesmidt Apr 27, 2020
cbddeed
removed unnecessary suppressor
emieldesmidt Apr 27, 2020
607dc2d
FOC checkbox
emieldesmidt Apr 27, 2020
9769661
endpoint for the FOC app that returns successful filepath proposals
emieldesmidt Apr 27, 2020
e07d952
Allow for foc_voting_block proposal blocks
emieldesmidt Apr 27, 2020
0d02068
check against FOCVotingBlock as well as normal votingblock
emieldesmidt Apr 27, 2020
d7728bf
Test to check expected behaviour
emieldesmidt Apr 27, 2020
6ae5d1b
bind checkbox, enforce threshold mode
emieldesmidt Apr 27, 2020
d7212fe
Use layout weights to ensure automatic scaling
PraveshMoelchand Apr 27, 2020
4928302
Redo scaling
PraveshMoelchand Apr 27, 2020
bf5c39e
Add VOTED and COMPLETED indicators
PraveshMoelchand Apr 27, 2020
04a3ba8
Refactor indicator name
PraveshMoelchand Apr 27, 2020
5d49888
Implement Android Studio suggestion
PraveshMoelchand Apr 27, 2020
e3c3853
Fix lint error
PraveshMoelchand Apr 27, 2020
1cbd533
Merge pull request #39 from emieldesmidt/input-limit
PraveshMoelchand Apr 27, 2020
0fd2325
Merge pull request #40 from emieldesmidt/no-key-fix
PraveshMoelchand Apr 27, 2020
2f420da
Merge branch 'dao' into new-indicator
PraveshMoelchand Apr 27, 2020
bde4e12
Fix error (https://github.com/emieldesmidt/trustchain-superapp/pull/4…
PraveshMoelchand Apr 27, 2020
09b3c20
Merge branch 'new-indicator' into threshold-casting
PraveshMoelchand Apr 27, 2020
b5272a6
Fix lint errors
PraveshMoelchand Apr 27, 2020
e8ee50d
Quick and dirty selector within the FOC app
emieldesmidt Apr 28, 2020
7bbea4f
Message when no files eligible for upload
emieldesmidt Apr 28, 2020
2b20486
Merge branch 'threshold-casting' into FOC-Integration
emieldesmidt Apr 28, 2020
63f57a2
fixed errors after merge
emieldesmidt Apr 28, 2020
ae29d35
Created separate field instead of different block type
emieldesmidt Apr 28, 2020
a81f838
formatting for easier debugging
emieldesmidt Apr 28, 2020
4831c61
fixed typos
emieldesmidt Apr 28, 2020
97c78a9
added todo
emieldesmidt Apr 28, 2020
bd3e09b
use votingcommunity
emieldesmidt Apr 28, 2020
476cc8c
disable switch when using FOC mode
emieldesmidt Apr 28, 2020
2ceceab
Add Voting module to FOC.
Apr 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
build
.idea
*.iml
local.properties
.gradle
1 change: 1 addition & 0 deletions FOC/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
78 changes: 78 additions & 0 deletions FOC/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'org.jlleitschuh.gradle.ktlint'

ktlint {
version = "$ktlint_version"
android = true
outputToConsole = true
ignoreFailures = false
}

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName "1.0"

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

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

// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
allWarningsAsErrors = true
}

viewBinding {
enabled = true
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(':common')
implementation project(':voting')
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
implementation files('libs/jlibtorrent-1.2.5.0.jar')
implementation files('libs/jlibtorrent-android-arm64-1.2.5.0.jar')
implementation files('libs/jlibtorrent-android-arm-1.2.5.0.jar')
implementation files('libs/jlibtorrent-android-x86-1.2.5.0.jar')
implementation files('libs/jlibtorrent-android-x86_64-1.2.5.0.jar')

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}
Empty file added FOC/consumer-rules.pro
Empty file.
Binary file added FOC/libs/jlibtorrent-1.2.5.0.jar
Binary file not shown.
Binary file added FOC/libs/jlibtorrent-android-arm-1.2.5.0.jar
Binary file not shown.
Binary file added FOC/libs/jlibtorrent-android-arm64-1.2.5.0.jar
Binary file not shown.
Binary file added FOC/libs/jlibtorrent-android-x86-1.2.5.0.jar
Binary file not shown.
Binary file added FOC/libs/jlibtorrent-android-x86_64-1.2.5.0.jar
Binary file not shown.
21 changes: 21 additions & 0 deletions FOC/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.FOC

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.FOC.test", appContext.packageName)
}
}
22 changes: 22 additions & 0 deletions FOC/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nl.tudelft.trustchain.FOC">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application>
<activity android:name=".ExecutionActivity" />
<activity
android:name="nl.tudelft.trustchain.FOC.MainActivityFOC"
android:label="@string/title_activity_main_FOC"
android:windowSoftInputMode="stateHidden"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
73 changes: 73 additions & 0 deletions FOC/src/main/java/nl/tudelft/trustchain/FOC/BlankFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package nl.tudelft.trustchain.FOC

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import nl.tudelft.trustchain.FOC.databinding.BlankFragmentBinding

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [BlankFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class BlankFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null

private var _binding: BlankFragmentBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
_binding = BlankFragmentBinding.inflate(inflater, container, false)
val view = binding.root

return view
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment BlankFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
BlankFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
85 changes: 85 additions & 0 deletions FOC/src/main/java/nl/tudelft/trustchain/FOC/ExecutionActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package nl.tudelft.trustchain.FOC;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.widget.LinearLayout;

//import com.google.gson.Gson;

import dalvik.system.DexClassLoader;

public class ExecutionActivity extends AppCompatActivity {
private static Context context;

private Class fragmentClass = null;
private Fragment mainFragment = null;

LinearLayout mainLayoutContainer = null;
LinearLayout tmpLayout = null;


@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();

transaction.remove(mainFragment);
transaction.commit();

mainLayoutContainer.removeView(tmpLayout);

super.onSaveInstanceState(savedInstanceState);
}

@SuppressLint({"ResourceType"})
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_execution);

context = getApplicationContext();

String apkName = "";
Bundle extras = this.getIntent().getExtras();
if(extras.containsKey("fileName")) {
apkName = this.getIntent().getStringExtra("fileName");
}
//uncomment if you want to read from the actual phone storage (needs "write" permission)
final String apkPath = apkName;
//final String apkPath = context.getExternalFilesDir(null).getAbsolutePath() + "/" + apkName;
final ClassLoader classLoader = new DexClassLoader(apkPath, context.getCacheDir().getAbsolutePath(), null, this.getClass().getClassLoader());

mainLayoutContainer = (LinearLayout) findViewById(R.id.llcontainer);

try {

fragmentClass = classLoader.loadClass("com.example.demoboi.MainFragment");
mainFragment = (Fragment) fragmentClass.newInstance();

tmpLayout = new LinearLayout(getApplicationContext());
tmpLayout.setId(1);

FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();

transaction.add(tmpLayout.getId(), mainFragment, "mainFragment");
transaction.commit();

mainLayoutContainer.addView(tmpLayout);
}
catch (Exception e) {
Log.i("personal", "Something went wrong");
e.printStackTrace();
}
}
}
Loading