REMOVE MANAGER STORAGE PERMISSIONS

This commit is contained in:
gabriel 2024-02-03 01:36:55 -04:00
parent bf9ac28770
commit e57755d866
3 changed files with 1 additions and 15 deletions

View file

@ -2,10 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage"/>
<uses-feature
android:required="true"
android:glEsVersion="0x0030001"/>

View file

@ -34,16 +34,6 @@ public class MainActivity extends BaseActivity implements NavigationBarView.OnIt
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (!Environment.isExternalStorageManager()) {
Intent intent = new Intent(ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
startActivity(intent);
}
} else {
ActivityCompat.requestPermissions(this, new String[] {READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);
ActivityCompat.requestPermissions(this, new String[] {WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);
}
setContentView(R.layout.activity_main);
NavigationBarView bar = findViewById(R.id.navigation);

View file

@ -49,7 +49,7 @@ public class GamesFragment extends Fragment implements ActivityResultCallback<Ur
if (result != null) {
String uri = result.toString();
if (GameUtils.findByRomPath(uri) == null) {
if (FileUtils.obtainRealPath(uri) == null) {
if (!FileUtils.exists(uri)) {
Toast.makeText(getContext(), "Invalid file path", Toast.LENGTH_LONG).show();
return;
}