1***@qq.com
1***@qq.com
  • 发布:2020-09-16 17:14
  • 更新:2024-03-06 16:50
  • 阅读:3193

【报Bug】activity组件暴露检测存在导出,我加上android:exported="false"之后app无法启动,点击无效

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 2.8.11

手机系统: Android

手机系统版本号: Android 7.0

手机厂商: 魅族

手机机型: pro7plus

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

如上bug描述

预期结果:

可以合理解决安全漏洞扫描

实际结果:

app无法启动

bug描述:

在AndroidManifest.xml 默认是这样的:

<activity android:configChanges="fontScale|keyboard|keyboardHidden|mcc|mnc|orientation|screenSize" android:hardwareAccelerated="true" android:label="@string/app_name" android:name="io.dcloud.PandoraEntry" android:screenOrientation="portrait" android:theme="@style/DCloudTranslucentTheme" android:windowSoftInputMode="adjustResize">  
            <intent-filter>  
                <action android:name="android.intent.action.MAIN"/>  
                <category android:name="android.intent.category.LAUNCHER"/>  
            </intent-filter>  
            <intent-filter>  
                <action android:name="android.intent.action.VIEW"/>  
                <category android:name="android.intent.category.DEFAULT"/>  
                <category android:name="android.intent.category.BROWSABLE"/>  
                <data android:scheme="unicccb778"/>  
            </intent-filter>  
        </activity>

这种默认的 安全扫描的时候回有高危漏洞提示: 开发者自查,设置AndroidManifest.xml文件中Activity组件EXPORTED属性为false,对于必须导出的组件必须限制于授权用户或者特定应用组件,并且尽量不包含任何的Intent Filter。
于是,我加上了android:exported="false" ,结果为:

<activity android:exported="false" android:configChanges="fontScale|keyboard|keyboardHidden|mcc|mnc|orientation|screenSize" android:hardwareAccelerated="true" android:label="@string/app_name" android:name="io.dcloud.PandoraEntry" android:screenOrientation="portrait" android:theme="@style/DCloudTranslucentTheme" android:windowSoftInputMode="adjustResize">  
            <intent-filter>  
                <action android:name="android.intent.action.MAIN"/>  
                <category android:name="android.intent.category.LAUNCHER"/>  
            </intent-filter>  
            <intent-filter>  
                <action android:name="android.intent.action.VIEW"/>  
                <category android:name="android.intent.category.DEFAULT"/>  
                <category android:name="android.intent.category.BROWSABLE"/>  
                <data android:scheme="unicccb778"/>  
            </intent-filter>  
        </activity>

这个时候安全漏洞扫描通过了,但是apk装到手机上点击没有反应,app启动不了

2020-09-16 17:14 负责人:无 分享
已邀请:

最佳回复

DCloud_Android_THB

DCloud_Android_THB

入口activity需要 android:exported="true" ,此问题是比较老的sdk版本,现在的版本已添加export。

  • 风靡万千少女

    比较老的sdk版本,我是云打包的 也没说哪块能选SDK么,还是说云打包用的sdk都比较老

    2023-03-03 08:54

  • DCloud_Android_THB

    回复 3***@qq.com: 现在的打包是没这个问题的,如果你有这个问题,发我你的appid我给你看看

    2023-03-03 11:11

szg

szg

你是加在那个位置的

一枚工程师

一枚工程师

同问,加在哪个位置,云打包可用吗?

  • 不小心

    请问云打包解决了吗?

    2023-10-24 09:02

默1226

默1226

同问

风靡万千少女

风靡万千少女

有没有大佬知道这个问题解决了没有,加了可以成功嘛?

爪哇国北部人士

爪哇国北部人士 - 没啥

我是用的本地打包也是有这个问题:

开发者自查,设置AndroidManifest.xml文件中Activity组件
EXPORTED属性为false,对于必须导出的组件必须限制于授权
用户或者特定应用组件,并且尽量不包含任何的Intent
Filter。

要回复问题请先登录注册