Merge pull request #382 from afischerdev/update-version
Add file check for A10 #379
This commit is contained in:
commit
15e84c81ea
2 changed files with 20 additions and 9 deletions
|
@ -596,7 +596,7 @@ public class BRouterActivity extends Activity implements ActivityCompat.OnReques
|
|||
}
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R
|
||||
&& checkExternalStorageWritable()) {
|
||||
res.add(Environment.getExternalStorageDirectory());
|
||||
}
|
||||
|
|
|
@ -123,6 +123,15 @@ public class BRouterView extends View {
|
|||
if (brd.isDirectory()) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q &&
|
||||
!brd.getAbsolutePath().contains("/Android/media/btools.routingapp")) {
|
||||
|
||||
// don't ask twice
|
||||
String version = "v" + getContext().getString(R.string.app_version);
|
||||
File vFile = new File(brd, "profiles2/"+version );
|
||||
if (android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.Q
|
||||
&& vFile.exists()) {
|
||||
startSetup(baseDir, false);
|
||||
return;
|
||||
}
|
||||
String message = "(previous basedir " + baseDir + " has to migrate )";
|
||||
|
||||
((BRouterActivity) getContext()).selectBasedir(((BRouterActivity) getContext()).getStorageDirectories(), guessBaseDir(), message);
|
||||
|
@ -608,6 +617,7 @@ public class BRouterView extends View {
|
|||
break;
|
||||
String name = ze.getName();
|
||||
File outfile = new File(path, name);
|
||||
if (!outfile.exists()) {
|
||||
outfile.getParentFile().mkdirs();
|
||||
FileOutputStream fos = new FileOutputStream(outfile);
|
||||
|
||||
|
@ -619,6 +629,7 @@ public class BRouterView extends View {
|
|||
}
|
||||
fos.close();
|
||||
}
|
||||
}
|
||||
is.close();
|
||||
return true;
|
||||
} catch (IOException io) {
|
||||
|
|
Loading…
Reference in a new issue