東川印記

一本東川,笑看爭龍斗虎;寰茫兦者,度橫佰昧人生。

android源码编译10之开搞问题汇总

2015年8月5日星期三



1,写个外部应用鉴权的代理
/home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base/core/java/android/os/IAuthenticationService.aidl
定义
① boolean authentication(String source,int versioncode,Map<String,String> map);
报错
frameworks/base/core/java/android/os/IAuthenticationService.aidl:11 parameter map (3) unknown type Map<String,String>;
看起来不能这么写。

②Map<String,String>? authentication(String source,int versioncode);
报错
frameworks/base/core/java/android/os/IAuthenticationService.aidl:11 unknown return type Map<String,String>
定义成返回也不行

③Map authentication(String source,int versioncode);
可以编译。
单纯一个类型看来是可以的。

④boolean authentication(String source,int versioncode,Map map);
报错
frameworks/base/core/java/android/os/IAuthenticationService.aidl:11 parameter 3: 'Map map' can be an out parameter, so you must declare it as in, out or inout.
理解:传入的不是基本类型,需要定义方向。原意貌似是Map是外部参数。

⑤boolean authentication(String source,int versioncode,in Map map);
可以编,为所需结果。

谷歌说
  1. ??? AIDL使用简单的语法来声明接口,描述其方法以及方法的参数和返回值。这些参数和返回值可以是任何类型,甚至是其他AIDL生成的接口。
  2. ??? 其中对于Java编程语言的基本数据类型 (int, long, char, boolean等),String和CharSequence,集合接口类型List和Map,不需要import 语句。
  3. ??? 而如果需要在AIDL中使用其他AIDL接口类型,需要import,即使是在相同包结构下。AIDL允许传递实现Parcelable接口的类,需要 import.
  4. ??? 需要特别注意的是,对于非基本数据类型,也不是String和CharSequence类型的,需要有方向指示,包括in、out和inout,in表示 由客户端设置,out表示由服务端设置,inout是两者均可设置。
  5. ??? AIDL只支持接口方法,不能公开static变量。

2,修改framework下的资源文件如何编译并发布到真机
以前见到这个方法一直搞不明白有什么用,现在有了真机突然就懂了。
①资源文件编译
改了资源文件,在资源文件根目录编译
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/frameworks/base/core/res$ mm
编译完成后得到
  1. /home/senrsl/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework/framework-res.apk
并且会在/home/senrsl/android/source/WORKING_DIRECTORY/out/target/common /R/com/android/internal/R.java
中生成引用。
然后需要编译framework.jar

②systemservice编译
services下面有修改,需要编译
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/frameworks/base/services/java$ mm
编译得
  1. Install: out/target/product/deb/system/framework/services.jar

  1. /home/senrsl/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework/services.jar

③framework.jar编译
编译完资源文件需要编译framework.jar才可正常引用
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/frameworks/base$ mm
  2. Install: out/target/product/deb/system/framework/framework2.jar
  3. Install: out/target/product/deb/system/framework/framework.jar

④发布到真机
先挂载,再push上去
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$ adb remount
  2. remount failed: Permission denied
  3. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$ adb root
  4. restarting adbd as root
  5. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$ adb remount
  6. remount succeeded
  7. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$ adb push framework-res.apk /system/framework/
  8. 5966 KB/s (15180530 bytes in 2.484s)
  9. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$ adb push framework.jar /system/framework/
  10. 4587 KB/s (3665949 bytes in 0.780s)
  11. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$ adb push framework2.jar /system/framework/
  12. 4115 KB/s (582366 bytes in 0.138s)
  13. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$ adb push services.jar /system/framework/
  14. 4759 KB/s (1422754 bytes in 0.291s)

  15. #查看一下有没有push成功
  16. senrsl@senrsl-ubuntu:~$ adb shell
  17. root@deb:/ # cd /system/framework/????????????????????????????????????????????
  18. root@deb:/system/framework # ll
  19. -rw-r--r-- root???? root??????? 19315 2015-04-29 14:06 am.jar
  20. -rw-r--r-- root???? root?????? 108086 2015-04-29 14:06 android.policy.jar
  21. -rw-r--r-- root???? root??????? 74045 2015-04-29 14:07 android.test.runner.jar
  22. -rw-r--r-- root???? root?????? 549364 2015-04-29 13:51 apache-xml.jar
  23. -rw-r--r-- root???? root???????? 6683 2015-04-29 14:06 bmgr.jar
  24. -rw-r--r-- root???? root?????? 408524 2015-04-29 13:51 bouncycastle.jar
  25. -rw-r--r-- root???? root???????? 2726 2015-04-29 14:06 bu.jar
  26. -rw-r--r-- root???? root???????? 2833 2015-04-29 14:06 com.android.future.usb.accessory.jar
  27. -rw-r--r-- root???? root???????? 8507 2015-04-29 14:06 com.android.location.provider.jar
  28. -rw-r--r-- root???? root???????? 4590 2015-04-29 14:06 com.android.media.remotedisplay.jar
  29. -rw-r--r-- root???? root?????? 145340 2015-04-29 14:07 conscrypt.jar
  30. -rw-r--r-- root???? root???????? 7716 2015-04-29 14:06 content.jar
  31. -rw-r--r-- root???? root??????? 11711 2015-04-29 13:51 core-junit.jar
  32. -rw-r--r-- root???? root????? 1233657 2015-04-29 13:51 core-libart.jar
  33. -rw-r--r-- root???? root????? 1231415 2015-04-29 13:51 core.jar
  34. -rw-r--r-- root???? root????? 1222968 2015-04-29 13:51 ext.jar
  35. -rw-rw-rw- root???? root???? 15180530 2015-05-04 15:16 framework-res.apk
  36. -rw-r--r-- root???? root????? 3665398 2015-04-29 14:06 framework.jar
  37. -rw-r--r-- root???? root?????? 582366 2015-04-29 14:05 framework2.jar
  38. -rw-r--r-- root???? root???????? 3373 2015-04-29 14:06 ime.jar
  39. -rw-r--r-- root???? root???????? 4703 2015-04-29 14:06 input.jar
  40. -rw-r--r-- root???? root??????? 25677 2015-04-29 14:06 javax.obex.jar
  41. -rw-r--r-- root???? root???????? 4205 2015-04-29 14:06 media_cmd.jar
  42. -rw-r--r-- root???? root??????? 52418 2015-04-29 14:07 mms-common.jar
  43. -rw-r--r-- root???? root??????? 48970 2015-04-29 14:06 monkey.jar
  44. -rw-r--r-- root???? root??????? 90315 2015-04-29 13:51 okhttp.jar
  45. -rw-r--r-- root???? root??????? 17499 2015-04-29 14:06 pm.jar
  46. -rw-r--r-- root???? root???????? 4247 2015-04-29 14:06 requestsync.jar
  47. -rw-r--r-- root???? root????? 1422445 2015-04-29 14:07 services.jar
  48. -rw-r--r-- root???? root???????? 4115 2015-04-29 14:06 settings.jar
  49. -rw-r--r-- root???? root???????? 4620 2015-04-29 14:06 svc.jar
  50. -rw-r--r-- root???? root?????? 487562 2015-04-29 14:07 telephony-common.jar
  51. -rw-r--r-- root???? root??????? 46298 2015-04-29 14:07 uiautomator.jar
  52. -rw-r--r-- root???? root??????? 68034 2015-04-29 14:08 voip-common.jar
  53. drwxr-xr-x root???? root????????????? 2015-04-29 13:49 webview
  54. -rw-r--r-- root???? root?????? 262847 2015-04-29 15:48 webviewchromium.jar
  55. -rw-r--r-- root???? root???????? 3411 2015-04-29 14:06 wm.jar
  56. root@deb:/system/framework # ll
  57. -rw-r--r-- root???? root??????? 19315 2015-04-29 14:06 am.jar
  58. -rw-r--r-- root???? root?????? 108086 2015-04-29 14:06 android.policy.jar
  59. -rw-r--r-- root???? root??????? 74045 2015-04-29 14:07 android.test.runner.jar
  60. -rw-r--r-- root???? root?????? 549364 2015-04-29 13:51 apache-xml.jar
  61. -rw-r--r-- root???? root???????? 6683 2015-04-29 14:06 bmgr.jar
  62. -rw-r--r-- root???? root?????? 408524 2015-04-29 13:51 bouncycastle.jar
  63. -rw-r--r-- root???? root???????? 2726 2015-04-29 14:06 bu.jar
  64. -rw-r--r-- root???? root???????? 2833 2015-04-29 14:06 com.android.future.usb.accessory.jar
  65. -rw-r--r-- root???? root???????? 8507 2015-04-29 14:06 com.android.location.provider.jar
  66. -rw-r--r-- root???? root???????? 4590 2015-04-29 14:06 com.android.media.remotedisplay.jar
  67. -rw-r--r-- root???? root?????? 145340 2015-04-29 14:07 conscrypt.jar
  68. -rw-r--r-- root???? root???????? 7716 2015-04-29 14:06 content.jar
  69. -rw-r--r-- root???? root??????? 11711 2015-04-29 13:51 core-junit.jar
  70. -rw-r--r-- root???? root????? 1233657 2015-04-29 13:51 core-libart.jar
  71. -rw-r--r-- root???? root????? 1231415 2015-04-29 13:51 core.jar
  72. -rw-r--r-- root???? root????? 1222968 2015-04-29 13:51 ext.jar
  73. -rw-rw-rw- root???? root???? 15180530 2015-05-04 15:16 framework-res.apk
  74. -rw-rw-rw- root???? root????? 3665949 2015-05-04 15:33 framework.jar
  75. -rw-rw-rw- root???? root?????? 582366 2015-05-04 15:33 framework2.jar
  76. -rw-r--r-- root???? root???????? 3373 2015-04-29 14:06 ime.jar
  77. -rw-r--r-- root???? root???????? 4703 2015-04-29 14:06 input.jar
  78. -rw-r--r-- root???? root??????? 25677 2015-04-29 14:06 javax.obex.jar
  79. -rw-r--r-- root???? root???????? 4205 2015-04-29 14:06 media_cmd.jar
  80. -rw-r--r-- root???? root??????? 52418 2015-04-29 14:07 mms-common.jar
  81. -rw-r--r-- root???? root??????? 48970 2015-04-29 14:06 monkey.jar
  82. -rw-r--r-- root???? root??????? 90315 2015-04-29 13:51 okhttp.jar
  83. -rw-r--r-- root???? root??????? 17499 2015-04-29 14:06 pm.jar
  84. -rw-r--r-- root???? root???????? 4247 2015-04-29 14:06 requestsync.jar
  85. -rw-rw-rw- root???? root????? 1422754 2015-05-04 15:29 services.jar
  86. -rw-r--r-- root???? root???????? 4115 2015-04-29 14:06 settings.jar
  87. -rw-r--r-- root???? root???????? 4620 2015-04-29 14:06 svc.jar
  88. -rw-r--r-- root???? root?????? 487562 2015-04-29 14:07 telephony-common.jar
  89. -rw-r--r-- root???? root??????? 46298 2015-04-29 14:07 uiautomator.jar
  90. -rw-r--r-- root???? root??????? 68034 2015-04-29 14:08 voip-common.jar
  91. drwxr-xr-x root???? root????????????? 2015-04-29 13:49 webview
  92. -rw-r--r-- root???? root?????? 262847 2015-04-29 15:48 webviewchromium.jar
  93. -rw-r--r-- root???? root???????? 3411 2015-04-29 14:06 wm.jar
  94. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/out/target/product/deb/system/framework$

3,类 aidl 是公共的,应在名为 aidl.java 的文件中声明
错误
  1. out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/vsf/IDataManagerService.java:10: 类 aidl 是公共的,应在名为 aidl.java 的文件中声明
  2. public interface aidl extends android.os.IInterface
  3. 。。。。
  4. make: *** [out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/classes-full-debug.jar] 错误 41
