1.操作系统考完了,还有一门就解放了,这周六Xman,好慌。
2.做了一道非常坑爹的android题
攻防世界Mobile的APK逆向-2,坑死人了,好吧,也是我太菜了。
拿到题,安装失败。第一次碰见安装失败的题。
直接上JEB神器吧。
发现这题代码量很大,而且很多函数都不认识,只知道是一个广播。
花了点时间梳理了程序运行流程,根本不知道flag在哪里。。。。直接自闭。
最后只能百度了,才知道AndroidMainifest.xml中有明文?????
然后通过这道题了解一下intent吧。
Intent
主要有4个作用:
- startActivity 启动一个Activity,大多用于跳转界面。
- startService 启动一个Service,菜鸡如我,还没碰到过
- sendBroadcast 发送广播
- Intent-Filter 指定组件
ComponentName | 组件名称 |
Action | 动作 |
Category | 类别 |
Data | 数据 |
Type | MIME类型 |
Extras | 额外 |
Flags | 标记 |
显示Intent
直接使用startActivity,指明需要跳转到哪个Activity。
隐式Intent
通过setAction等设置属性来匹配AndroidMainfest中的Intenet-Filter。
//分享功能就是通过隐式Intent完成的。
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT,"This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data
android:scheme="app"
android:host="test">
</data>
</intent-filter>
<!--
android:scheme="app"表示配置接受的协议为app,相当于http://www.baidu.com中的http或者https
android:host="test"表示配置接受的域名为test,相当于http://www.baidu.com中的www.baidu.com
-->
代码来源:https://blog.csdn.net/xia236326/article/details/81837521