转载请注明出处

一、反编译APK文件,查看包结构


// Android库,不多解释
android.support // HttpClient 4.1 repackaged for Android
// http://www.findbestopensource.com/product/httpclientandroidlib
// https://github.com/surespot/httpclientandroidlib
ch.boye.httpclientandroidlib

// 国内用百度地图
com.baidu.*
vi.com.gdi.bgl.android.java // 谷歌的广告系统和移动服务系统
com.google.ads.*
com.google.android.gms // 主要功能实现部分
com.teslamotors.api // 封装了http接口
com.teslamotors.service // 数据交互服务
com.teslamotors.client // 对service接口的封装,供上层的调用
com.leslamotors.data // 控制指令和状态数据的封装, parcel
com.teslamotors.tesla // 主activity,login activity,receiver等实现
com.teslamotors.tesla.fragments // 各种界面的fragment实现
com.teslamotors.util // 零零散散,连工具类都算不得
com.teslamotors.views // 自定义view

二、assets目录下的密钥及证书文件

1. sapi_cert.cer : (百度地图使用)

InputStream ip = this.b.getResources().getAssets().open("sapi_cert.cer");
        Certificate certificate = ((CertificateFactory)localObject4).generateCertificate((InputStream)ip);
        ((InputStream)ip).close();
        KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
        ((KeyStore)ks).load(null, null);
        ((KeyStore)ks).setCertificateEntry("ca", (Certificate)certificate);

2. trust.keystore,在代码中发现以下内容,这是赤裸裸的密钥吗?

private static final java.lang.String TRUST_ASSET = "trust.keystore";
private static final java.lang.String TRUST_PASSWD = "qXD5wUA3qVySNr39Nc8sFEtKXUr3Mg";
Aliase : mykey
加密算法 : RSA,
证书标准 : X.509 公钥:
30 82 01 22 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03
82 01 0f 00 30 82 01 0a 02 82 01 01 00 b6 e0 2f c2 24 06 c8
6d 04 5f d7 ef 0a 64 06 b2 7d 22 26 65 16 ae 42 40 9b ce dc
9f 9f 76 07 3e c3 30 55 87 19 b9 4f 94 0e 5a 94 1f 55 56 b4
c2 02 2a af d0 98 ee 0b 40 d7 c4 d0 3b 72 c8 14 9e ef 90 b1
11 a9 ae d2 c8 b8 43 3a d9 0b 0b d5 d5 95 f5 40 af c8 1d ed
4d 9c 5f 57 b7 86 50 68 99 f5 8a da d2 c7 05 1f a8 97 c9 dc
a4 b1 82 84 2d c6 ad a5 9c c7 19 82 a6 85 0f 5e 44 58 2a 37
8f fd 35 f1 0b 08 27 32 5a f5 bb 8b 9e a4 bd 51 d0 27 e2 dd
3b 42 33 a3 05 28 c4 bb 28 cc 9a ac 2b 23 0d 78 c6 7b e6 5e
71 b7 4a 3e 08 fb 81 b7 16 16 a1 9d 23 12 4d e5 d7 92 08 ac
75 a4 9c ba cd 17 b2 1e 44 35 65 7f 53 25 39 d1 1c 0a 9a 63
1b 19 92 74 68 0a 37 c2 c2 52 48 cb 39 5a a2 b6 e1 5d c1 dd
a0 20 b8 21 a2 93 26 6f 14 4a 21 41 c7 ed 6d 9b f2 48 2f f3
03 f5 a2 68 92 53 2f 5e e3 02 03 01 00 01

附上解析代码:

    public static void parseTeslaKeystore(Context context) {
String password = "qXD5wUA3qVySNr39Nc8sFEtKXUr3Mg";
String fileName = "tesla_trust.keystore"; InputStream inputStream = getAssetFile(context, fileName); KeyStore keystore = getKeystore(inputStream, password);
echoKeystore(keystore);
} private static KeyStore getKeystore(InputStream inputStream, String password) {
try {
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(inputStream, password.toCharArray());
inputStream.close();
return keystore;
} catch (IOException e) {
e.printStackTrace();
} catch (CertificateException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyStoreException e) {
e.printStackTrace();
} return null;
} private static InputStream getAssetFile(Context context, String fileName) {
Assert.assertNotNull(fileName);
InputStream inputStream = null; try {
inputStream = context.getAssets().open(fileName);
return inputStream;
} catch (IOException e) {
e.printStackTrace();
} return inputStream;
}