解决
找了半天发现是缓存,把out/target/common/obj/JAVA_LIBRARIES/framework- base_intermediates/目录删掉就好

又把那个类放回去,发现还是报这个错误。。。。
找了半天,发现类名多些了aidl.....
正常应该是这样
  1. interface IDataManagerService{...}
写成了这样
  1. interface IDataManagerService.aidl{...)
4,还是aidl问题,不支持重构
frameworks/base/core/java/android/vsf/IDataManagerService.aidl:20 attempt to redefine method appConfigSelect,
frameworks/base/core/java/android/vsf/IDataManagerService.aidl:19??? previously defined here.
以前是这样
  1. ???? AppConfig appConfigSelect(String packageName,int versionCode);
  2. ?????? AppConfig appConfigSelect(int id);
改成这样
  1. ???? AppConfig appConfigSelect(String packageName,int versionCode);
  2. ???? AppConfig appConfigFindById(int id);

5,05-07 14:05:57.190: E/AndroidRuntime(1627): java.lang.IllegalStateException: Could not execute method of the activity
空指针
,顺着找发现初始化报错。

6,/android422/frameworks/base/services/java/com/android /server/vsf/db/DBOpenHelper.java里面定义创建的数据库,默认路径为
  1. root@deb:/data/system # ll | grep "dc"
  2. -rw-rw---- system?? system????? 20480 2015-05-07 15:19 dc.db
  3. -rw------- system?? system????? 12824 2015-05-07 15:19 dc.db-journal
7,eclipse频繁崩溃,跟以前错误不一样了呢,这次报Bad brace found... omitting!
eclipse崩溃是一个困扰多年的问题,自从使用了x64位的ubuntu就开始频繁出现,错误提示五花八门,难以解决。
貌似试到一个可行方案
到eclipse官网下载eclipse classic版本,然后在eclipse market下载adt插件,配置上,这样好像就不崩了!!!
2015年05月25日16:33:06 运行了半天都没崩,要是google官方的adt eclipse早就崩了不知道多少次了。

8,系统服务里面创建sp文件报错。
/android422/frameworks/base/services/java/com/android/server/vsf/db /SharePreferencesUtils.java文件
写入报错
05-08 10:37:37.088: E/SharedPreferencesImpl(692): Couldn't create directory for SharedPreferences file shared_prefs/sp.xml


9,报错05-14 16:41:17.915: E/AndroidRuntime(2051): Caused by: java.lang.IllegalArgumentException: Unknown pattern character 'Y'
找不到具体代码,就想是哪用到了大写的Y。。。。是这儿
  1. return new SimpleDateFormat("YYYY-MM-DD HH:mm:ss").format(new Date());
这绝对是个失误!
这么写就对了
  1. return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
10,打包android.jar用以第三方应用开发。
错误build/core/main.mk:662: *** : Module 'init.qcom.class_main.sh' in PRODUCT_PACKAGES has nothing to install!。 停止。
build/core/main.mk:662: *** : Module 'secondHallo' in PRODUCT_PACKAGES has nothing to install!。 停止。
查看报错的地方
  1. # Don't include any GNU targets in the SDK.? It's ok (and necessary)
  2. # to build the host tools, but nothing that's going to be installed
  3. # on the target (including static libraries).
  4. ifdef is_sdk_build
  5. ? target_gnu_MODULES := \
  6. ????????????? $(filter \
  7. ????????????????????? $(TARGET_OUT_INTERMEDIATES)/% \
  8. ????????????????????? $(TARGET_OUT)/% \
  9. ????????????????????? $(TARGET_OUT_DATA)/%, \
  10. ????????????????????????????? $(sort $(call get-tagged-modules,gnu)))
  11. ? $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d)))
  12. ? modules_to_install := \
  13. ????????????? $(filter-out $(target_gnu_MODULES),$(modules_to_install))
  14. ? # Ensure every module listed in PRODUCT_PACKAGES* gets something installed
  15. ? # TODO: Should we do this for all builds and not just the sdk?
  16. ? $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \?? #line 662
  17. ??? $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
  18. ????? $(error $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES has nothing to install!)))
  19. ? $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG), \
  20. ??? $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
  21. ????? $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_DEBUG has nothing to install!)))
  22. ? $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG), \
  23. ??? $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
  24. ????? $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_ENG has nothing to install!)))
  25. ? $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS), \
  26. ??? $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
  27. ????? $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_TESTS has nothing to install!)))
  28. endif
解决:
之前在/home/senrsl/android/source/WORKING_DIRECTORY/build/target /product/emulator.mk里的PRODUCT_PACKAGES += \里加了secondHallo,删掉这句就过了。

11,还是上面那个
报错
  1. Install: out/host/linux-x86/framework/liblzf.jar
  2. ## Running sdk/eclipse/scripts/create_all_symlinks.sh
  3. ### Starting tools/base: gradlew publishLocal
  4. sdk/eclipse/scripts/create_all_symlinks.sh: 第 285 行: cd: tools/base: 没有那个文件或目录
  5. make: *** [out/host/linux-x86/obj/EXECUTABLES/monitor_intermediates/monitor] 错误 1
tools/目录下只有external目录,没有base,在映射/home/senrsl/android/source /WORKING_DIRECTORY/.repo/manifest.xml里确有
  1. ?<project path="tools/base" name="platform/tools/base" groups="notdefault,tools" />
谷歌一下,尝试
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ repo init -g all
  2. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ repo sync
很痛苦的sync之后,终于
### sdk/eclipse/scripts/create_all_symlinks.sh done

12,还是上面那个,跑着跑着报未知tag CreateTime
错误
  1. frameworks/base/core/java/android/vsf/manager/DataManager.java:31: error 103: Unknown tag: @Package:
  2. frameworks/base/core/java/android/vsf/manager/DataManager.java:33: error 103: Unknown tag: @CreateTime:
  3. frameworks/base/core/java/android/vsf/manager/InfoCollectManager.java:27: error 103: Unknown tag: @ClassName:
  4. frameworks/base/core/java/android/vsf/manager/InfoCollectManager.java:30: error 103: Unknown tag: @Package:
  5. frameworks/base/core/java/android/vsf/manager/InfoCollectManager.java:32: error 103: Unknown tag: @CreateTime:
  6. DroidDoc took 92 sec. to write docs to out/target/common/docs/offline-sdk
  7. make: *** [out/target/common/docs/offline-sdk-timestamp] 错误 45
这是自定义的类,标签生成于eclipse。
有两个办法
第一个:给javadoc增加标签,也就是author那种方式,官方是这么说得
http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#tagexamples
示例
这样的话就要找android里调用javadoc命令的地方,然后加参数。


第二种:自定义注解,也就是Override那种方式,类似于这样
/home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base/core/java/android/annotation/TargetApi.java
或者这样
/home/senrsl/android/source/WORKING_DIRECTORY/libcore/luni/src/main/java/java/lang/Override.java
好吧,经测试,这方法不行。。。。。


经过四个多小时的浪费,研究发现,
①在命令里直接javadoc会警告过去,但是android的make sdk会报错;
②如果是要自定义的tag的话,需要加".",否则还是会警告;

实际的是这样弄:
定义类:
  1. package dc.test;
  2. /**
  3. ?*? 这是对于javadoc生成文档的测试
  4. ?*
  5. ?* @name. TestDoc
  6. ?* @author senRsl
  7. ?*
  8. ?* @package. dc.test
  9. ?* @createtime. 2014年7月20日 下午4:13:36
  10. ?*
  11. ?*/
  12. public class TestDoc {
  13. ??? ...
  14. }
生成doc
  1. senrsl@senrsl-ubuntu:~/j2ee/workspace/test-java/docs$ javadoc -tag name.:a:"类名" -tag package.:a:"包名" -tag createtime.:a:"创建时间" ../src/dc/test/TestDoc.java
  2. 正在装入源文件 ../src/dc/test/TestDoc.java...
  3. 正在构造 Javadoc 信息...
  4. 标准 Doclet 版本 1.6.0_45
  5. 正在构建所有软件包和类的树...
  6. 正在生成 dc/test//TestDoc.html...
  7. 正在生成 dc/test//package-frame.html...
  8. 正在生成 dc/test//package-summary.html...
  9. 正在生成 dc/test//package-tree.html...
  10. 正在生成 constant-values.html...
  11. 正在构建所有软件包和类的索引...
  12. 正在生成 overview-tree.html...
  13. 正在生成 index-all.html...
  14. 正在生成 deprecated-list.html...
  15. 正在构建所有类的索引...
  16. 正在生成 allclasses-frame.html...
  17. 正在生成 allclasses-noframe.html...
  18. 正在生成 index.html...
  19. 正在生成 help-doc.html...
  20. 正在生成 stylesheet.css...
  21. senrsl@senrsl-ubuntu:~/j2ee/workspace/test-java/docs$
然后查看生成结果


如果这么弄,在android framework也就没什么意义了所以最后的处理方案是直接删掉那三个自定义的,也就是更新code template:
之前:
File:
  1. /**?
  2. ?* Filename:??? ${file_name}?
  3. ?* Description:??
  4. ?* Copyright:?? Copyright (c)${year}?
  5. ?* Company:???? SENRSL?
  6. ?* @author:???? senRsl senRsl@163.com?
  7. ?* @version:??? 1.0?
  8. ?* Create at:?? ${date} ${time}?
  9. ?*?
  10. ?* Modification History:?
  11. ?* Date???????????? Author????? Version???? Description?
  12. ?* ------------------------------------------------------------------?
  13. ?* ${date}?? senRsl????? 1.0??????????? 1.0 Version?
  14. ?*/
Types:
  1. /**
  2. ?*
  3. ?*
  4. ?* @ClassName: ${type_name}
  5. ?* @author ${user}
  6. ?*
  7. ?* @Package: ${package_name}
  8. ?* @CreateTime: ${date} ${time}
  9. ?* ${tags}
  10. ?*/
之后:
Files:不变
Types:
  1. /**
  2. ?*
  3. ?* @author ${user}
  4. ?*
  5. ?* ${tags}
  6. ?*/
我用了5年的模板啊,就这么被改变了。。。。。。

身未游容心已惊鸿
蹉跎数载未己有行
难易劝学路之迢迢
致予尚善归吝于心

灯耀东来黑衣迷野
霾撒紫禁侍乱枭雄
卿卿于野嗷嗷浮泉
扬首朝歌步步精心

生成完成

位置:
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ll out/host/linux-x86/sdk/
  2. 总用量 611000
  3. drwxrwx---? 3 senrsl senrsl????? 4096? 5月 18 16:57 ./
  4. drwxrwxr-x 10 senrsl senrsl????? 4096? 5月 18 16:55 ../
  5. drwxrwx--- 12 senrsl senrsl????? 4096? 5月 18 16:55 android-sdk_eng.senrsl_linux-x86/
  6. -rw-rw-r--? 1 senrsl senrsl 623913682? 5月 18 16:57 android-sdk_eng.senrsl_linux-x86.zip
  7. -rw-rw-r--? 1 senrsl senrsl?? 1730293? 5月 18 16:56 sdk_deps.mk
  8. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$


doc是这样的


13,总结make sdk的步骤
编译完成源码之后,编译SDK,即打包android.jar,生成javadoc
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ source ./build/envsetup.sh
  2. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ lunch sdk-eng
  3. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ make update-api
  4. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ make sdk
  5. ....
  6. Package android-support-v7-mediarouter.jar: out/target/common/obj/PACKAGING/android-support-v7-mediarouter_intermediates/android-support-v7-mediarouter.jar
  7. Package SDK: out/host/linux-x86/sdk/android-sdk_eng.senrsl_linux-x86.zip
  8. SDK: warning: including GNU target out/target/product/generic/system/lib/libgccdemangle.so
  9. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$

