# HG changeset patch # User Carl Byington # Date 1654553120 25200 # Node ID 3feac274a27b2a400497080831d7e1d5c82ed0aa # Parent 73fa7329dc879a5747062352936c35c6a8d5bddf updates for android10+ diff -r 73fa7329dc87 -r 3feac274a27b Makefile --- a/Makefile Mon Jun 06 13:01:45 2022 -0700 +++ b/Makefile Mon Jun 06 15:05:20 2022 -0700 @@ -3,7 +3,7 @@ na=$(shell find . -iname '*.c' -o -iname '*.h' -o -iname '*.cpp') style:=release -dest:=../ASM/Installers +dest:=../ASM.v6/installers ver:=$(shell grep versionName app/src/main/AndroidManifest.xml | cut -d'"' -f2) id:=$(shell hg id --id || echo 1) da:=$(shell date '+%Y-%m-%dT%H:%M:%S') diff -r 73fa7329dc87 -r 3feac274a27b app/src/main/AndroidManifest.xml --- a/app/src/main/AndroidManifest.xml Mon Jun 06 13:01:45 2022 -0700 +++ b/app/src/main/AndroidManifest.xml Mon Jun 06 15:05:20 2022 -0700 @@ -26,25 +26,29 @@ + - + + + = Build.VERSION_CODES.M) { String [] perms = {Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, - Manifest.permission.WAKE_LOCK, - Manifest.permission.WRITE_EXTERNAL_STORAGE}; + Manifest.permission.WAKE_LOCK}; checkp(perms); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + if (!Environment.isExternalStorageManager()) { + try { + Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); + intent.addCategory("android.intent.category.DEFAULT"); + intent.setData(Uri.parse(String.format("package:%s",getApplicationContext().getPackageName()))); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(); + intent.setAction(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION); + startActivity(intent); + } + } + } + else { + String [] perms2 = {Manifest.permission.WRITE_EXTERNAL_STORAGE}; + checkp(perms2); + } } // detect HTC Dream and apply special preferences