AndroidManinfest.xml 基线检测


AndroidManinfest.xml信息

1.AndroidManinfest.xml是APK的主配置文件;

2.每个APK的根目录都包含一个AndroidManinfest.xml文件;

3.Manifest文件为Android System提供有关于该APK的基本信息,Android System必须得获得这些信息才能运行该APK代码;

Maninfest里面常见的属性

  • 包名属性
package="com.mysticbinary.test" //唯一包名
  • 版本属性
android:versionCode="1"  //给设备程序识别的版本号
android:versionName="1.0" //给用户看的版本号
  • 支持的SDK范围
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
  • 名字、icon、主题、备份数据属性
<application
    android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    android:label="应用名字"
    android:theme="@style/AppTheme">
  • 组件注册属性
<application>
    <activity>...<activity>
    <service></service>
    <receiver></receiver>
    <provider> </provider> 
</application>
  • 权限属性
<uses-permission android:name="android.permission.INTERNET" />
  • 托管应用组件的进程

  • 列出Instrumentation类(插桩)

  • 列出应用必须链接的库

Manifest配置不当类的风险

Manifest是Andriod攻击门槛最低的入口。

程序可被任意调试

android:debuggable="true"

安全的配置是设置为false

程序数据任意备份

android:allowBackup="true"

安全的配置是设置为flase

Activity组件暴露

android:exported="true"

<activity android:name="com.xxx.xxx.xxx.activity.SettingActivity" android:exported="false" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan"/>

<activity android:name="com.xxx.xxx.account.activity.LoginActivity" android:exported="false" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan"/>

<activity android:name="com.xxx.xxx.home.MainHomeActivity" android:exported="false" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan"/>

安全的配置是设置为false,不允许外部组件进行调用。

如果有需求要对外部交互的组件,应当添加一下访问权限的控制。 在有权限后外部程序才可以开启,或者提供特定的action过滤器达到启动目的。
还需要要对传递的数据进行安全的校验,不符合规则的一律不处理。

Service组件暴露

<service
            android:name="com.xxx.app.service.DaemonService"
            android:exported="true"
            android:process=":pushservice" />

安全的配置是设置为false,不允许外部组件进行调用。

如果有需求要对外部交互的组件,应当添加一下访问权限的控制。

ContentProvider组件暴露

android:exported="true"

<contentProvider
            android:name="com.tencent.connect.common.AssistActivity"
            android:exported="true" />

安全的配置是设置为false,不允许外部组件进行调用。

如果有需求要对外部交互的组件,应当添加一下访问权限的控制。

BroadcastReceiver组件暴露

android:exported="true"

<broadcastReceiver
            android:name="com.tencent.connect.common.AssistActivity"
            android:exported="true" />

安全的配置是设置为false,不允许外部组件进行调用。

如果有需求要对外部交互的组件,应当添加一下访问权限的控制。

Intent Scheme URL攻击

<activity
   android:name=".SchemeActivity"
   android:label="@string/app_name">
   <!-- 要想在别的App上能成功调起App,必须添加intent过滤器 -->
       <!-- 协议部分,随便设置 -->
       <intent-filter>
           <!--协议部分,随便设置-->
           <data android:scheme="scheme" android:host="mtime" android:path="/goodsDetail" />
           <!--下面这几行也必须得设置-->
           <category android:name="android.intent.category.DEFAULT"/>
           <action android:name="android.intent.action.VIEW"/>
           <category android:name="android.intent.category.BROWSABLE"/>
       </intent-filter>
</activity>

设置Scheme协议之后,可以通过浏览器打开对应的Activity。

转载于:https://www.cnblogs.com/mysticbinary/articles/10605592.html

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值