14,导出自定义kit为jar包提供给三方应用报错JAR creation failed. See details for additional information.
? Class files on classpath not found or not accessible for: 'android422/packages/apps/VsfDemo/src/cn/senrsl/vsf/kit/VsfIcKit.java'

以前正常导出,突然不能导了
安Fat Jar工具,在sourceforget上下net.sf.fjep.fatjar_0.0.31.zip,扔进的dropin.
然后,打包出jar后出问题:打包jar,放到第三方程序里05-20 14:27:30.873: E/AndroidRuntime(3493): Caused by: java.lang.Error: Unresolved compilation problem:
使用时报错,查看jar,发现那些找不到的类依旧报错。
然后,想到了.classpath文件,查看找到
  1. <classpathentry kind="output" path="out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes"/>
也就是说,eclipse导出jar的时候会去这个目录找相应class文件,这里面只配置了framework层的,而要导出的kit写在了 app层,所以,
1,把生成的sdk引入eclipse,配置app可以正常运行,build,再用eclipse导出jar就可以了。

第三方就可以正常使用了!

↑工具不熟害死人啊!

自定义MANIFEST.MF
  1. Manifest-Version: 1.0
  2. Created-By: senRsl


15,Nexus7内核源码突然自己消失了。。。。
之前的【android源码编译09之nexus7到手02烧录内核】,编译完成,烧入,发现设备wifi打不开。。。。
还是得去官方下才放心啊!
忽然之间,天昏地暗,世界突然什么都没有,想起你~
之前下的源码自己就变没了。。。。
果然一个通畅的地址是多么的重要,之前挂vpn才1M多,现在换了一个通畅的hosts,瞬间2M+。。。。
系统与内核齐飞,三方与内置同乐

16,系统编译签名位置
系统内签名文件定义于此
  1. senrsl@senrsl-ubuntu:~$ cd /home/senrsl/android/source/WORKING_DIRECTORY/build/target/product/security
  2. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/build/target/product/security$ ll
  3. 总用量 44
  4. drwxrwxr-x 2 senrsl senrsl 4096? 3月 20 13:35 ./
  5. drwxrwxr-x 3 senrsl senrsl 4096? 5月 15 10:40 ../
  6. -rw-rw-r-- 1 senrsl senrsl 1216? 3月 20 13:35 media.pk8
  7. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 media.x509.pem
  8. -rw-rw-r-- 1 senrsl senrsl 1216? 3月 20 13:35 platform.pk8
  9. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 platform.x509.pem
  10. -rw-rw-r-- 1 senrsl senrsl 1758? 3月 20 13:35 README
  11. -rw-rw-r-- 1 senrsl senrsl 1218? 3月 20 13:35 shared.pk8
  12. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 shared.x509.pem
  13. -rw-rw-r-- 1 senrsl senrsl 1217? 3月 20 13:35 testkey.pk8
  14. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 testkey.x509.pem
  15. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/build/target/product/security$
编译时使用哪个签名定义于此
文件/home/senrsl/android/source/WORKING_DIRECTORY/build/core /config.mk,388 行
  1. # The default key if not set as LOCAL_CERTIFICATE
  2. ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
  3. ? DEFAULT_SYSTEM_DEV_CERTIFICATE := $(PRODUCT_DEFAULT_DEV_CERTIFICATE)
  4. else
  5. ? DEFAULT_SYSTEM_DEV_CERTIFICATE := build/target/product/security/testkey
  6. endif
也就是说,如果设置了,就使用设置的,没设置,使用testKey.

/home/senrsl/android/source/WORKING_DIRECTORY/build/core/Makefile里 配置了传入使用哪个。


17,Socket报错 05-20 17:17:38.652: W/System.err(9255): java.net.SocketException: socket failed: EACCES (Permission denied)
没授权<uses-permission android:name="android.permission.INTERNET"/>


18,开机广播
①文件位置/home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base/services/java/com/android/server/vsf/sync/BootReceiver.java
②文件内容
  1. import android.content.BroadcastReceiver;
  2. import android.content.Context;
  3. import android.content.Intent;
  4. import android.util.Slog;
  5. import android.vsf.VsfContext;
  6. import android.vsf.manager.DataSyncManager;
  7. /**
  8. ?*
  9. ?* @author senrsl
  10. ?*
  11. ?*/
  12. public class BootReceiver extends BroadcastReceiver {
  13. ???
  14. ??? private static final String TAG = "TEST";
  15. ??? @Override
  16. ??? public void onReceive(Context context, Intent intent) {
  17. ??? ??? if(VsfContext.isDebug)Slog.e(TAG, "同步服务随广播启动");
  18. ??? ??? DataSyncManager dsm = (DataSyncManager)context.getSystemService(VsfContext.VSF_SERVICE_DATASYNC);
  19. ??? ??? dsm.boot();
  20. ??? }
  21. }
③注册于/home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base/core/res/AndroidManifest.xml
④注册内容line2636
  1. ??? <receiver android:name="com.android.server.vsf.sync.BootReceiver"
  2. ??????????????? android:primaryUserOnly="true">
  3. ??????????? <intent-filter>
  4. ??????????????? <action android:name="android.intent.action.BOOT_COMPLETED" />
  5. ??????????? </intent-filter>
  6. ??????? </receiver>
⑤代码编写完后,编译senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ mmm frameworks/base/core/res/
⑥发布到真机
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ adb push out/target/product/deb/system/framework/framework-res.apk

⑦运行效果
  1. 05-25 15:41:20.034: E/TEST(676): 同步服务随广播启动
  2. 05-25 15:41:20.034: E/TEST(676): 设备注册:1
  3. 05-25 15:41:20.054: E/TEST(676): 1234IMEI1234567890qwertyuiopasdfghjklserverId_aaaaaaaaaaaa
  4. 05-25 15:41:20.054: W/System.err(676): java.net.ConnectException: failed to connect to /192.168.21.99 (port 1734): connect failed: ENETUNREACH (Network is unreachable)
在⑦的时候报错,是因为手机虽然开机但是没有联网,应该接收网络连接成功的广播进行处理!

⑧网络连接成功广播
更改过滤权限为android.net.conn.CONNECTIVITY_CHANGE
代码文件先判断网络
  1. ??? ??? ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);?
  2. ??? ??? State wifiState = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState();
  3. ??????? State mobileState = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState();
  4. ???????
  5. ??????? if(VsfContext.isDebug)Slog.e(TAG, "监听到网络变化:"+State.CONNECTED);
  6. ??????? if( (mobileState != null && State.CONNECTED == mobileState) || (wifiState != null && State.CONNECTED == wifiState)? ){
  7. ??????? ??? DataSyncManager dsm = (DataSyncManager)context.getSystemService(VsfContext.VSF_SERVICE_DATASYNC);
  8. ??????? ??? dsm.boot();
  9. ??????? }

19,写了句这个this.wait(wait_mills * wait_mills * wait_mills * 1000);
05-25 19:25:09.682: W/System.err(703): java.lang.IllegalMonitorStateException: object not locked by thread before wait()
需要加锁,或者不加锁用sleep

20,Thread updates not enabled for selected client
配置里DDMS里把这俩勾勾上



21,05-26 19:58:58.004: W/System.err(716): java.lang.IllegalStateException: TimerTask is scheduled already
05-26 20:08:56.588: W/System.err(701): java.lang.IllegalStateException: Timer was canceled
timerTask每次要用新的,而且timer.cancle之后要重新new.
  1. ??? ??? //t如果执行了cancle之后要重新new
  2. ??? ??? t = new Timer();
  3. ??? ??? //第一个参数每次必须用新的,new,千万不要定义成变量,大坑
  4. ??? ??? t.schedule(new ttSync(), 1000, timeSync);
22,java.lang.IllegalArgumentException: provider doesn't exist: network
GPS好像是有更新了,之前的那个provider都没了。。。。

23,05-31 14:55:55.222: A/Environment(684): Path requests must specify a user by using UserEnvironment
加上Environment.setUserRequired(false);

24,05-31 15:13:31.178: W/System.err(681): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
看起来是没有权限,是不是在mainfest里定义了。。。。
可我的是写到framework层的service里。。。。这可怎么办。。。。

第23跟24,是在framework层的service里往SD卡写东西,看来是写不了吧,往/data/system/里写东西直接就写上了 呢。
  1. //??? ??? File fileDir = new File(Environment.getExternalStorageDirectory().getPath()+"/VSF/");
  2. ??? ??? File fileDir = new File("/data/system/vsf/");

25,这才三天没关机器,内存吃到15G多,hub-service进程吃了8.6G内存,什么情况


26,Syntax error, insert "Dimensions" to complete TypeArgument
要用封装,之前是这样
  1. Map<byte,String> map = new HashMap<byte,String>();
改成这样
  1. Map<Byte,String> map = new HashMap<Byte,String>();

27,应用启动
应用启动,Launcher上点图标,然后启动.
文件位置:
  1. /home/senrsl/android/source/WORKING_DIRECTORY/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java
入口代码
  1. public void onClick(View v) {
  2. ??????? // Make sure that rogue clicks don't get through while allapps is launching, or after the
  3. ??????? // view has detached (it's possible for this to happen if the view is removed mid touch).
  4. ??????? if (v.getWindowToken() == null) {
  5. ??????????? return;
  6. ??????? }
  7. ??????? if (!mWorkspace.isFinishedSwitchingState()) {
  8. ??????????? return;
  9. ??????? }
  10. ??????? Object tag = v.getTag();
  11. ??????? w(this,"在launcher上点了图标,这个是桌面快捷方式"+tag);
  12. ??????? if (tag instanceof ShortcutInfo) {
  13. ??????????? // Open shortcut
  14. ??????????? final Intent intent = ((ShortcutInfo) tag).intent;
  15. ??????????? int[] pos = new int[2];
  16. ??????????? v.getLocationOnScreen(pos);
  17. ??????????? intent.setSourceBounds(new Rect(pos[0], pos[1],
  18. ??????????????????? pos[0] + v.getWidth(), pos[1] + v.getHeight()));
  19. ??????????? boolean success = startActivitySafely(v, intent, tag);
  20. ??????????? if (success && v instanceof BubbleTextView) {
  21. ??????????????? mWaitingForResume = (BubbleTextView) v;
  22. ??????????????? mWaitingForResume.setStayPressed(true);
  23. ??????????? }
  24. ??????? } else if (tag instanceof FolderInfo) {
  25. ??????????? if (v instanceof FolderIcon) {
  26. ??????????????? FolderIcon fi = (FolderIcon) v;
  27. ??????????????? handleFolderClick(fi);
  28. ??????????? }
  29. ??????? } else if (v == mAllAppsButton) {
  30. ??????????? if (isAllAppsVisible()) {
  31. ??????????????? showWorkspace(true);
  32. ??????????? } else {
  33. ??????????????? onClickAllAppsButton(v);
  34. ??????????? }
  35. ??????? }
  36. ??? }
上面那个只是快捷方式,真正每一个都执行的是这个
  1. //每次启动程序都会执行这个
  2. ??? boolean startActivitySafely(View v, Intent intent, Object tag) {
  3. ??????? boolean success = false;
  4. ??????? try {
  5. ??????? ??? //w(this, intent.getAction() +"-----"+intent.getDataString()+"-------"+intent.getPackage()+"-------"+intent.getScheme());
  6. ??????????? success = startActivity(v, intent, tag);
  7. ??????? } catch (ActivityNotFoundException e) {
  8. ??????????? Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
  9. ??????????? Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent, e);
  10. ??????? }
  11. ??????? return success;
  12. ??? }
然后并入到了Activity
  1. /home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base/core/java/android/app/Activity.java
