commit d91695d075eddb05b6bd3a4e500d54ab9f7bbd53
parent f13f66e8f5011810b142563285b0dac02ca035ce
Author: julianharty <julianharty@gmail.com>
Date: Mon, 19 Aug 2024 08:34:09 +0100
Added a legitimate private key to the assets which is copied at runtime so GNUnet can use it.
Also added additional log messages so we can easily check file copies worked, or not.
Diffstat:
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/android_studio/app/src/main/assets/gnunet.conf b/android_studio/app/src/main/assets/gnunet.conf
@@ -86,7 +86,7 @@ IMMEDIATE_START = YES
DISABLE_BROADCAST = YES
[PEER]
-PRIVATE_KEY = $GNUNET_DATA_HOME/private_key.ecc
+PRIVATE_KEY = $GNUNET_DATA_HOME/files/private_key.ecc
SYSTEM_TYPE = UNKNOWN
[PATHS]
diff --git a/android_studio/app/src/main/assets/private_key.ecc b/android_studio/app/src/main/assets/private_key.ecc
@@ -0,0 +1 @@
+òצÖXÐyF£!HºAj¡AôT~Kâ!·=·Jì,
+\ No newline at end of file
diff --git a/android_studio/app/src/main/java/org/gnu/gnunet/MainActivity.kt b/android_studio/app/src/main/java/org/gnu/gnunet/MainActivity.kt
@@ -20,11 +20,18 @@ class MainActivity : AppCompatActivity() {
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
- val isSuccess = copyFileFromAssetsToInternalStorage("libgnunet_plugin_peerstore_sqlite.so", "libgnunet_plugin_peerstore_sqlite.so")
+ var isSuccess = copyFileFromAssetsToInternalStorage("libgnunet_plugin_peerstore_sqlite.so", "libgnunet_plugin_peerstore_sqlite.so")
if (isSuccess) {
- Log.d("GNUNET", "onCreate: file copied successfully")
+ Log.d("GNUNET", "onCreate: file libgnunet_plugin_peerstore_sqlite.so copied successfully")
} else {
- Log.e("GNUNET", "onCreate: file not copied :(")
+ Log.e("GNUNET", "onCreate: file libgnunet_plugin_peerstore_sqlite.so not copied :(")
+ }
+
+ isSuccess = copyFileFromAssetsToInternalStorage("private_key.ecc", "private_key.ecc")
+ if (isSuccess) {
+ Log.d("GNUNET", "onCreate: file private_key.ecc copied successfully")
+ } else {
+ Log.e("GNUNET", "onCreate: file private_key.ecc not copied :(")
}
// Example of a call to a native method