@@ -25,7 +25,6 @@ import (
25
25
var englishTxt embed.FS
26
26
27
27
28
-
29
28
func main () {
30
29
if ! checkKeycardBinaryExists () {
31
30
fmt .Println ("Keycard binary not found. Downloading..." )
@@ -70,7 +69,26 @@ func main() {
70
69
case "3" :
71
70
qr ()
72
71
72
+
73
73
case "4" :
74
+ fmt .Println ("Installing Dependencies..." )
75
+ keycard_link .JavaDependency ()
76
+ keycard_link .GlobalPlatformDependency ()
77
+
78
+ case "5" :
79
+ fmt .Println ("Installing Keycard..." )
80
+ err := keycard_link .InstallKeycard ()
81
+ if err != nil {
82
+ fmt .Println ("Error installing keycard:" , err )
83
+ }
84
+
85
+ case "6" :
86
+ fmt .Println ("Running Connection test to the IPFS Network." )
87
+ cid := "bafkreie7ohywtosou76tasm7j63yigtzxe7d5zqus4zu3j6oltvgtibeom" // Welcome to IPFS CID
88
+ runIPFSTestWithViu (cid )
89
+
90
+
91
+ case "7" :
74
92
err := art_link .PrintFileSlowly ("apexflexflexsecure.txt" )
75
93
if err != nil {
76
94
fmt .Println ("Error displaying ASCII art:" , err )
@@ -79,20 +97,13 @@ func main() {
79
97
fmt .Println ("Exiting..." )
80
98
os .Exit (0 )
81
99
82
-
83
- case "5" :
84
- cid := "bafkreie7ohywtosou76tasm7j63yigtzxe7d5zqus4zu3j6oltvgtibeom" // Replace with actual CID
85
- runIPFSTestWithViu (cid )
86
-
87
-
88
100
default :
89
101
fmt .Println ("Invalid option, please try again." )
90
102
}
91
103
}
92
104
}
93
105
94
106
95
-
96
107
func qr (){
97
108
98
109
data , err := os .ReadFile ("log_CID.log" )
@@ -119,19 +130,23 @@ func qr(){
119
130
120
131
121
132
func menu () (string , error ) {
133
+
122
134
err := art_link .PrintFileSlowly ("ipfs.txt" )
123
135
if err != nil {
124
136
fmt .Println ("Error displaying ASCII art:" , err )
125
137
}
138
+
126
139
fmt .Println ("---------------------------------------------" )
127
- fmt .Println ("IPFS-Secure | NFC Interface for IPFS " )
140
+ fmt .Println ("IPFS-Secure | NFC Interface for IPFS" )
128
141
fmt .Println ("=============================================" )
129
- fmt .Println ("What would you like to do? Select 1, 2, or 3" )
130
- fmt .Println ("1. Encrypt / upload sensitive data to IPFS." )
131
- fmt .Println ("2. Decrypt / pull file with CID." )
132
- fmt .Println ("3. Print CID Log to QR code." )
133
- fmt .Println ("4. Exit." )
134
- fmt .Println ("5. Run IPFS Connection test." )
142
+ fmt .Println (" What would you like to do?" )
143
+ fmt .Println ("1. Encrypt / upload sensitive data to IPFS" )
144
+ fmt .Println ("2. Decrypt / pull file with CID" )
145
+ fmt .Println ("3. Print CID Log to QR code" )
146
+ fmt .Println ("4. Install Dependencies (Java, GPP)" )
147
+ fmt .Println ("5. Install Keycard onto Implant" )
148
+ fmt .Println ("6. Run Connection Test to IPFS" )
149
+ fmt .Println ("7. Exit the Program" )
135
150
fmt .Println ("=============================================" )
136
151
return generalAskUser ("Enter your choice: " )
137
152
}
@@ -173,6 +188,7 @@ func checkAndInstallViu() error {
173
188
cmd := exec .Command ("sudo" , "apt-get" , "install" , "viu" , "-y" )
174
189
cmd .Stdout = os .Stdout
175
190
cmd .Stderr = os .Stderr
191
+ fmt .Println ("\n If this fails, install viu according to your system :) It should be a standard package.. " )
176
192
return cmd .Run ()
177
193
}
178
194
return nil
@@ -211,14 +227,14 @@ func performBasicIPFSTests() error {
211
227
return nil
212
228
}
213
229
214
- // executeIPFSCommand executes an IPFS command and returns any errors.
215
230
func executeIPFSCommand (args ... string ) error {
216
231
cmd := exec .Command ("ipfs" , args ... )
217
232
cmd .Stdout = os .Stdout
218
233
cmd .Stderr = os .Stderr
219
234
return cmd .Run ()
220
235
}
221
236
237
+
222
238
func downloadKeycardBinary () error {
223
239
url := "https://github.com/status-im/keycard-cli/releases/download/0.7.0/keycard-linux-amd64"
224
240
response , err := http .Get (url )
0 commit comments