代码
  1. ?@Override
  2. ??? public void startActivity(Intent intent, Bundle options) {
  3. ??? ??? //06-10 15:56:15.231: E/TEST(1065): 启动一个activityIntent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.contacts/.activities.PeopleActivity bnds=[1766,664][1906,804] }
  4. ??? ??? Logger.w("启动一个activity"+intent);
  5. ?????? #在这里加了判断,这样可以在这里判断启动 程序,只改这一处即可
  6. ??? ??? if("android.intent.action.MAIN".equals(intent.getAction())){
  7. ??? ??? ??? Logger.w(this, "新打开了一个程序"+intent);
  8. ??? ??? }
  9. ??????? if (options != null) {
  10. ??????????? startActivityForResult(intent, -1, options);
  11. ??????? } else {
  12. ??????????? // Note we want to go through this call for compatibility with
  13. ??????????? // applications that may have overridden the method.
  14. ??????????? startActivityForResult(intent, -1);
  15. ??????? }
  16. ??? }

28,应用安装
应用安装分①系统应用自动安装,②用户手动安装,③应用商店安装,④adb命令安装,

①系统应用自动安装,OEM的
②用户手动安装
③应用商店安装
④adb命令安装
都会调用到
  1. /home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base/services/java/com/android/server/pm/PackageManagerService.java
里的方法
  1. /*
  2. ???? * Install a non-existing package.
  3. ???? */
  4. ??? private void installNewPackageLI(PackageParser.Package pkg,
  5. ??????????? int parseFlags, int scanMode, UserHandle user,
  6. ??????????? String installerPackageName, PackageInstalledInfo res) {
  7. ??????? // Remember this for later, in case we need to rollback this install
  8. ??????? String pkgName = pkg.packageName;
  9. ???????
  10. ??????? Logger.w(mContext,"安装一 个未安装的包:"+pkgName);
  11. ??????? if (DEBUG_INSTALL) Slog.d(TAG, "installNewPackageLI: " + pkg);
  12. ??????? boolean dataDirExists = getDataPathForPackage(pkg.packageName, 0).exists();
  13. ??????? synchronized(mPackages) {
  14. ??????????? if (mSettings.mRenamedPackages.containsKey(pkgName)) {
  15. ??????????????? // A package with the same name is already installed, though
  16. ??????????????? // it has been renamed to an older name.? The package we
  17. ??????????????? // are trying to install should be installed as an update to
  18. ??????????????? // the existing one, but that has not been requested, so bail.
  19. ??????????????? Slog.w(TAG, "Attempt to re-install " + pkgName
  20. ??????????????????????? + " without first uninstalling package running as "
  21. ??????????????????????? + mSettings.mRenamedPackages.get(pkgName));
  22. ??????????????? res.returnCode = PackageManager.INSTALL_FAILED_ALREADY_EXISTS;
  23. ??????????????? return;
  24. ??????????? }
  25. ??????????? if (mPackages.containsKey(pkgName) || mAppDirs.containsKey(pkg.mPath)) {
  26. ??????????????? // Don't allow installation over an existing package with the same name.
  27. ??????????????? Slog.w(TAG, "Attempt to re-install " + pkgName
  28. ??????????????????????? + " without first uninstalling.");
  29. ??????????????? res.returnCode = PackageManager.INSTALL_FAILED_ALREADY_EXISTS;
  30. ??????????????? return;
  31. ??????????? }
  32. ??????? }
  33. ??????? mLastScanError = PackageManager.INSTALL_SUCCEEDED;
  34. ??????? PackageParser.Package newPackage = scanPackageLI(pkg, parseFlags, scanMode,
  35. ??????????????? System.currentTimeMillis(), user);
  36. ??????? if (newPackage == null) {
  37. ??????????? Slog.w(TAG, "Package couldn't be installed in " + pkg.mPath);
  38. ??????????? if ((res.returnCode=mLastScanError) == PackageManager.INSTALL_SUCCEEDED) {
  39. ??????????????? res.returnCode = PackageManager.INSTALL_FAILED_INVALID_APK;
  40. ??????????? }
  41. ??????? } else {
  42. ??????????? updateSettingsLI(newPackage,
  43. ??????????????????? installerPackageName,
  44. ??????????????????? null, null,
  45. ??????????????????? res);
  46. ??????????? // delete the partially installed application. the data directory will have to be
  47. ??????????? // restored if it was already existing
  48. ??????????? if (res.returnCode != PackageManager.INSTALL_SUCCEEDED) {
  49. ??????????????? // remove package from internal structures.? Note that we want deletePackageX to
  50. ??????????????? // delete the package data and cache directories that it created in
  51. ??????????????? // scanPackageLocked, unless those directories existed before we even tried to
  52. ??????????????? // install.
  53. ??????????????? deletePackageLI(pkgName, UserHandle.ALL, false, null, null,
  54. ??????????????????????? dataDirExists ? PackageManager.DELETE_KEEP_DATA : 0,
  55. ??????????????????????????????? res.removedInfo, true);
  56. ??????????? }
  57. ??????? }
  58. ??? }
29,应用升级
看起来是先执行了删除,然后安装/替换
  1. 06-10 19:13:34.764: I/PackageManager(685): Copying native libraries to /data/app-lib/vmdl-1202583496
  2. 06-10 19:13:40.690: D/PackageManager(685): deletePackageLI: com.tencent.mm user null
  3. 06-10 19:13:40.690: D/PackageManager(685): Removing non-system package:com.tencent.mm
  4. 06-10 19:13:40.730: D/PackageManager(685): removePackageDataLI: PackageSetting{4274e370 com.tencent.mm/10065}
  5. 06-10 19:13:40.890: W/PackageManager(685): Package com.tencent.mm desires unavailable shared library com.google.android.maps; ignoring!
  6. 06-10 19:13:40.890: W/PackageManager(685): Package com.tencent.mm desires unavailable shared library com.sec.android.app.multiwindow; ignoring!
  7. 06-10 19:13:40.890: I/PackageManager(685): Package com.tencent.mm codePath changed from /data/app/com.tencent.mm-1.apk to /data/app/com.tencent.mm-2.apk; Retaining data and using new
  8. 06-10 19:13:41.171: I/PackageManager(685): Running dexopt on: com.tencent.mm

30,应用卸载
卸载看到两个,一个删除普通的用户应用,一个是删除系统应用
  1. >>deleteInstalledPackageLI(PackageSetting, boolean, int, int[], boolean[], PackageRemovedInfo, boolean)
  2. >>>>deletePackageLI(String, UserHandle, boolean, int[], boolean[], int, PackageRemovedInfo, boolean)
  3. >>>>deleteSystemPackageLI(PackageSetting, int[], boolean[], int, PackageRemovedInfo, boolean)
下面俩方法都调用了deleteInstalledPackageLI

卸载时系统日志
  1. 06-10 18:03:07.266: D/PackageManager(684): deletePackageAsUser: pkg=dc.test.hey user=0
  2. 06-10 18:03:07.266: D/PackageManager(684): deletePackageX: pkg=dc.test.hey user=0
  3. 06-10 18:03:07.266: D/PackageManager(684): deletePackageLI: dc.test.hey user UserHandle{0}
  4. 06-10 18:03:07.266: D/PackageManager(684): Only deleting for single user
  5. 06-10 18:03:07.266: D/PackageManager(684): Not installed by other users, full delete
  6. 06-10 18:03:07.286: D/PackageManager(684): Removing non-system package:dc.test.hey
  7. 06-10 18:03:07.286: D/PackageManager(684):?? Services: dc.test.hey.service.LifeCycleService
  8. 06-10 18:03:07.286: D/PackageManager(684): removePackageDataLI: PackageSetting{41fbd620 dc.test.hey/10065}
  9. 06-10 18:03:07.297: D/PackageManager(684):?? Activities: dc.test.hey.activity.WelcomeActivity dc.test.hey.activity.MainActivity dc.test.hey.activity.WidgetActivity dc.test.hey.activity.GalleryActivity dc.test.hey.activity.AnalogClockActivity dc.test.hey.activity.ProgressBarActivity dc.test.hey.activity.MenuActivity dc.test.hey.activity.PanelActivity dc.test.hey.activity.DialogActivity dc.test.hey.activity.NotificationActivity dc.test.hey.activity.SexActivity dc.test.hey.activity.DashedLineActivity dc.test.hey.activity.ListSelectedDialogActivity dc.test.hey.activity.OptionsMenuActivity dc.test.hey.activity.GridOptionsMenuActivity dc.test.hey.activity.ExpandableListViewAcitivity dc.test.hey.activity.CustomExpandableListActivity dc.test.hey.activity.BrightnessSettingDialogActivity dc.test.hey.activity.ChronometerActivity dc.test.hey.activity.SlidingDrawerActivity dc.test.hey.activity.GetMetricsActivity dc.test.hey.activity.DontWriteActivity dc.test.hey.activity.DragImageActivity dc.test.hey.activity.DialogSelectListActivity dc.test.hey.activity.SetThemeActivity dc.test.hey.activity.LinkifyActivity dc.test.hey.activity.VibratorActivity dc.test.hey.activity.GetSimInfoActivity dc.test.hey.activity.AppRuningActivity dc.test.hey.activity.SensorActivity dc.test.hey.activity.RectangleActivity dc.test.hey.activity.CustomCanvasActivity dc.test.hey.activity.WaterMarkActivity dc.test.hey.activity.ManyGraphicalActivity dc.test.hey.activity.WaterlinesActivity dc.test.hey.activity.ShaderImgActivity dc.test.hey.activity.TweenAninalActivity dc.test.hey.activity.FrameAnimalActivity dc.test.hey.activity.MatrixImageActivity dc.test.hey.activity.MatrixImageRotateActivity dc.test.hey.activity.TwinklingStarsActivity dc.test.hey.activity.Simulation3DActivity dc.test.hey.activity.WavesFlagActivity dc.test.hey.activity.MultipleBoxActivity dc.test.hey.activity.ParticleSystemActivity dc.test.hey.activity.MoveImageViewActivity dc.test.hey.activity.DrawStringByCanvasActivity dc.test.hey.activity.MoveGraphicalActivity dc.test.hey.activity.MoveImageAnimalActivity dc.test.hey.activity.CylindricalActivity dc.test.hey.activity.MixImageActivity dc.test.hey.activity.DrawMuchGraphicalActivity dc.test.hey.activity.ScreenSaverActivity dc.test.hey.activity.MoveImageByTouchActivity dc.test.hey.activity.GetImageInfoActivity dc.test.hey.activity.HttpSendActivity dc.test.hey.activity.LoadHtmlActivity dc.test.hey.activity.BuiltInBrowserActivity dc.test.hey.activity.rss.SelectSourceActivity dc.test.hey.activity.rss.RssListActivity dc.test.hey.activity.rss.NewsDetailActivity dc.test.hey.activity.AudioManagerActivity dc.test.hey.activity.gif.AnlyGifActivity dc.test.hey.activity.google.map.GetLocationActivity dc.test.hey.activity.google.api.GoogleChart2QRActivity dc.test.hey.activity.google.api.GoogleTranslateActivity dc.test.hey.activity.merge.MergeActivity dc.test.hey.activity.merge.MergeFrameActivity dc.test.hey.activity.merge.MergeMergeActivity dc.test.hey.activity.merge.PerformanceTestActivity dc.test.hey.activity.merge.MemoryUsedTestActivity dc.test.hey.activity.merge.OptimizeBitmapActivity dc.test.hey.activity.JsTestActivity dc.test.hey.activity.game.gobang.GobangActivity dc.test.hey.activity.BluetoothActivity dc.test.hey.activity.BambooCupsActivity dc.test.hey.activity.CustomAnnotationsActivity dc.test.hey.activity.AboutActivity dc.test.hey.activity.ndk.MainNdkActivity dc.test.hey.activity.ndk.TestNdkActivity dc.test.hey.activity.ndk.TestNdkTwoLibActivity android.app.NativeActivity dc.test.hey.activity.ndk.PlasmaActivity dc.test.hey.activity.ndk.TestNdkAudioActivity dc.test.hey.activity.ndk.SanAnglesActivity dc.test.hey.activity.ndk.RunShellActivity dc.test.hey.activity.preference.MainPreferenceActivity dc.test.hey.activity.preference.CheckBoxPreferenceActivity dc.test.hey.activity.preference.EditTextPreferenceActivity dc.test.hey.activity.preference.ListPreferenceActivity dc.test.hey.activity.preference.RingtonePreferenceActivity dc.test.hey.activity.preference.NewsPreferenceActivity dc.test.hey.activity.life.LifeCycleMainActivity dc.test.hey.activity.life.LifeCycleAct
  10. 06-10 18:03:07.307: W/PackageManager(684): Couldn't delete native library directory /data/app-lib/dc.test.hey
  11. 06-10 18:03:07.307: D/PackageManager(684): Propagating install state across downgrade
  12. 06-10 18:03:07.307: D/PackageManager(684):???? user 0 => true
  13. 06-10 18:03:07.407: D/PackageManager(684): delete res: systemUpdate=false removedForAllUsers=true

