FreeDroid开发过程中遇到的一些问题
Android Studio混淆:
build.gradle中
123456 buildTypes {release {minifyEnabled trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}minifEnabled 改为 true;
Android Studio 避免混淆第三方lib:
我这里用的是waps的lib,在proguard-rules.pro文件中加入
12345 -dontwarn android.support.**-keep public class cn.waps.** {*;}-keep public interface cn.waps.** {*;}-dontwarn cn.waps.**-ignorewarnings
Drawer的箭头指示器:
使用ToolBar代替ActionBar,添加support-v7的ActionBarDrawerToggle即可。
Drawer覆盖ToolBar:
将ToolBar放入DrawerLayout的第一个子View中即可
获取Root权限并以Root身份执行linux命令的例子:
12345678910111213141516171819202122232425262728 //su权限try {process= Runtime.getRuntime().exec("su");os=new DataOutputStream(process.getOutputStream());is=new DataInputStream(process.getInputStream());os.writeBytes("mount -o remount -o rw /system"+ " \n");//>为覆盖,>>为追加os.writeBytes("echo '"+response+"' > /etc/hosts" + " \n");os.writeBytes(" exit \n");os.flush();InputStreamReader reader=new InputStreamReader(is);StringBuilder builder=new StringBuilder();int ch;while ((ch=reader.read())!=-1){builder.append((char)ch);System.out.print((char)ch);}Log.i("RES",builder.toString());mListener.onComplete();button.setProgress(100);process.waitFor();} catch (IOException e) {e.printStackTrace();} catch (InterruptedException e) {e.printStackTrace();}
Voelly添加Header信息的方法:
Java
123456789101112131415161718192021 StringRequest stringRequest = new StringRequest(Request.Method.GET,hostsUrl,new Response.Listener<String>() {@Overridepublic void onResponse(String response) {}}, new Response.ErrorListener() {@Overridepublic void onErrorResponse(VolleyError error) {Log.e("TAG", error.getMessage(), error);}}){//设置header信息@Overridepublic HashMap<String, String> getHeaders() {HashMap<String, String> params = new HashMap<String, String>();String header="header";params.put("header1", header);return params;}};
FreeDroid开发过程中遇到的一些问题的更多相关文章
- 一些关于angularJS的自己学习和开发过程中遇到的问题及解决办法
这篇文章也许会不定时更新,主要记录这段时间内自己遇到的angularjs学习开发的一些问题的解决办法.本文以摘抄为主,主要目的还是将自己遇到的困惑在各个地方查到的解决办法的汇总,给自己留个备忘吧. 1 ...
- SubSonic3.0 Demo1.0——应用了T4模版可减少开发过程中70%以上的代码量以及80%以上的出错率
应网友的要求,抽了点时间写了这个Demo,希望对2.2版想升级到3.0的朋友或正在使用3.0的朋友有所帮助.大家在使用Demo过程中如果发现什么问题或有什么建议,可以直接将Bug提交给我或告诉我,我会 ...
- web开发过程中经常用到的一些公共方法及操作
进化成为程序猿也有段岁月了,所谓的经验,广度还是依旧,只不过是对于某种功能有了多种实现方式的想法.每天依旧不厌其烦的敲打着代码,每一行代码的回车似乎都有一种似曾相识的感觉.于是乎:粘贴复制,再粘贴再复 ...
- Eclipse开发过程中个VM Arguments的设置
Eclipse开发过程中个VM Arguments的设置 1:jre中的Default VM Arguments: -Xms256M -Xmx640M -XX:PermSize=256m -XX:Ma ...
- 客户关系管理系统(CRM)的开发过程中使用到的开发工具总结
开发<客户关系管理系统(CRM)>软件过程,也就是一个标准的Winform程序的开发过程,我们可以通过这个典型的软件开发过程来了解目前的开发思路.开发理念,以及一些必要的高效率手段.本篇随 ...
- 软件开发过程中的审查 (Review)
http://blog.csdn.net/horkychen/article/details/5035769 软件开发过程中的审查 (Review) 希望别人做些什么->定义出流程 希望别人 ...
- javaweb开发过程中的地址写法
凡是要表示web资源的地址,比如浏览器地址栏中,都是 /凡是要表示硬盘地址, 都是 \ public class ServletDemo1 extends HttpServlet { //实际开发过 ...
- SpringMVC开发过程中的中文乱码问题
相信大家在开发初期遇到中文乱码问题一定是一头雾水,不是数据库乱码了就是页面乱码了或者传值时乱码.其实解决乱码的途径很简单,就是统一编码与解码的类型,我把自己遇到的乱码问题整理出来,希望能够对大家有用. ...
- net开发过程中Bin目录net开发过程中Bin目录下面几种文件
.net开发过程中Bin目录下面几种文件格式的解释 在.NET开发中,我们经常会在bin目录下面看到这些类型的文件: .pdb..xsd..vshost.exe..exe..exe.config..v ...
随机推荐
- JavaScript substring() 方法
定义和用法 substring() 方法用于提取字符串中介于两个指定下标之间的字符. 语法 stringObject.substring(start,stop) 参数 描述 start 必需.一个非负 ...
- 哪些函数不能为virtual函数
1> 内联函数 内联函数是在编译时期展开,而虚函数的特性是运行时才动态联编,所以两者矛盾,不能定义内联函数为虚函数. 2> 构造函数 构造函数用来创建一个新的对象,而虚函数的运行是建立在对 ...
- Codeforces Round #135 (Div. 2)
A. k-String 统计每个字母出现次数即可. B. Special Offer! Super Price 999 Bourles! 枚举末尾有几个9,注意不要爆掉\(long\ long\)的范 ...
- PHP间隔一段时间执行
for ($i=0; $i < 20; $i++) { $m=M('vote'); $rs=$m->order('id')->select(); $randnum=array(0,1 ...
- ExtJS-Viewport背景图片铺满浏览器视图并自动伸缩
var viewport = Ext.create('Ext.container.Viewport', { style : 'background-image:url(login_bj.jpg);ba ...
- apache性能优化
perfork进程数 http://sookk8.blog.51cto.com/455855/275759/ mod_cache 磁盘缓存 http://www.cnblogs.com/fnng/ar ...
- c# webBrowser控件与js的交互
转自:http://blog.csdn.net/sd2131512/article/details/7467564 [System.Runtime.InteropServices.ComVisible ...
- Unable to determine the principal end of an association between the types '***. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.
MVC中数据库表如果是一对一的主键关系时要加[Required]不然会出错Unable to determine the principal end of an association between ...
- 001. 使用ssh连接不上centos 6.5的解决方法及其解决中文乱码
1. 使用ssh连接不上centos 6.5的解决方法: 错误显示: Connecting to 192.168.1.106:22... Could not connect to '192.168.1 ...
- HtmlAgilityPack
http://htmlagilitypack.codeplex.com/wikipage?title=Examples http://nuget.org/packages/HtmlAgilityPac ...