0

In debug mode the app permissions work perfectly fine. When a signed apk is created with code obfuscation the onRequestPermissionsResult () is not getting called. Its done from Activity. Also targetSdkVersion is 23.

    public void requestStoragePermissions(){

        if (ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.READ_EXTERNAL_STORAGE)
                || ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.WRITE_EXTERNAL_STORAGE)) {

            ActivityCompat.requestPermissions(this, PERMISSIONS_STORAGE, REQUEST_STORAGE_ACCESS);

        }else{

            ActivityCompat.requestPermissions(this, PERMISSIONS_STORAGE, REQUEST_STORAGE_ACCESS);

        }
    }

@Override

public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {

    switch (requestCode) {
    case REQUEST_STORAGE_ACCESS:

        boolean result=PermissionUtil.verifyPermissions(grantResults);
        if(result){
            checkObbIsAlreadyDownloaded();
        }else{
            showPermissionAlert();
        }
        break;
    default:Log.d("APK", "from reader");

    }

}
Midhun Kumar
  • 549
  • 5
  • 23
  • Just out of curiosity why do you have PERMISSIONS_STORAGE outside of the requestStoragePermission function – zombie Nov 28 '16 at 16:16
  • PERMISSION_STORAGE is nothing but an array of permissions that are requested. In this case read and write external storage – Midhun Kumar Nov 28 '16 at 16:37
  • by the way where is your super.onRequestPermissionsResult – zombie Nov 28 '16 at 17:19
  • is this related your issue http://stackoverflow.com/a/35772265/6689101 – zombie Nov 28 '16 at 17:20
  • Is super.onRequestpPermissionsResult valid here.. my activity just implemented the corresponding interface and amm using the method on the same activity.. – Midhun Kumar Nov 28 '16 at 17:28
  • tried removing the code obfuscation/proguard and its working fine in signed apk. Now looking for a way to resolve this in obfuscated apk – Midhun Kumar Nov 29 '16 at 07:14

0 Answers0