mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
copy assets before daemon start
This commit is contained in:
parent
331a23fc20
commit
db4c26a400
@ -30,6 +30,7 @@ public class I2PDActivity extends Activity {
|
|||||||
public static final int GRACEFUL_DELAY_MILLIS = 10 * 60 * 1000;
|
public static final int GRACEFUL_DELAY_MILLIS = 10 * 60 * 1000;
|
||||||
|
|
||||||
private TextView textView;
|
private TextView textView;
|
||||||
|
private boolean assetsCopied;
|
||||||
|
|
||||||
private static final DaemonSingleton daemon = DaemonSingleton.getInstance();
|
private static final DaemonSingleton daemon = DaemonSingleton.getInstance();
|
||||||
|
|
||||||
@ -37,7 +38,25 @@ public class I2PDActivity extends Activity {
|
|||||||
new DaemonSingleton.StateUpdateListener() {
|
new DaemonSingleton.StateUpdateListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void daemonStateUpdate() {
|
public void daemonStateUpdate()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// copy assets
|
||||||
|
if (!assetsCopied)
|
||||||
|
{
|
||||||
|
assetsCopied = true;
|
||||||
|
copyAsset("certificates");
|
||||||
|
copyAsset("i2pd.conf");
|
||||||
|
copyAsset("subsciptions.txt");
|
||||||
|
copyAsset("tunnels.conf");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Throwable tr)
|
||||||
|
{
|
||||||
|
Log.e(TAG,"copy assets",tr);
|
||||||
|
};
|
||||||
|
|
||||||
runOnUiThread(new Runnable(){
|
runOnUiThread(new Runnable(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -79,12 +98,6 @@ public class I2PDActivity extends Activity {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
// copy assets
|
|
||||||
copyAsset("certificates");
|
|
||||||
copyAsset("i2pd.conf");
|
|
||||||
copyAsset("subsciptions.txt");
|
|
||||||
copyAsset("tunnels.conf");
|
|
||||||
|
|
||||||
textView = new TextView(this);
|
textView = new TextView(this);
|
||||||
setContentView(textView);
|
setContentView(textView);
|
||||||
daemon.addStateChangeListener(daemonStateUpdatedListener);
|
daemon.addStateChangeListener(daemonStateUpdatedListener);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user