31,拿三方的源码编译后烧乙方的车机
应用里切换mode,可以检测.
  1. senrsl@senrsl-ubuntu:~$ lsusb
  2. Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  3. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  4. Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  5. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  6. Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
  7. Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  8. senrsl@senrsl-ubuntu:~$ lsusb
  9. Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  10. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  11. Bus 001 Device 032: ID 18d1:4e42 Google Inc. Nexus 7 (debug)
  12. Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  13. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  14. Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
  15. Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  16. senrsl@senrsl-ubuntu:~$ adb devices
  17. List of devices attached
  18. 0123456789ABCDEF??? device
烧录
  1. senrsl@senrsl-ubuntu:~$ fastboot -w flashall
  2. Erase successful, but not automatically formatting.
  3. File system type? not supported.
  4. Erase successful, but not automatically formatting.
  5. File system type? not supported.
  6. --------------------------------------------
  7. Bootloader Version...: 0.5.0006
  8. Baseband Version.....:
  9. Serial Number........: 000015050713090305BE
  10. --------------------------------------------
  11. checking product...
  12. FAILED
  13. Device product is 'm805_893x_evm_emmc'.
  14. Update requires 'tcc893x_evm'.
  15. finished. total time: 0.017s
  16. senrsl@senrsl-ubuntu:~$ fastboot -w flashall
  17. Erase successful, but not automatically formatting.
  18. File system type? not supported.
  19. Erase successful, but not automatically formatting.
  20. File system type? not supported.
  21. --------------------------------------------
  22. Bootloader Version...: 0.5.0006
  23. Baseband Version.....:
  24. Serial Number........: 000015050713090305BE
  25. --------------------------------------------
  26. checking product...
  27. FAILED
  28. Device product is 'm805_893x_evm_emmc'.
  29. Update requires 'tcc893x_evm'.
  30. finished. total time: 0.017s
  31. senrsl@senrsl-ubuntu:~$
好吧....

32,突然发现的一个以前的记录,关于keystore忘记密码
  1. 1,找回密码
  2. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ java -jar akprjar.jar -m 3 -k "goo" -d "passwdlib"
  3. Number of keys in keystore: 1
  4. Found alias: 4th-hey
  5. Creation Date: Mon Jun 30 14:07:32 CST 2014
  6. Start smart wordlist attack on key!!
  7. Capitalize first letter
  8. Current Pass: a || est. 0 Pass/Sec
  9. Got Password in 0 seconds
  10. Password is: ****** for alias 4th-hey
  11. 2,查看签名信息
  12. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ keytool -list -v -keystore goo -storepass senRsl
  13. 密钥库类型: JKS
  14. 密钥库提供方: SUN
  15. 您的密钥库包含 1 个条目
  16. 别名: 4th-hey
  17. 创建日期: 2014-6-30
  18. 条目类型: PrivateKeyEntry
  19. 证书链长度: 1
  20. 证书[1]:
  21. 所有者: CN=senRsl, OU=SENRSL, O=SENRSL, L=Beijing, ST=CN, C=86
  22. 发布者: CN=senRsl, OU=SENRSL, O=SENRSL, L=Beijing, ST=CN, C=86
  23. 序列号: 45a43109
  24. 有效期开始日期: Mon Jun 30 14:07:32 CST 2014, 截止日期: Wed Jun 06 14:07:32 CST 2114
  25. 证书指纹:
  26. ??? ?MD5: E4:CF:6A:71:CF:2C:0D:73:21:FD:8D:F7:71:F3:B4:0B
  27. ??? ?SHA1: 59:76:34:5E:5C:D1:63:99:E5:54:DA:D6:C5:59:AE:50:89:E7:38:71
  28. ??? ?SHA256: E1:59:2B:BF:2B:2B:20:E4:6C:19:DD:65:89:63:D9:E0:E9:F2:20:B2:10:B3:A6:AF:45:CC:49:9F:EF:D7:8D:D6
  29. ??? ?签名算法名称: SHA256withRSA
  30. ??? ?版本: 3
  31. 扩展:
  32. #1: ObjectId: 2.5.29.14 Criticality=false
  33. SubjectKeyIdentifier [
  34. KeyIdentifier [
  35. 0000: 23 0E CF 06 C7 72 B9 5C?? 77 79 BA 6D 43 E6 9E 2D? #....r.\wy.mC..-
  36. 0010: D3 6A E7 51??????????????????????????????????????? .j.Q
  37. ]
  38. ]
  39. *******************************************
  40. *******************************************
  41. 3,apk包解压开,查看他的签名信息
  42. senrsl@senrsl-ubuntu:~/doc/google/dc.bt.mono102.apk_FILES/META-INF$ keytool -printcert -file CERT.RSA
  43. 所有者: CN=senRsl, OU=SENRSL, O=SENRSL, L=Beijing, ST=CN, C=86
  44. 发布者: CN=senRsl, OU=SENRSL, O=SENRSL, L=Beijing, ST=CN, C=86
  45. 序列号: 52307738
  46. 有效期开始日期: Mon Aug 11 15:55:10 CST 2014, 截止日期: Wed Jul 18 15:55:10 CST 2114
  47. 证书指纹:
  48. ??? ?MD5: 80:D9:07:05:61:42:22:28:02:E5:36:65:34:87:02:D0
  49. ??? ?SHA1: 6A:1D:CD:42:64:61:57:66:23:39:7B:15:89:09:22:82:DC:89:A9:9B
  50. ??? ?SHA256: 70:D6:91:74:52:74:51:1D:AF:06:FB:FD:95:1C:9D:42:81:68:36:C2:9F:5A:A1:C7:D5:4F:10:AF:BD:30:61:77
  51. ??? ?签名算法名称: SHA256withRSA
  52. ??? ?版本: 3
  53. 扩展:
  54. #1: ObjectId: 2.5.29.14 Criticality=false
  55. SubjectKeyIdentifier [
  56. KeyIdentifier [
  57. 0000: AF BB 35 24 5D EA DA 3D?? B8 76 4E DD C1 AD C4 5C? ..5$]..=.vN....\
  58. 0010: 56 BC FA B5??????????????????????????????????????? V...
  59. ]
  60. ]
第一个用工具android-keystore-password-recover的时候,要注意java的版本
  1. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ java -jar akprjar.jar -m 3 -k "goo" -d "passwdlib"
  2. Exception in thread "main" java.lang.UnsupportedClassVersionError: dc/androd/keystore/recover/AndroidKeystoreBrute : Unsupported major.minor version 51.0
  3. ??? at java.lang.ClassLoader.defineClass1(Native Method)
  4. ??? at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
  5. ??? at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
  6. ??? at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
  7. ??? at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
  8. ??? at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
  9. ??? at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
  10. ??? at java.security.AccessController.doPrivileged(Native Method)
  11. ??? at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  12. ??? at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  13. ??? at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  14. ??? at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
  15. Could not find the main class: dc.androd.keystore.recover.AndroidKeystoreBrute. Program will exit.
  16. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ echo $JAVA_HOME/home/senrsl/java/jdk1.7.0_71
  17. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ java -version
  18. java version "1.6.0_45"
  19. Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
  20. Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
  21. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ source ~/.bashrc
  22. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ java -version
  23. java version "1.7.0_71"
  24. Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
  25. Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
  26. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$ java -jar akprjar.jar -m 3 -k "goo" -d "passwdlib"
  27. Number of keys in keystore: 1
  28. Found alias: 4th-hey
  29. Creation Date: Mon Jun 30 14:07:32 CST 2014
  30. Start smart wordlist attack on key!!
  31. Capitalize first letter
  32. Current Pass: a || est. 0 Pass/Sec
  33. Got Password in 0 seconds
  34. Password is: ******* for alias 4th-hey
  35. For updates visit http://code.google.com/p/android-keystore-password-recover/
  36. senrsl@senrsl-ubuntu:~/test/decompile/keystorePasswd$
然后第二个第三个是因为公钥还在,私钥忘了......没辙....

33,06-15 19:42:10.846: W/System.err(976): java.lang.SecurityException: Permission Denial: forceStopPackage() from pid=976, uid=10007 requires android.permission.FORCE_STOP_PACKAGES
调用了两个方法在
  1. /home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base/core/java/android/app/Activity.java
  2. ??? ??? ??? ??? ???
  3. Logger.w(this, "鉴权失败");
  4. ActivityManager actMgr = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
  5. Logger.w( "程序是否运行:"+actMgr.isUserRunning(0));
  6. actMgr.forceStopPackage(pkgName);

actMgr.isUserRunning(0)需要<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>加载Launcher2的 mainfest里;
actMgr.forceStopPackage(pkgName);需要<uses-permission android:name="android.permission.FORCE_STOP_PACKAGES"/>加到哪....

看到这个
  1. 06-15 19:42:10.846: W/ActivityManager(696): Permission Denial: forceStopPackage() from pid=976, uid=10007 requires android.permission.FORCE_STOP_PACKAGES
  2. 06-15 19:42:10.856: W/System.err(976): ??? at java.lang.reflect.Method.invoke(Method.java:515)
  3. 06-15 19:42:10.856: W/System.err(976): ??? at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  4. 06-15 19:42:10.856: W/System.err(976): ??? at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  5. 06-15 19:42:10.856: W/System.err(976): ??? at dalvik.system.NativeStart.main(Native Method)
