mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
android - add file for notify about successful unpacking assets
This commit is contained in:
parent
d009a29426
commit
405429a300
|
@ -1,6 +1,7 @@
|
||||||
package org.purplei2p.i2pd;
|
package org.purplei2p.i2pd;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -25,6 +26,9 @@ import android.view.MenuItem;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
// For future package update checking
|
||||||
|
import org.purplei2p.i2pd.BuildConfig;
|
||||||
|
|
||||||
public class I2PDActivity extends Activity {
|
public class I2PDActivity extends Activity {
|
||||||
private static final String TAG = "i2pdActvt";
|
private static final String TAG = "i2pdActvt";
|
||||||
public static final int GRACEFUL_DELAY_MILLIS = 10 * 60 * 1000;
|
public static final int GRACEFUL_DELAY_MILLIS = 10 * 60 * 1000;
|
||||||
|
@ -44,11 +48,19 @@ public class I2PDActivity extends Activity {
|
||||||
// copy assets
|
// copy assets
|
||||||
if (!assetsCopied)
|
if (!assetsCopied)
|
||||||
{
|
{
|
||||||
assetsCopied = true;
|
|
||||||
copyAsset("certificates");
|
copyAsset("certificates");
|
||||||
copyAsset("i2pd.conf");
|
copyAsset("i2pd.conf");
|
||||||
copyAsset("subscriptions.txt");
|
copyAsset("subscriptions.txt");
|
||||||
copyAsset("tunnels.conf");
|
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)
|
catch (Throwable tr)
|
||||||
|
|
Loading…
Reference in a new issue