diff --git a/app/release/app-release.apk b/app/release/app-release.apk index 3b8fa39..dbbe6c8 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4f2da29..9482c78 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -10,11 +10,6 @@ - - - , - grantResults: IntArray - ) { - super.onRequestPermissionsResult(requestCode, permissions, grantResults) - if (requestCode == REQUEST_CODE_REQUEST_EXTERNAL_STORAGE && PermissionUtils.requestPermissionsResult( - Manifest.permission.READ_EXTERNAL_STORAGE, - permissions, - grantResults - ) - ) { - startPickPhoto() - } - } - private fun getContext() = this /** @@ -157,26 +139,14 @@ class MainActivity : AppCompatActivity() { private fun pickPhotoClicked(isQRCode: Boolean) { this.isQrCode = isQRCode - if (PermissionUtils.checkPermission( - getContext(), - Manifest.permission.READ_EXTERNAL_STORAGE - ) - ) { - startPickPhoto() - } else { - PermissionUtils.requestPermission( - this, - Manifest.permission.READ_EXTERNAL_STORAGE, - REQUEST_CODE_REQUEST_EXTERNAL_STORAGE - ) - } + startPickPhoto() } /** * 选择照片 - 条形码/二维码 图片识别 */ private fun startPickPhoto() { - val pickIntent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI) + val pickIntent = Intent(Intent.ACTION_PICK) pickIntent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*") startActivityForResult(pickIntent, REQUEST_CODE_PHOTO) } @@ -208,8 +178,7 @@ class MainActivity : AppCompatActivity() { companion object { const val REQUEST_CODE_PHOTO = 1 - const val REQUEST_CODE_REQUEST_EXTERNAL_STORAGE = 2 - const val REQUEST_CODE_SCAN_CODE = 3 + const val REQUEST_CODE_SCAN_CODE = 2 } } \ No newline at end of file