然后找到了/home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base /core/res/AndroidManifest.xml
找到这个权限的定义
  1. ?? <!-- Allows an application to call
  2. ??????? {@link android.app.ActivityManager#forceStopPackage}.
  3. ??????? @hide -->
  4. ??? <permission android:name="android.permission.FORCE_STOP_PACKAGES"
  5. ??????? android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
  6. ??????? android:protectionLevel="signature"
  7. ??????? android:label="@string/permlab_forceStopPackages"
  8. ??????? android:description="@string/permdesc_forceStopPackages" />
改成这样就好了,屮,找了一晚上
  1. ??? <permission android:name="android.permission.FORCE_STOP_PACKAGES"
  2. ??????? android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
  3. ??????? android:protectionLevel="signature|system"
  4. ??????? android:label="@string/permlab_forceStopPackages"
  5. ??????? android:description="@string/permdesc_forceStopPackages" />

34,ubuntu14.04上的office
突然发现这个有x64位版本了
wps-office_9.1.0.4961~a18p1_amd64.deb
安上后跑xp虚拟机你搜缺失字体
  1. wingding.ttf
  2. WINGDNG2.TTF
  3. WINGDNG3.TTF
  4. MTEXTRA.TTF
安上字体,一切正常
  1. senrsl@senrsl-ubuntu:~/share/temp$ ll
  2. 总用量 66044
  3. drwxrwxr-x? 2 senrsl senrsl???? 4096? 6月 16 13:10 ./
  4. drwxrwxr-x 15 senrsl senrsl???? 4096? 6月 11 10:56 ../
  5. -rw-rw-r--? 1 senrsl senrsl???? 7656? 8月? 1? 1997 MTEXTRA.TTF
  6. -rw-rw-r--? 1 senrsl senrsl??? 81000? 4月 14? 2008 wingding.ttf
  7. -rw-rw-r--? 1 senrsl senrsl??? 65788? 1月 22? 2002 WINGDNG2.TTF
  8. -rw-rw-r--? 1 senrsl senrsl??? 35328? 1月 22? 2002 WINGDNG3.TTF
  9. -rw-rw-r--? 1 senrsl senrsl 67419632? 6月 16 11:32 wps-office_9.1.0.4961~a18p1_amd64.deb
  10. senrsl@senrsl-ubuntu:~/share/temp$
效果不错



35,android里取PCM播放时长
(文件大小-头长度)/(采样率*采样数据*通道数/8?)=时长
(文件大小254472 -头长度0)/(采样率8000HZ*采样数据16bit*通道数1/?)=15.904

254472 / ( 8000 * 16 * 1 / ? ) = 15.904
计算得 ? = 8;
这个8是位转字节,单位就变成了 (字节/秒)

学习了几个名词跟公式
每秒传输速率(也叫位速,比特率,取样率) = 采样率8000HZ*采样数据16bit*通道数1 = 128000;
位速变成字节就是? 位速128000/8 =? 16000字节每秒[单位:字节/秒];
所以每秒传输速率是16000字节;

采样率的单位是赫兹[HZ].


36,No enclosing instance of type VsfKit is accessible. Must qualify the allocation with an enclosing instance of type VsfKit (e.g. x.new A() where x is an instance of VsfKit).

代码是这样的
  1. public class VsfKit extends VsfKitManager{
  2. ??? public VsfKit(Context ctx) {
  3. ??? ??? super(ctx);
  4. ??? }
  5. ???
  6. ??? public class VsfKitOpcode extends VsfOpcode{}
  7. ???
  8. ??? public class VsfKitRetcode extends VsfRetcode{}
  9. ???
  10. ??? public class VsfKitIcAppProxy extends IcAppProxy{}
  11. ???
  12. }
调用是这样的
  1. VsfKitIcAppProxy icap = new? VsfKitIcAppProxy();
然后就报了上面那个错.

两种解决方案:

1,把内部类定义成静态
  1. public static class VsfKitIcAppProxy extends IcAppProxy{}
2,或者使用主类的实例来new
  1. VsfKit kit = new VsfKit(this);
  2. VsfKitIcAppProxy icap = kit.new? VsfKitIcAppProxy();
都可以

37,Beginning dump of physical memory
虚拟机XP蓝屏....
0x000000000D1

38,修改android系统的版本号
编译出SDK以后放到sdk里面跟官方下载的同一个版本名字和版本号是一样的,难以区分.
改一下
文件/home/senrsl/android/source/WORKING_DIRECTORY/build/core /version_defaults.mk
修改
  1. ifeq "" "$(PLATFORM_VERSION)"
  2. ? # This is the canonical definition of the platform version,
  3. ? # which is the version that we reveal to the end user.
  4. ? # Update this value when the platform version changes (rather
  5. ? # than overriding it somewhere else).? Can be an arbitrary string.
  6. ? # PLATFORM_VERSION := 4.4.2
  7. ? PLATFORM_VERSION := SENRSL442
  8. endif
  9. ifeq "" "$(PLATFORM_SDK_VERSION)"
  10. ? # This is the canonical definition of the SDK version, which defines
  11. ? # the set of APIs and functionality available in the platform.? It
  12. ? # is a single integer that increases monotonically as updates to
  13. ? # the SDK are released.? It should only be incremented when the APIs for
  14. ? # the new release are frozen (so that developers don't write apps against
  15. ? # intermediate builds).? During development, this number remains at the
  16. ? # SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
  17. ? # the code-name of the new development work.
  18. ? # PLATFORM_SDK_VERSION := 19
  19. ? PLATFORM_SDK_VERSION := 1900
  20. endif
这样修改编译,编译的时候PLATFORM_VERSION := SENRSL442可以看到了,编译以后make sdk PLATFORM_SDK_VERSION := 1900可以生效



我想要修改Target Name 跟 Vendor

然后挨个的文件找!!!
看到了/home/senrsl/android/source/WORKING_DIRECTORY/build/core /build_id.mk里面定义了export BUILD_ID=KVT49L

看到了/home/senrsl/android/source/WORKING_DIRECTORY/sdk/docs /howto_build_SDK.txt里面有make sdk详细的教程
看到了/home/senrsl/android/source/WORKING_DIRECTORY/build /target/product/full.mk里有PRODUCT_BRAND := Android
看到了/home/senrsl/android/source/WORKING_DIRECTORY/build/target /product/sdk_x86.mk里有
  1. # Overrides
  2. PRODUCT_BRAND := generic_x86
  3. PRODUCT_NAME := sdk_x86
  4. PRODUCT_DEVICE := generic_x86
  5. PRODUCT_MODEL := Android SDK built for x86
看到了设备里的,也就是要成内核的/home/senrsl/android/source/WORKING_DIRECTORY/device /asus/deb/aosp_deb.mk里有
  1. PRODUCT_NAME := aosp_deb
  2. PRODUCT_DEVICE := deb
  3. PRODUCT_BRAND := Android
  4. PRODUCT_MODEL := AOSP on Deb
  5. PRODUCT_MANUFACTURER := ASUS
  6. PRODUCT_RESTRICT_VENDOR_FILES := true
这个文件旁边的BoardConfig.mk也有.
此处跳转39,建自己的签名,然后试试SDK的 target name跟vendor会不会变

编译的时候发现改了16也没调用到自己建的签名,反而调用到了platform签名
把之前那四个都改名
报错:
  1. aapt: warning: string 'pref_default_text_encoding_default' in packages/apps/Browser/res marked untranslatable but exists in locale 'ja'
  2. make: *** target R.java/Manifest.java: CertInstaller (out/target/common/obj/APPS/CertInstaller_intermediates/src/R.stamp)
  3. 没有规则可以创建"out/target/product/generic/obj/APPS /CertInstaller_intermediates/package.apk"需要的目标"build/target /product/security/platform.pk8"。 停止。
  4. make: *** 正在等待未完成的任务....
  5. Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
然后回去make -j16,报错
build/core/base_rules.mk:529: 警告:忽略关于目标"out/target/product/deb/system/bin/mm-qcamera-app"的旧命令
No private recovery resources for TARGET_DEVICE deb
target Export Resources: framework-res (out/target/common/obj/APPS/framework-res_intermediates/package-export.apk)
make: *** 没有规则可以创建"out/target/product/deb/obj/APPS/Bluetooth_intermediates /package.apk"需要的目标"build/target/product/security/platform.pk8"。 停止。
make: *** 正在等待未完成的任务....

然后找到/home/senrsl/android/source/WORKING_DIRECTORY/build/core /Makefile这里面也有定义
第100行
  1. # The "test-keys" tag marks builds signed with the old test keys,
  2. # which are available in the SDK.? "dev-keys" marks builds signed with
  3. # non-default dev keys (usually private keys from a vendor directory).
  4. # Both of these tags will be removed and replaced with "release-keys"
  5. # when the target-files is signed in a post-build step.
  6. ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/target/product/security/testkey)
  7. BUILD_KEYS := test-keys
  8. else
  9. BUILD_KEYS := dev-keys
  10. endif
  11. BUILD_VERSION_TAGS += $(BUILD_KEYS)
  12. BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
改成
  1. ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/target/product/security/SENRSL)
  2. BUILD_KEYS := test-keys
  3. else
  4. BUILD_KEYS := dev-keys
  5. endif
  6. BUILD_VERSION_TAGS += release-keys
  7. BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
报错
  1. No private recovery resources for TARGET_DEVICE deb
  2. target R.java/Manifest.java: framework-res (out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp)
  3. make: *** 没有规则可以创建"out/target/product/deb/obj/APPS/Bluetooth_intermediates /package.apk"需要的目标"build/target/product/security /platform.pk8"。 停止。
  4. make: *** 正在等待未完成的任务....
还是上面那个make -j16的错误

2015年06月25日20:51:16
好吧,我不那么搞了
把那系统那四个签名重新生成一遍,用自己的信息....
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./development/tools/make_key SENRSL '/C=CN/ST=Beijing/L=Water View/O=senrsl/OU=senrsl/CN=senrsl/emailAddress=senRsl@126.com'
  2. Enter password for 'senrsl' (blank for none; password will be visible): yuming
  3. creating senrsl.pk8 with password [yuming]
  4. Generating RSA private key, 2048 bit long modulus
  5. ............+++
  6. ...........................................................+++
  7. e is 65537 (0x10001)
  8. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./development/tools/make_key senrsl '/C=CN/ST=Beijing/L=Water View/O=senrsl/OU=senrsl/CN=senrsl/emailAddress=senRsl@126.com'
  9. Enter password for 'senrsl' (blank for none; password will be visible):
  10. creating senrsl.pk8 with no password
  11. Generating RSA private key, 2048 bit long modulus
  12. ................................+++
  13. .........+++
  14. e is 65537 (0x10001)
  15. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./development/tools/make_key testkey '/C=CN/ST=Beijing/L=Water View/O=senrsl/OU=senrsl/CN=senrsl/emailAddress=senRsl@126.com'
  16. Enter password for 'testkey' (blank for none; password will be visible):
  17. creating testkey.pk8 with no password
  18. Generating RSA private key, 2048 bit long modulus
  19. ...........+++
  20. ............................................................+++
  21. e is 65537 (0x10001)
  22. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./development/tools/make_key platform '/C=CN/ST=Beijing/L=Water View/O=senrsl/OU=senrsl/CN=senrsl/emailAddress=senRsl@126.com'
  23. Enter password for 'platform' (blank for none; password will be visible):
  24. creating platform.pk8 with no password
  25. Generating RSA private key, 2048 bit long modulus
  26. .+++
  27. .....................................................................................................................................................................................................................+++
  28. e is 65537 (0x10001)
  29. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./development/tools/make_key shared '/C=CN/ST=Beijing/L=Water View/O=senrsl/OU=senrsl/CN=senrsl/emailAddress=senRsl@126.com'
  30. Enter password for 'shared' (blank for none; password will be visible):
  31. creating shared.pk8 with no password
  32. Generating RSA private key, 2048 bit long modulus
  33. ...................................+++
  34. ..+++
  35. e is 65537 (0x10001)
  36. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./development/tools/make_key media '/C=CN/ST=Beijing/L=Water View/O=senrsl/OU=senrsl/CN=senrsl/emailAddress=senRsl@126.com'
  37. Enter password for 'media' (blank for none; password will be visible):
  38. creating media.pk8 with no password
  39. Generating RSA private key, 2048 bit long modulus
  40. ..........................+++
  41. ..............+++
  42. e is 65537 (0x10001)
  43. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$
