From 405429a300bf00e634785f9be3ffecd9e78eec1a Mon Sep 17 00:00:00 2001 From: r4sas Date: Thu, 16 Aug 2018 23:32:33 +0300 Subject: [PATCH] android - add file for notify about successful unpacking assets --- android/src/org/purplei2p/i2pd/I2PDActivity.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/android/src/org/purplei2p/i2pd/I2PDActivity.java b/android/src/org/purplei2p/i2pd/I2PDActivity.java index 21cb0572..78f67c8b 100755 --- a/android/src/org/purplei2p/i2pd/I2PDActivity.java +++ b/android/src/org/purplei2p/i2pd/I2PDActivity.java @@ -1,6 +1,7 @@ package org.purplei2p.i2pd; import java.io.File; +import java.io.FileWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -25,6 +26,9 @@ import android.view.MenuItem; import android.widget.TextView; import android.widget.Toast; +// For future package update checking +import org.purplei2p.i2pd.BuildConfig; + public class I2PDActivity extends Activity { private static final String TAG = "i2pdActvt"; public static final int GRACEFUL_DELAY_MILLIS = 10 * 60 * 1000; @@ -44,11 +48,19 @@ public class I2PDActivity extends Activity { // copy assets if (!assetsCopied) { - assetsCopied = true; copyAsset("certificates"); copyAsset("i2pd.conf"); copyAsset("subscriptions.txt"); copyAsset("tunnels.conf"); + assetsCopied = true; + + // create holder file about successful copying + File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd/", "assets.ready"); + FileWriter writer = new FileWriter(file); + String versionName = BuildConfig.VERSION_NAME; // here will be 2.XX.0 + writer.append(versionName); + writer.flush(); + writer.close(); } } catch (Throwable tr)