Android开发笔记之《特斯拉-Tesla 代码分析》的更多相关文章

  1. Android开发笔记之《Window下安装Ubuntu双系统,Grub无法显示Window选项》

    解决方法是: 在terminal里面输入: sudo update-grub 会找到windows的grub 重启电脑就可以了.

  2. Windows 下安装 Ubuntu 双系统(更新)

    Windows + Ubuntu 16.04 ---> 双系统 前言:本篇文章是对之前文章的更新,更新的主内容是把原来用手机拍摄的图片换成了虚拟机的截图,以及对磁盘划分的新的见解和一些使用感受, ...

  3. 怎样在Win10下安装ubuntu双系统

    Win10系统下安装ubuntu系统 安装前准备: 概念 在动手之前,一定要先了解双系统.系统引导.分区这3个概念,这样才能理解安装步骤,应对安装过程中的意外情况. 双系统 双系统就是开机之后,会有一 ...

  4. win8下安装ubuntu双系统

    终于成功在win8下安装成功ubuntu13.10, 安装方法来源于http://forum.ubuntu.org.cn/viewtopic.php?t=446557 下面的文件是该楼主的将安装ubu ...

  5. [Linux]三种方案在Windows系统下安装ubuntu双系统(转)

    在学习linux的过程中,ubuntu无疑是初学者的最佳选择. 下面来列举给Windows系统安装ubuntu双系统的三种方法. 一.虚拟机安装(不推荐) 使用工具:Vmware 如果不是因为迫不得已 ...

  6. 【学习总结】win7下安装Ubuntu双系统的日常

    参考文献 1 - [双系统中删除linux(win7适用) ] 2 - [win7(32位)U盘安装.卸载ubuntu(64位)双系统] 3 - [Windows下安装Ubuntu 16.04双系统] ...

  7. win7下安装ubuntu双系统的方法及心得体会(ps:要死好几回的节奏)

    1.win7下安装ubuntu系统后,可以很好进入ubuntu系统 但是进不去win7,开机有win7选项,但是选择后不管用 方法思路:各种修复win7的mbr 我的问题是:在winpe中发现,根本看 ...

  8. Win7下安装Ubuntu双系统常见问题

    [转自己以前的文章] 导航: ● win7下硬盘安装ubuntu常见问题 ●  win7下u盘安装ubuntu常见问题 吐槽: Ubuntu的安装花了我将近15个小时,网上常见的.不常见的问题基本我都 ...

  9. 学习笔记42—Win7下安装Linux双系统

    1.下载Linux镜像:http://mirrors.163.com/ubuntu-releases/18.04.1/ 方法一: 1.用软通牒软件将Linux的镜像写入空的优盘中, 具体如下: 1) ...

  10. 三种方案在Windows系统下安装ubuntu双系统

    一.虚拟机安装(不推荐) 使用工具:Vmware 如果不是因为迫不得已,比如Mac OS对硬件不兼容,Federa安装频繁出错,各种驱动不全等等,不推荐使用虚拟机安装. 个人感觉这是一种对操作系统的亵 ...

随机推荐

  1. 一步步实现ABAP后台导入EXCEL到数据库【3】

    在一步步实现ABAP后台导入EXCEL到数据库[2]里,我们已经实现计划后台作业将数据导入数据库的功能.但是,这只是针对一个简单的自定义结构的导入程序.在实践应用中,面对不同的表.不同的导入文件,我们 ...

  2. 安装cocoapods以及更新cocoapods

    安装 1.设置ruby的软件源 这是因为ruby的软件源rubygems.org因为使用亚马逊的云服务,被我天朝屏蔽了,需要更新一下ruby的源,过程如下: gem sources -l #(查看当前 ...

  3. [Modern OpenGL系列(三)]用OpenGL绘制一个三角形

    本文已同步发表在CSDN:http://blog.csdn.net/wenxin2011/article/details/51347008 在上一篇文章中已经介绍了OpenGL窗口的创建.本文接着说如 ...

  4. 关于在安装MySQL时报错"本地计算机上的mysql服务启动后停止,某些服务在未由其他服务或程序使用时将自动停止"的解决方法

    首先将你下载的MySQL安装或者解压(对应安装版和解压版),下载地址http://dev.mysql.com/downloads/mysql/ 然后复制你安装目录中的my-default.ini,更改 ...

  5. JQuery 了解

    jQuery是什么?为什么是这样?怎么用? jQuery是对JavaScript的一种封装,是一个常用功能库.javascript是做什么的jquery就是做啥的.用它主要使写js更简便而强大,有些功 ...

  6. 为什么 C++ 中成员函数指针是 16 字节?

    当我们讨论指针时,通常假设它是一种可以用 void * 指针来表示的东西,在 x86_64 平台下是 8 个字节大小.例如,下面是来自 维基百科中关于 x86_64 的文章 的摘录: Pushes a ...

  7. BZOJ 1087: [SCOI2005]互不侵犯King [状压DP]

    1087: [SCOI2005]互不侵犯King Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 3336  Solved: 1936[Submit][ ...

  8. [bzoj3123][sdoi2013森林] (树上主席树+lca+并查集启发式合并+暴力重构森林)

    Description Input 第一行包含一个正整数testcase,表示当前测试数据的测试点编号.保证1≤testcase≤20. 第二行包含三个整数N,M,T,分别表示节点数.初始边数.操作数 ...

  9. [LeetCode] Merge k Sorted Lists 合并k个有序链表

    Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 这 ...

  10. 【java基础系列】一、常用命令行

    常用的DOS命令: dir:列出当前目录下的文件以及文件夹 md:创建目录 rd:删除目录 cd:进入指定目录 cd..:退回到上一级目录 cd\:退回到根目录 del:删除文件 exit:退出dos ...