然后查看一下
  1. senrsl@senrsl-ubuntu:~$ cd android/source/WORKING_DIRECTORY/build/target/product/security/
  2. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/build/target/product/security$ ll
  3. 总用量 60
  4. drwxrwxr-x 2 senrsl senrsl 4096? 6月 25 20:53 ./
  5. drwxrwxr-x 3 senrsl senrsl 4096? 6月 25 15:22 ../
  6. -rw-rw-r-- 1 senrsl senrsl 1218? 6月 25 20:52 media.pk8
  7. -rw-rw-r-- 1 senrsl senrsl 1424? 6月 25 20:52 media.x509.pem
  8. -rw-rw-r-- 1 senrsl senrsl 1216? 6月 25 20:52 platform.pk8
  9. -rw-rw-r-- 1 senrsl senrsl 1424? 6月 25 20:52 platform.x509.pem
  10. -rw-rw-r-- 1 senrsl senrsl 2289? 6月 25 20:52 README
  11. -rw-rw-r-- 1 senrsl senrsl 1891? 6月 25 18:34 README~
  12. -rw-rw-r-- 1 senrsl senrsl 8378? 6月 25 20:49 security.tar.gz
  13. -rw-rw-r-- 1 senrsl senrsl 1216? 6月 25 20:52 shared.pk8
  14. -rw-rw-r-- 1 senrsl senrsl 1424? 6月 25 20:52 shared.x509.pem
  15. -rw-rw-r-- 1 senrsl senrsl 1218? 6月 25 20:52 testkey.pk8
  16. -rw-rw-r-- 1 senrsl senrsl 1424? 6月 25 20:52 testkey.x509.pem
  17. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/build/target/product/security$ openssl x509 -in testkey.x509.pem -noout -text
  18. Certificate:
  19. ??? Data:
  20. ??????? Version: 3 (0x2)
  21. ??????? Serial Number: 9943996325042237834 (0x8a002bf8d9eeb18a)
  22. ??? Signature Algorithm: sha1WithRSAEncryption
  23. ??????? Issuer: C=CN, ST=Beijing, L=Water View, O=senrsl, OU=senrsl, CN=senrsl/emailAddress=senRsl@126.com
  24. ??????? Validity
  25. ??????????? Not Before: Jun 25 12:52:32 2015 GMT
  26. ??????????? Not After : Nov 10 12:52:32 2042 GMT
  27. ??????? Subject: C=CN, ST=Beijing, L=Water View, O=senrsl, OU=senrsl, CN=senrsl/emailAddress=senRsl@126.com
  28. ??????? Subject Public Key Info:
  29. ??????????? Public Key Algorithm: rsaEncryption
  30. ??????????????? Public-Key: (2048 bit)
  31. ??????????????? Modulus:
  32. ??????????????????? 00:d5:2c:87:a2:ff:62:67:2f:be:5e:98:92:b5:fb:
  33. ??????????????????? cf:b6:fa:9d:9b:54:fa:e3:77:bd:ff:93:fe:4b:9f:
  34. ??????????????????? 89:fa:e7:20:31:aa:05:0b:ec:b5:f4:27:44:55:ba:
  35. ??????????????????? 71:11:06:2a:78:9b:3e:33:96:b4:d0:1d:dd:54:62:
  36. ??????????????????? 96:26:84:fc:96:ab:0c:39:6d:93:ba:b2:6f:ec:23:
  37. ??????????????????? c3:69:c3:f8:c3:8f:05:3d:b3:c9:14:f8:4c:dd:ef:
  38. ??????????????????? 6b:60:22:44:74:d5:63:33:a5:72:0d:d5:19:f9:d0:
  39. ??????????????????? 65:90:1f:df:94:4d:76:a7:39:ec:ad:fa:2e:64:53:
  40. ??????????????????? 02:b9:42:9b:9a:81:76:3c:93:b3:3a:f5:a0:48:8c:
  41. ??????????????????? 3a:ac:53:ef:9f:92:4c:64:21:bc:1c:a7:d6:0a:ac:
  42. ??????????????????? a4:52:f7:05:27:8c:64:05:ec:74:01:32:1f:8f:f5:
  43. ??????????????????? 10:b1:6e:09:f9:48:ca:17:a3:46:0b:2f:6b:9b:5c:
  44. ??????????????????? c5:ec:b7:a6:5c:95:46:3f:63:a6:f5:56:a6:2e:7e:
  45. ??????????????????? 99:40:2c:f5:fe:90:9f:2c:15:47:2d:9f:c6:4d:06:
  46. ??????????????????? 9a:fb:8e:dc:df:a8:91:a4:f9:39:4b:69:02:43:e7:
  47. ??????????????????? f4:6b:da:8c:f9:82:50:02:5e:c1:00:9e:79:f3:21:
  48. ??????????????????? 89:be:74:4e:03:1f:fe:0c:b5:22:25:5b:37:24:1c:
  49. ??????????????????? ba:ad
  50. ??????????????? Exponent: 65537 (0x10001)
  51. ??????? X509v3 extensions:
  52. ??????????? X509v3 Subject Key Identifier:
  53. ??????????????? E3:13:20:BC:43:C1:46:9C:62:8B:B6:6E:07:3C:81:D4:8E:F6:A5:EE
  54. ??????????? X509v3 Authority Key Identifier:
  55. ??????????????? keyid:E3:13:20:BC:43:C1:46:9C:62:8B:B6:6E:07:3C:81:D4:8E:F6:A5:EE
  56. ??????????? X509v3 Basic Constraints:
  57. ??????????????? CA:TRUE
  58. ??? Signature Algorithm: sha1WithRSAEncryption
  59. ???????? 1f:80:38:a9:ee:60:da:55:5c:aa:f7:59:c0:81:d1:75:0c:06:
  60. ???????? 81:29:fd:85:27:38:64:4b:83:e2:ce:d2:5b:8b:a3:3e:ba:45:
  61. ???????? 81:76:a6:01:8f:b9:24:c9:af:33:6b:49:37:ef:07:46:57:d7:
  62. ???????? 5a:8d:da:37:a5:d3:fa:37:b9:4a:ff:68:75:9d:40:d0:ff:7e:
  63. ???????? 47:d8:f7:18:63:7b:00:57:e4:38:78:22:2d:6b:42:0e:05:e9:
  64. ???????? c6:ba:07:d8:d2:25:66:48:7e:6d:56:52:a1:ce:29:6a:a5:d1:
  65. ???????? 2d:50:5f:b4:ec:ea:88:f1:89:fd:8b:71:8f:a2:1b:43:a0:1d:
  66. ???????? e0:9d:5a:90:a6:ea:1a:b6:ee:92:d4:0a:44:1d:3c:84:9e:d6:
  67. ???????? c2:2e:5a:b5:e4:a2:72:dd:18:8f:99:30:36:b4:ba:b8:83:10:
  68. ???????? d3:e8:14:ac:f3:66:34:80:c6:36:a7:6d:b2:0f:2b:c2:2a:9b:
  69. ???????? 18:3c:51:b9:de:b7:5b:3f:e4:3b:a0:22:cd:6c:d3:dd:59:48:
  70. ???????? 47:37:4c:6f:ce:a1:c0:54:60:04:2a:6d:c1:0d:23:64:8c:84:
  71. ???????? 3b:7a:1a:26:c2:74:ef:30:d1:db:35:81:f0:f7:00:37:67:b0:
  72. ???????? 8f:10:56:42:bc:d4:e2:df:b1:f9:ef:f9:c3:e2:f5:b7:7f:50:
  73. ???????? 71:e8:de:1d
  74. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/build/target/product/security$
系统的这四个签名
testkey -- a generic key for packages that do not otherwise specify a key.
platform -- a test key for packages that are part of the core platform.
shared -- a test key for things that are shared in the home/contacts process.
media -- a test key for packages that are part of the media/download system.
在系统的一次编译中,这四个签名都会用到,不是只用一个.

好吧,鉴定得那个名字跟签名没关系..........

//TODO 好吧 这问题保留....从中午搞这个搞到2015年06月25日21:26:20,哎╮(╯▽╰)╭........

解决这个问题,看来应该先去看ADT的源码,看这俩值从哪读的....

39,创建签名

然后试试自己修改签名....
签名目录
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY/build/target/product/security$ ll
  2. 总用量 56
  3. drwxrwxr-x 2 senrsl senrsl 4096? 6月 25 18:36 ./
  4. drwxrwxr-x 3 senrsl senrsl 4096? 6月 25 15:22 ../
  5. -rw-rw-r-- 1 senrsl senrsl 1216? 3月 20 13:35 media.pk8
  6. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 media.x509.pem
  7. -rw-rw-r-- 1 senrsl senrsl 1216? 3月 20 13:35 platform.pk8
  8. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 platform.x509.pem
  9. -rw-rw-r-- 1 senrsl senrsl 1891? 6月 25 18:34 README
  10. -rw-rw-r-- 1 senrsl senrsl 1758? 3月 20 13:35 README~
  11. -rw-rw-r-- 1 senrsl senrsl 1218? 3月 20 13:35 shared.pk8
  12. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 shared.x509.pem
  13. -rw-rw-r-- 1 senrsl senrsl 1217? 3月 20 13:35 testkey.pk8
  14. -rw-rw-r-- 1 senrsl senrsl 1675? 3月 20 13:35 testkey.x509.pem
  15. -rw-rw-r-- 1 senrsl senrsl 1261? 6月 25 18:34 senrsl.pk8
  16. -rw-rw-r-- 1 senrsl senrsl 1424? 6月 25 18:34 senrsl.x509.pem
创建签名的方法在/home/senrsl/android/source/WORKING_DIRECTORY/build/target /product/security/README文件里
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ ./development/tools/make_key senrsl '/C=CN/ST=Beijing/L=Water View/O=senrsl/OU=senrsl/CN=senrsl/emailAddress=senRsl@126.com'
  2. Enter password for 'senrsl' (blank for none; password will be visible): yuming
  3. creating senrsl.pk8 with password [yuming]
  4. Generating RSA private key, 2048 bit long modulus
  5. ............+++
  6. ...........................................................+++
  7. e is 65537 (0x10001)
  8. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$
签名生成在了当前目录,扔到/home/senrsl/android/source/WORKING_DIRECTORY/build /target/product/security/目录去
然后改文件,在上面第16条.
然后 make -j16
报错
  1. failed to reconstruct target deflate chunk 1 [(null)]; treating as normal
  2. Enter password for build/target/product/security/senrsl.pk8 (password will not be hidden): java.lang.NullPointerException
  3. ??? at com.android.signapk.SignApk.decryptPrivateKey(SignApk.java:185)
  4. ??? at com.android.signapk.SignApk.readPrivateKey(SignApk.java:209)
  5. ??? at com.android.signapk.SignApk.main(SignApk.java:760)
  6. make: *** [out/target/product/deb/obj/APPS/Exchange2_intermediates/package.apk] 错误 1
  7. make: *** 正在等待未完成的任务....
出现这个问题的原因是我用make -j16,16个线程在编译,需要我输入密码的时候其他线程在跑....
好吧,只好生成一个不用密码的....

然后make -j16成功

注:
C ---> Country Name (2 letter code)
ST ---> State or Province Name (full name)
L ---> Locality Name (eg, city)
O ---> Organization Name (eg, company)
OU ---> Organizational Unit Name (eg, section)
CN ---> Common Name (eg, your name or your server's hostname)
emailAddress ---> Contact email address

40,建了个activity,使用默认的onCreateOptionsMenu,菜单栏死活不显示那三个点....
把/home/senrsl/android/workspace_luna/TestVoiceTime/res/values-v11跟
/home/senrsl/android/workspace_luna/TestVoiceTime/res/values-v14这俩文件 夹加上,里面分别是:
  1. <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> </style>

  1. ?<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> </style>
41,用PreferenceScreen下的ListPreference标签,一直空指针.....

  1. ??? ?? android:entries="@array/list_encoding_key"
  2. ??????? android:entryValues="@array/list_encoding_value"
这俩用的array标签必须是string-array.....

42,find加grep搜索android源码
  1. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ export GREP_OPTIONS="--color=auto"
  2. senrsl@senrsl-ubuntu:~/android/source/WORKING_DIRECTORY$ find . -name *.mk|xargs grep Calendar

43,ubuntu查看十六进制
之前用UE,然后30天过期了....
vi也可以
vi打开文件
  1. senrsl@senrsl-ubuntu:~/doc/DriovS/AndroidOS/DOC/VSF/ProtocolData$ vi 0x8001
  2. #查看十六进制形式
  3. :%!xxd
  4. #转换回默认形式
  5. :%!xxd -r


二进制打开的时候要用vi -b 0x8001,不然会自动在后面加上一个换行符 0a.

几种形态
:%!xxd -g 1? //①一个字节一组


:%!xxd -g 2? //②两个字节一组(默认)


:%!xxd -g 4 //四个字节一组
:%!xxd -r? //恢复成默认


44,ubuntu卸载UE
之前从官网下的包,直接安上,发现卸不了了.....
senrsl@senrsl-ubuntu:~$ sudo dpkg -P uex
[sudo] password for senrsl:
(正在读取数据库 ... 系统当前共安装有 221182 个文件和目录。)
Removing uex (15.1.0.0) ...
Purging configuration files for uex (15.1.0.0) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1) ...
就卸掉了

