【0077】【项目实战】-【手机安全卫士】-【17】流量统计-application-代码混淆

1.【流量数据获取的原理】获取手机所有应用的相关信息

【增加uid的效果】

2.流量统计的api

 

3. 抽屉实现

3.1 抽屉的效果

【说明】此控件只具备从下向上,从右向左拖拽,别的效果不可以;

 

3.2【布局源码】

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:orientation="vertical" >
 6     
 7     <!-- android:handle="@+id/handler"把手 -->
 8     <!-- android:content="@+id/content"抽屉 -->
 9     <!-- vertical由下往上拖拽 -->
10     <!-- horizontal水平拖拽 -->
11     <View
12         android:layout_width="wrap_content"
13         android:layout_height="200dp">
14     </View>
15     <SlidingDrawer 
16         android:handle="@+id/handler"
17         android:content="@+id/content"
18         android:orientation="vertical"
19         android:layout_width="match_parent"
20         android:layout_height="match_parent">
21         <ImageView 
22             android:id="@id/handler"
23             android:background="@drawable/ic_launcher"
24             android:layout_width="wrap_content"
25             android:layout_height="wrap_content"/>
26         <!-- TextView可以修改为其余的一下空间,用于展示不同的抽屉效果 -->
27         <TextView 
28             android:id="@id/content"
29             android:background="#f00"
30             android:layout_width="match_parent"
31             android:layout_height="match_parent"/>
32     </SlidingDrawer>
33 </LinearLayout>

 

 【拖拽到一半时的效果】使用别的控件将上半部分占住不动;

 

4.application使用

4.1【说明】下面的所有的Activity、Receiver、等都在application节点下;

                因此:使用Application类就可以管理所有的程序中出现的异常;

4.2 源码书写

【异常的放置】

【捕获异常】

【测试】捕获之后的异常为黄色(未捕获为红色),并且打印出了异常捕获时打印的信息;

【说明】将捕获的异常放置到sd卡的文件中;

 

5.代码混淆

5.1 代码不混淆

【签名文件】打包生成签名文件;

【说明】使用已经有的签名文件;

【说明】有效期50年;

【说明】生成之后解压缩

【说明】执行反编译指令

 

【查看到的源码】

5.2 混淆

【说明】等待将APP上线之后,在用户的手机端不存在此txt文件;

 【修改】将此文件放置到项目的目录下,将目录修改好;

【说明】混淆之后的代码

 

 

posted @ 2018-02-23 13:24  OzTaking  阅读(294)  评论(0)    收藏  举报