Android 如何使用hack限制数据库写入;adb shell内容插入--uricontent://com.xxxxxx"
我的应用程序的数据库易受攻击,恶意代码可能会向数据库注入错误消息 如何通过“adb shell内容插入--uri”使其安全content://com.XXX" ? --束缚 我在下面的舱单上试过了Android 如何使用hack限制数据库写入;adb shell内容插入--uricontent://com.xxxxxx",android,android-contentprovider,android-permissions,Android,Android Contentprovider,Android Permissions,我的应用程序的数据库易受攻击,恶意代码可能会向数据库注入错误消息 如何通过“adb shell内容插入--uri”使其安全content://com.XXX" ? --束缚 我在下面的舱单上试过了 <provider android:name=".provider.MyProvider" android:authorities="com.example.data" android:exported="false" android:gr
<provider android:name=".provider.MyProvider"
android:authorities="com.example.data"
android:exported="false"
android:grantUriPermissions="false"
android:protectionLevel="signature"/>
谢谢
作为改进,我也尝试了这一点(在清单中):
来自PC的ADB命令仍然能够在我的应用程序的数据库中插入消息。
没有任何protectionLevel属性。您需要的是通过许可保护您的提供商
定义一个
,并让您的提供商要求它
(
确实有一个protectionLevel属性,我想你把这两个元素弄混了)我必须在清单文件中对应用程序进行以下更改,并对其进行签名和预加载,结果成功了:
<permission
android:name="com.xx.yy_DB_WRITE_PERMISSION"
android:label="xxyyDB"
android:protectionLevel="signature" />
<provider android:name=".provider.ZZProvider"
android:writePermission = "com.xx.yy_DB_WRITE_PERMISSION"
android:exported="false"/>
我仍然无法正确理解,请您详细说明一下,您以什么方式无法正确理解?如果你说你尝试过什么,结果是什么,这会有很大帮助!
<permission
android:name="com.xx.yy_DB_WRITE_PERMISSION"
android:label="xxyyDB"
android:protectionLevel="signature" />
<provider android:name=".provider.ZZProvider"
android:writePermission = "com.xx.yy_DB_WRITE_PERMISSION"
android:exported="false"/>