|
|
@ -153,8 +153,7 @@ public class I2PDActivity extends Activity { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) |
|
|
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { |
|
|
|
{ |
|
|
|
|
|
|
|
if (requestCode == MY_PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE) { |
|
|
|
if (requestCode == MY_PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE) { |
|
|
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) |
|
|
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) |
|
|
|
Log.e(TAG, "WR_EXT_STORAGE perm granted"); |
|
|
|
Log.e(TAG, "WR_EXT_STORAGE perm granted"); |
|
|
@ -352,8 +351,7 @@ public class I2PDActivity extends Activity { |
|
|
|
}, "gracInit").start(); |
|
|
|
}, "gracInit").start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void cancelGracefulStop() |
|
|
|
private void cancelGracefulStop() { |
|
|
|
{ |
|
|
|
|
|
|
|
cancelGracefulStop0(); |
|
|
|
cancelGracefulStop0(); |
|
|
|
new Thread(() -> { |
|
|
|
new Thread(() -> { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -420,8 +418,7 @@ public class I2PDActivity extends Activity { |
|
|
|
* Copy the asset at the specified path to this app's data directory. If the |
|
|
|
* Copy the asset at the specified path to this app's data directory. If the |
|
|
|
* asset is a directory, its contents are also copied. |
|
|
|
* asset is a directory, its contents are also copied. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param path |
|
|
|
* @param path Path to asset, relative to app's assets directory. |
|
|
|
* Path to asset, relative to app's assets directory. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void copyAsset(String path) { |
|
|
|
private void copyAsset(String path) { |
|
|
|
AssetManager manager = getAssets(); |
|
|
|
AssetManager manager = getAssets(); |
|
|
@ -459,8 +456,7 @@ public class I2PDActivity extends Activity { |
|
|
|
* Copy the asset file specified by path to app's data directory. Assumes |
|
|
|
* Copy the asset file specified by path to app's data directory. Assumes |
|
|
|
* parent directories have already been created. |
|
|
|
* parent directories have already been created. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param path |
|
|
|
* @param path Path to asset, relative to app's assets directory. |
|
|
|
* Path to asset, relative to app's assets directory. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void copyFileAsset(String path) { |
|
|
|
private void copyFileAsset(String path) { |
|
|
|
File file = new File(i2pdpath, path); |
|
|
|
File file = new File(i2pdpath, path); |
|
|
@ -545,8 +541,7 @@ public class I2PDActivity extends Activity { |
|
|
|
Log.e(TAG, "holderFile.delete() returned " + deleteResult + ", absolute path='" + holderFile.getAbsolutePath() + "'"); |
|
|
|
Log.e(TAG, "holderFile.delete() returned " + deleteResult + ", absolute path='" + holderFile.getAbsolutePath() + "'"); |
|
|
|
File certPath = new File(i2pdpath, "certificates"); |
|
|
|
File certPath = new File(i2pdpath, "certificates"); |
|
|
|
deleteRecursive(certPath); |
|
|
|
deleteRecursive(certPath); |
|
|
|
} |
|
|
|
} catch (Throwable tr) { |
|
|
|
catch (Throwable tr) { |
|
|
|
|
|
|
|
Log.e(TAG, "", tr); |
|
|
|
Log.e(TAG, "", tr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -569,9 +564,7 @@ public class I2PDActivity extends Activity { |
|
|
|
Log.e(TAG, "on writer close", e); |
|
|
|
Log.e(TAG, "on writer close", e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Throwable tr) { |
|
|
|
catch (Throwable tr) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Log.e(TAG, "on assets copying", tr); |
|
|
|
Log.e(TAG, "on assets copying", tr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|