mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
android - dont rewrite files from assets if they exist
This commit is contained in:
parent
f1fb42460a
commit
d009a29426
1 changed files with 50 additions and 52 deletions
|
@ -36,7 +36,6 @@ public class I2PDActivity extends Activity {
|
||||||
|
|
||||||
private final DaemonSingleton.StateUpdateListener daemonStateUpdatedListener =
|
private final DaemonSingleton.StateUpdateListener daemonStateUpdatedListener =
|
||||||
new DaemonSingleton.StateUpdateListener() {
|
new DaemonSingleton.StateUpdateListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void daemonStateUpdate()
|
public void daemonStateUpdate()
|
||||||
{
|
{
|
||||||
|
@ -48,7 +47,7 @@ public class I2PDActivity extends Activity {
|
||||||
assetsCopied = true;
|
assetsCopied = true;
|
||||||
copyAsset("certificates");
|
copyAsset("certificates");
|
||||||
copyAsset("i2pd.conf");
|
copyAsset("i2pd.conf");
|
||||||
copyAsset("subsciptions.txt");
|
copyAsset("subscriptions.txt");
|
||||||
copyAsset("tunnels.conf");
|
copyAsset("tunnels.conf");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,7 +171,6 @@ public class I2PDActivity extends Activity {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private static volatile boolean mIsBound;
|
private static volatile boolean mIsBound;
|
||||||
|
|
||||||
private void doBindService() {
|
private void doBindService() {
|
||||||
|
@ -354,7 +352,7 @@ public class I2PDActivity extends Activity {
|
||||||
*/
|
*/
|
||||||
private void copyFileAsset(String path) {
|
private void copyFileAsset(String path) {
|
||||||
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd/", path);
|
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd/", path);
|
||||||
try {
|
if(!file.exists()) try {
|
||||||
InputStream in = getAssets().open(path);
|
InputStream in = getAssets().open(path);
|
||||||
OutputStream out = new FileOutputStream(file);
|
OutputStream out = new FileOutputStream(file);
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
|
|
Loading…
Add table
Reference in a new issue