45,android应用降级安装
使用 pm install -r -d file.apk命令

senrsl@senrsl-ubuntu:~$ adb devices
List of devices attached
da91853a??? device

senrsl@senrsl-ubuntu:~$ adb shell
shell@virgo:/ $ cd /mnt/sdcard
shell@virgo:/mnt/sdcard $ cd D
DCIM/???? Download/
shell@virgo:/mnt/sdcard $ cd Download/????????????????????????????????????????
shell@virgo:/mnt/sdcard/Download $ ll
drwxrwx--- root???? sdcard_r????????? 2015-07-11 18:10 aliyun
-rw-rw---- root???? sdcard_r 17567019 2015-07-14 19:10 wangyixinwen_4.2.1_372.apk
-rw-rw---- root???? sdcard_r 12973493 2015-07-14 19:11 wangyiyunyinxyue_2.5.1_43.apk
shell@virgo:/mnt/sdcard/Download $ pm install -r -d w
wangyixinwen_4.2.1_372.apk????????????? wangyiyunyinxyue_2.5.1_43.apk
all -r -d wangyiyunyinxyue_2.5.1_43.apk?????????????????????????????????????? <
??? pkg: wangyiyunyinxyue_2.5.1_43.apk
Success
shell@virgo:/mnt/sdcard/Download $ pm install -r -d wa????????????????????????
wangyixinwen_4.2.1_372.apk????????????? wangyiyunyinxyue_2.5.1_43.apk
nstall -r -d wangyixinwen_4.2.1_372.apk?????????????????????????????????????? <
??? pkg: wangyixinwen_4.2.1_372.apk
Success
shell@virgo:/mnt/sdcard/Download $

46, 07-16 06:51:32.656: E/InputDispatcher(652): channel '41fd31e8 cn.senrsl.asr.offline/cn.senrsl.asr.offline.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
这是引用的JNI报的问题....

47,一个好用的差异比较工具Meld
  1. senrsl@senrsl-ubuntu:~$ sudo apt-get install meld
  2. [sudo] password for senrsl:
  3. 正在读取软件包列表... 完成
  4. 正在分析软件包的依赖关系树??????
  5. 正在读取状态信息... 完成??????
  6. 将会安装下列额外的软件包:
  7. ? libbonoboui2-0 libbonoboui2-common libgnomecanvas2-0 libgnomecanvas2-common
  8. ? libgnomeui-0 libgnomeui-common libgtksourceview2.0-0
  9. ? libgtksourceview2.0-common python-gnome2 python-gtksourceview2
  10. ? python-pyorbit
  11. 建议安装的软件包:
  12. ? python-gnome2-doc libgtksourceview2.0-dev python-pyorbit-dbg
  13. 下列【新】软件包将被安装:
  14. ? libbonoboui2-0 libbonoboui2-common libgnomecanvas2-0 libgnomecanvas2-common
  15. ? libgnomeui-0 libgnomeui-common libgtksourceview2.0-0
  16. ? libgtksourceview2.0-common meld python-gnome2 python-gtksourceview2
  17. ? python-pyorbit
  18. 升级了 0 个软件包,新安装了 12 个软件包,要卸载 0 个软件包,有 1 个软件包未被升级。
  19. 需要下载 1,682 kB 的软件包。
  20. 解压缩后会消耗掉 10.6 MB 的额外空间。
  21. 您希望继续执行吗? [Y/n] Y
  22. 获取:1 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libgnomecanvas2-common all 2.30.3-2 [9,080 B]
  23. 获取:2 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libgnomecanvas2-0 amd64 2.30.3-2 [82.7 kB]
  24. 获取:3 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libbonoboui2-common all 2.24.5-0ubuntu3 [11.4 kB]
  25. 获取:4 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libbonoboui2-0 amd64 2.24.5-0ubuntu3 [151 kB]
  26. 获取:5 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libgnomeui-common all 2.24.5-3 [16.5 kB]
  27. 获取:6 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libgnomeui-0 amd64 2.24.5-3 [203 kB]
  28. 获取:7 http://cn.archive.ubuntu.com/ubuntu/ trusty/universe libgtksourceview2.0-common all 2.10.5-1ubuntu2 [434 kB]
  29. 获取:8 http://cn.archive.ubuntu.com/ubuntu/ trusty/universe libgtksourceview2.0-0 amd64 2.10.5-1ubuntu2 [145 kB]
  30. 获取:9 http://cn.archive.ubuntu.com/ubuntu/ trusty/universe meld all 1.8.4-1 [342 kB]
  31. 获取:10 http://cn.archive.ubuntu.com/ubuntu/ trusty/main python-pyorbit amd64 2.24.0-6ubuntu4 [57.2 kB]
  32. 获取:11 http://cn.archive.ubuntu.com/ubuntu/ trusty/main python-gnome2 amd64 2.28.1+dfsg-1ubuntu2 [136 kB]
  33. 获取:12 http://cn.archive.ubuntu.com/ubuntu/ trusty/universe python-gtksourceview2 amd64 2.10.1-2build1 [93.7 kB]
  34. 下载 1,682 kB,耗时 3秒 (460 kB/s)??????????????
  35. Selecting previously unselected package libgnomecanvas2-common.
  36. (正在读取数据库 ... 系统当前共安装有 221425 个文件和目录。)
  37. Preparing to unpack .../libgnomecanvas2-common_2.30.3-2_all.deb ...
  38. Unpacking libgnomecanvas2-common (2.30.3-2) ...
  39. Selecting previously unselected package libgnomecanvas2-0:amd64.
  40. Preparing to unpack .../libgnomecanvas2-0_2.30.3-2_amd64.deb ...
  41. Unpacking libgnomecanvas2-0:amd64 (2.30.3-2) ...
  42. Selecting previously unselected package libbonoboui2-common.
  43. Preparing to unpack .../libbonoboui2-common_2.24.5-0ubuntu3_all.deb ...
  44. Unpacking libbonoboui2-common (2.24.5-0ubuntu3) ...
  45. Selecting previously unselected package libbonoboui2-0:amd64.
  46. Preparing to unpack .../libbonoboui2-0_2.24.5-0ubuntu3_amd64.deb ...
  47. Unpacking libbonoboui2-0:amd64 (2.24.5-0ubuntu3) ...
  48. Selecting previously unselected package libgnomeui-common.
  49. Preparing to unpack .../libgnomeui-common_2.24.5-3_all.deb ...
  50. Unpacking libgnomeui-common (2.24.5-3) ...
  51. Selecting previously unselected package libgnomeui-0:amd64.
  52. Preparing to unpack .../libgnomeui-0_2.24.5-3_amd64.deb ...
  53. Unpacking libgnomeui-0:amd64 (2.24.5-3) ...
  54. Selecting previously unselected package libgtksourceview2.0-common.
  55. Preparing to unpack .../libgtksourceview2.0-common_2.10.5-1ubuntu2_all.deb ...
  56. Unpacking libgtksourceview2.0-common (2.10.5-1ubuntu2) ...
  57. Selecting previously unselected package libgtksourceview2.0-0.
  58. Preparing to unpack .../libgtksourceview2.0-0_2.10.5-1ubuntu2_amd64.deb ...
  59. Unpacking libgtksourceview2.0-0 (2.10.5-1ubuntu2) ...
  60. Selecting previously unselected package meld.
  61. Preparing to unpack .../archives/meld_1.8.4-1_all.deb ...
  62. Unpacking meld (1.8.4-1) ...
  63. Selecting previously unselected package python-pyorbit.
  64. Preparing to unpack .../python-pyorbit_2.24.0-6ubuntu4_amd64.deb ...
  65. Unpacking python-pyorbit (2.24.0-6ubuntu4) ...
  66. Selecting previously unselected package python-gnome2.
  67. Preparing to unpack .../python-gnome2_2.28.1+dfsg-1ubuntu2_amd64.deb ...
  68. Unpacking python-gnome2 (2.28.1+dfsg-1ubuntu2) ...
  69. Selecting previously unselected package python-gtksourceview2.
  70. Preparing to unpack .../python-gtksourceview2_2.10.1-2build1_amd64.deb ...
  71. Unpacking python-gtksourceview2 (2.10.1-2build1) ...
  72. Processing triggers for man-db (2.6.7.1-1) ...
  73. Processing triggers for hicolor-icon-theme (0.13-1) ...
  74. Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
  75. Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
  76. Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
  77. Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
  78. Rebuilding /usr/share/applications/bamf-2.index...
  79. Processing triggers for mime-support (3.54ubuntu1) ...
  80. 正在设置 libgnomecanvas2-common (2.30.3-2) ...
  81. 正在设置 libgnomecanvas2-0:amd64 (2.30.3-2) ...
  82. 正在设置 libbonoboui2-common (2.24.5-0ubuntu3) ...
  83. 正在设置 libbonoboui2-0:amd64 (2.24.5-0ubuntu3) ...
  84. 正在设置 libgnomeui-common (2.24.5-3) ...
  85. 正在设置 libgnomeui-0:amd64 (2.24.5-3) ...
  86. 正在设置 libgtksourceview2.0-common (2.10.5-1ubuntu2) ...
  87. 正在设置 libgtksourceview2.0-0 (2.10.5-1ubuntu2) ...
  88. 正在设置 meld (1.8.4-1) ...
  89. 正在设置 python-pyorbit (2.24.0-6ubuntu4) ...
  90. 正在设置 python-gnome2 (2.28.1+dfsg-1ubuntu2) ...
  91. 正在设置 python-gtksourceview2 (2.10.1-2build1) ...
  92. Processing triggers for libc-bin (2.19-0ubuntu6) ...
  93. senrsl@senrsl-ubuntu:~$

48,emacs十六进制
ALT+X,然后输入hexl-mode进入16进制

49,jar混淆
用fatjar导出一堆jar,需要混淆用以发布.
ADT里面自带了好东西
  1. senrsl@senrsl-ubuntu:~$ ls /home/senrsl/android/adt-bundle-linux-x86_64-20140702/sdk/tools/proguard/bin
  2. proguardgui.sh? proguard.sh? retrace.sh
  3. senrsl@senrsl-ubuntu:~$
看一下混淆脚本,实际执行了混淆的jar,然后传了俩参数进去
  1. PROGUARD_HOME=`dirname "$0"`/..
  2. java -jar $PROGUARD_HOME/lib/proguard.jar "$@"
翻了以下,第一个参数的目录是这个
然后第二个参数是要混淆的配置文件,用项目的proguard-project.txt就行,要重新写个配置文件pro_voiceprint
然后执行
  1. senrsl@senrsl-ubuntu:~/share/VOICE/VD/TestVoiceprint/libs$ java -jar /home/senrsl/android/adt-bundle-linux-x86_64-20140702/sdk/tools/proguard/lib/proguard.jar@/home/senrsl/share/VOICE/VD/VDialogSDKWithUI_Single/exp/pro_voiceprint
然后就好了....

50,Type Symbol 'NULL' could not be resolved
突然发现C不能放下,然后打开项目发现好多类型找不到了....
在另一个workspace是正常的,这个是新建的,所有配置都一样的,为什么不行.....

project clean 也不行....
然后google一下,找到了答案.
As Bob mentioned, i fix the bug just by rebuilt the index

right your project
choose "Index"
choose "Rebuild"

2015年08月04日19:18:49? 50问结

--
senRsl
2015年05月04日11:22:07

没有评论 :

发表评论