现在的位置: 首页 > 综合 > 正文

从Bundle安全性谈软件和数据的安全性

2019年09月21日 ⁄ 综合 ⁄ 共 1151字 ⁄ 字号 评论关闭

使用Bundleaction可以调用其他应用程序,也可以在大而复杂的项目中解决低藕合度模块的调用。这种调用既简单又具有很好的维护性,不必因为整体架构变化或者内部类名和包名的调整而做过多的修改,因而受到很多人欢迎和支持。

如下:

Intent i = this.getIntent();

        Bundleb = i.getExtras();

        if ( b != null) {

            m_parent_id = b.getString("parent_dev");

        }

        else

        {

            m_parent_id = AppConfig.testId;

        }

 

调用方法:

      intent = new Intent();
            intent.setAction("com.chuangmi.action.SONDEVLIST");
            Bundle bundle = new Bundle();
            bundle.putString("parent_dev", cd.did);
            intent.putExtras(bundle);

 

声明:

<action android:name="com.chuangmi.action.SONDEVLIST" />

      <category android:name="android.intent.category.DEFAULT" />

 

这种方式的调用容易存在隐患,使用相关的方法,可以监听到软件的所有通信和通信数据:

Intent i = this.getIntent();

        Bundleb = i.getExtras();

       

        Iteratoriter = b.keySet().iterator();

        while(iter.hasNext()) {

            Object key = iter.next();

            Log.i("CCCCC","k="+key.toString());

            Object val = b.get((String)key);

            Log.i("CCCCC", "val="+val.toString());

        }

    这样我们可以监听到通信的KEY和相关的值。

 

数据安全性

在Android.manifest的<application 字段中增加一个属性:android:debuggable="true",录其为false时,使用run-as加包名可以读取到应用程序的数据库和存储文件,这对于分析别人的应用十分有用。

抱歉!评论已关闭.