微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

安卓安全 |恶意行为或用户数据政策 | androidx.fragment.app.FragmentActivity.startActivityForResult

如何解决安卓安全 |恶意行为或用户数据政策 | androidx.fragment.app.FragmentActivity.startActivityForResult

最近,由于安全漏洞意图重定向,我的应用更新被拒绝。根据 Google Play 控制台 - 安全警报。以下是错误

您的应用包含意图重定向漏洞。请参阅此波纹管邮件

androidx.fragment.app.FragmentActivity.startActivityForResult

enter image description here

几天后我们可以聊天客户支持发送一封邮件

enter image description here

我更新了gradel文件中的所有依赖项。清单更改导出:“假”后,我们正在使用相机和图库以及外部文档上传我检查 Android 网站更新所有内容,但我没有发现任何可疑代码。请帮我解决这个问题以获取更多详细信息,请在下面添加我的 gradle 和清单文件

gradle 应用插件:'com.android.application' 应用插件:'com.google.gms.google-services'

安卓{

compileSdkVersion 30

defaultConfig {
    applicationId "com.example.flowerbazaarseller"
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 30
    versionName "1.14"

    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    debug {
        debuggable false
    }

    release {
        shrinkResources false
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
        signingConfig signingConfigs.release
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
    checkReleaseBuilds false
}
}

 dependencies {
      implementation filetree(dir: "libs",include: ["*.jar"])
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
      implementation 'androidx.recyclerview:recyclerview:1.2.0'
      implementation 'androidx.viewpager:viewpager:1.0.0'

//JUnit
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

//swipeRefresh
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

//material theme
implementation 'com.google.android.material:material:1.4.0-alpha02'

//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2'

//Compressor
implementation 'id.zelory:compressor:3.0.1'

//CropImage
//noinspection GradleDynamicVersion
api 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'com.github.yalantis:ucrop:2.2.6'

//Glide
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'


//OTP retriever
//implementation 'com.google.android.gms:play-services-auth:19.0.0'
//implementation 'com.google.android.gms:play-services-auth-api-phone:17.5.0'

//Dexter Permission handler
implementation 'com.karumi:dexter:6.2.2'

//lottie animation
implementation 'com.airbnb.android:lottie:3.6.1'

//firebase
implementation platform('com.google.firebase:firebase-bom:25.12.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging:21.1.0'
implementation 'com.google.firebase:firebase-database:19.7.0'

//multi-dex
implementation 'com.android.support:multidex:1.0.3'

//play-core-library
implementation 'com.google.android.play:core:1.10.0'

//Pdf viewer
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
implementation 'com.mindorks.android:prdownloader:0.6.0'

//Easy Image (using take images and fetch gallery)
implementation 'com.github.jkwiecien:EasyImage:3.2.0'

}

这是我添加清单文件的权限:

    <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-feature
    android:name="android.hardware.camera"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.autofocus"
    android:required="false" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECORD_AUdio" />
<uses-permission android:name="android.permission.BLUetoOTH" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<queries>
    <!-- Camera -->
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>

    <!-- gallery -->
    <intent>
        <action android:name="android.intent.action.PICK" />

        <data android:mimeType="vnd.android.cursor.dir/image" />
    </intent>

    <!-- Document -->
    <intent>
        <action android:name="android.intent.action.PICK" />

        <data android:mimeType="vnd.android.cursor.dir/application" />
    </intent>
</queries>

相机:

Intent takePicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePicture.resolveActivity(getPackageManager()) != null) {
         tartActivityForResult(takePicture,CAMERA_REQ_CODE);
 }

图库:

Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    intent.setType("image/*");
    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,false);
    intent.setAction(Intent.ACTION_GET_CONTENT);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivityForResult(Intent.createChooser(intent,"select Picture"),PICK_galLERY_IMAGE);
    }

文档:

Intent chooseFile = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    chooseFile.setType("application/*");
    chooseFile.addCategory(Intent.CATEGORY_OPENABLE);
    chooseFile.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    startActivityForResult(chooseFile,PICK_FILE_REQUEST_CODE);

上面我添加了我所有的代码片段,你能检查一次吗,请告诉我问题出在哪里。

谢谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。