-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
216 lines (198 loc) · 13.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>I'm aaapei</title>
<meta name="author" content="aaapei">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Open Graph tags -->
<meta property="og:type" content="website"/>
<meta property="og:title" content="I'm aaapei"/>
<meta property="og:url" content="http://blog.aaapei.com"/>
<meta property="og:description" content="I'm aaapei"/>
<link rel="canonical" href="">
<link href="http://blog.aaapei.com/favicon.png" rel="shortcut icon">
<link href="http://blog.aaapei.com/theme/css/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="http://blog.aaapei.com/theme/css/pygments.css" media="screen, projection" rel="stylesheet" type="text/css">
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--
<link href="//fonts.googleapis.com/css?family=Open+Sans:400italic,400,700" rel='stylesheet' type='text/css'>
<link href="//fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel='stylesheet' type='text/css'>
<link href="//fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel='stylesheet' type='text/css'>
-->
<script src="//lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
</head>
<body>
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F42905fb57b3457075b7322a0893c5395' type='text/javascript'%3E%3C/script%3E"));
</script>
<div class="container">
<div class="left-col">
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img src="http://nos.netease.com/knowledge/85c5dfab-ec44-4818-a018-1fc31e8baa4f" alt="Profile Picture" style="width: 160px;" />
</div>
<hgroup>
<br/>
<h1><a href="http://blog.aaapei.com/">I'm aaapei</a></h1>
<h3>少年去游荡</h3>
</hgroup>
<nav id="main-nav">
<ul class="main-navigation">
<li><a href="http://blog.aaapei.com/.">首页</a></li>
<li><a href="http://blog.aaapei.com/categories.html">分类</a></li>
<li><a href="http://blog.aaapei.com/pages/sui-sui-nian">碎碎念</a></li>
</ul></nav>
<nav id="sub-nav">
<div class="social">
<a class="email" href="mailto:[email protected]" title="Email">Email</a>
<a class="weibo" href="http://weibo.com/a2pei" title="Weibo">Weibo</a>
<a class="rss" href="http://blog.aaapei.com/rss.xml" title="RSS">ATOM</a>
</div>
<section id="about-me">
<h2>关于我</h2>
<p>生活@hangzhou. 工作@netease.<br/> 移动端码农. 正在减肥的胖子. 食肉. <br/>想养喵但老婆不让</p>
</section>
</nav> </header>
</div>
</div>
<div class="mid-col">
<div class="mid-col-container">
<div id="content" class="inner">
<article class="post" itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<div class="meta">
<div class="date">
<time datetime="2017-11-05T11:28:00.000000+0800" itemprop="datePublished">2017-11-05</time>
</div>
<div class="tags">
<a href="http://blog.aaapei.com/tags/httpdns">httpdns</a> </div>
</div> <h1 class="title" itemprop="name"><a href="http://blog.aaapei.com/article/2017/11/androidjie-ru-httpdnsde-ling-yi-chong-si-lu" itemprop="url">Android接入httpdns的另一种思路</a></h1>
<div class="entry-content" itemprop="description"><h3>前言</h3>
<p>httpdns是基于Http协议的域名解析服务,用于替代基于UDP协议向运营商Local DNS发起解析请求的传统方式,目标是解决域名劫持和跨网访问等问题。</p>
<h3>httpdns的接入</h3>
<p>传统的使用Local DNS的方式,我们只需要在url中指定hostname;网络库帮我们做了域名解析、ttl缓存管理,我们不需要关心底层的流程。</p>
<p>但当使用httpdns,就需要我们自己向httpdns发起http请求,获取到域名对应的ip。一般商业的httpdns sdk都会提供域名解析成ip的方法,一般的开发者接入httpdns还是需要做以下工作:</p>
<ol>
<li>从URL中提取hostname,通过httpdns sdk获取到对应的IP</li>
<li>将URL中的hostname替换成IP</li>
<li>设置请求Header的Host字段</li>
<li>如果请求的是HTTPS,修改证书的域名验证策略</li>
</ol>
<p>android端有三个网络基础库,具体的接入方式会有差异:</p>
<ul>
<li>apache httpclient</li>
<li>http urlconnection</li>
<li>okhttp</li>
</ul>
<p>对于最后一个okhttp,由于它本身提供的设置外部dns的api,接入最简单,只需要简单的实现okhttp提供的<em>lookup</em>方法即可;但针对apache和urlconnection,就只能采取显式将url中的hostname替换成ip的方式了,然后添加Host头和HTTPS证书验证策略。但由于apache httpclient和urlconnection在设计之初,就没有考虑外部设置dns的策略,进行相关的接入时,总有各种异常case需要处理,比如apache http client在实现上,使用的是url中的ip信息作为cookie存储管理的key …</p>
<br/ >
<a href="http://blog.aaapei.com/article/2017/11/androidjie-ru-httpdnsde-ling-yi-chong-si-lu">查看全文</a>
</div>
<div class="meta">
<span class="author">Posted by <a href="http://blog.aaapei.com/author/zheng-wen.html">郑文</a></span>
</div>
</article>
<hr/>
<article class="post" itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<div class="meta">
<div class="date">
<time datetime="2017-01-17T14:26:00.000000+0800" itemprop="datePublished">2017-01-17</time>
</div>
<div class="tags">
<a href="http://blog.aaapei.com/tags/multidex">multidex</a> </div>
</div> <h1 class="title" itemprop="name"><a href="http://blog.aaapei.com/article/2017/01/ye-tan-multidexde-you-hua" itemprop="url">也谈MultiDex的优化</a></h1>
<div class="entry-content" itemprop="description"><p>旧文一篇,看到移动开发前线推送了<a href="https://zhuanlan.zhihu.com/p/24305296">MultiDex工作原理分析和优化方案</a>,也将我们的MultiDex启动优化思路分享给社区</p>
<h3>MultiDex存在的问题</h3>
<p>我们经常说的MultiDex,可以分成运行时和编译时两个部分:</p>
<ul>
<li>
<p>编译时的分包机制,将app中的class以某种策略将class分散在多个dex中,目的是减少为了第一个dex也就是main dex中包含的class。</p>
</li>
<li>
<p>运行时: app启动时,虚拟机只加载main dex中的class。app启动以后,使用<em>Multidex.install</em> API,通过反射修改ClassLoader中的dexElements加载其他dex。</p>
</li>
</ul>
<p>MultiDex机制的出现本身是为了避免出现app 65535问题的出现,但随着业务逻辑的增长,以及不合理的模块划分,可能会导致main dex的方法数也超出了65535,这就导致了<em>main dex capacity exceeded</em>异常。</p>
<p>此外,Multidex的接入额外还会对app的启动性能造成影响。Multidex在install时需要加载dex,首次启动时还需要做odex的转换,而这些都是在ui主线程中完成。
根据<a href="https://medium.com/@Macarse/lazy-loading-dex-files-d41f6f37df0e#.3vx8kle8j"> Carlos Sessa</a>的测试,启用multidex后,4.4或以下的设备,app的启动时间平均会增加15%,更严重的情况,甚至在启动时候会出现了黑屏。</p>
<p>目前部分app采取的策略是,放弃掉Multidex的 …</p>
<br/ >
<a href="http://blog.aaapei.com/article/2017/01/ye-tan-multidexde-you-hua">查看全文</a>
</div>
<div class="meta">
<span class="author">Posted by <a href="http://blog.aaapei.com/author/zheng-wen.html">郑文</a></span>
</div>
</article>
<hr/>
<article class="post" itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<div class="meta">
<div class="date">
<time datetime="2016-08-25T14:26:00.000000+0800" itemprop="datePublished">2016-08-25</time>
</div>
<div class="tags">
<a href="http://blog.aaapei.com/tags/android">android</a> , <a href="http://blog.aaapei.com/tags/apm">apm</a> </div>
</div> <h1 class="title" itemprop="name"><a href="http://blog.aaapei.com/article/2016/08/wang-yi-yun-ke-tang-de-androidwei-zhuan-ye-ke-cheng" itemprop="url">网易云课堂的android微专业课程</a></h1>
<div class="entry-content" itemprop="description"><p>懒癌晚期,一年多没更新blog,近一两月项目以外做了两件事情:</p>
<ul>
<li>
<p>在听云和infoq的<a href="http://www.apmcon.cn/">apmcon</a>大会做了个android 编译器hook的分享,ppt地址在<a href="http://nos.netease.com/knowledge/fd1ba942-d609-4fa4-bdce-e1003febc1ce?download=apmcon_apm%E6%96%B9%E6%A1%88%E6%8E%A2%E7%B4%A2_v0818.pdf">网易APM hook方案探索</a>,介绍了我们在编译期做bytecode植入的一些实践工作,有兴趣的同学可以和我私信交流;</p>
</li>
<li>
<p>和杭研的同事们一起做了在线的Android课程,讲师基本囊括了网易杭研院各部门的大牛,课程针对在校生和1年以下工作经验的新同学。想了解我们工作方式的同学可以看看,通过下面这个链接购买成功的朋友,也可以私信我下,我再返个微信红包给你 :)</p>
</li>
</ul>
<p>android网易云课堂微专业:<a href="http://mooc.study.163.com/smartSpec/detail/1001168002.htm?utm_source=832006&utm_medium=cps&utm_campaign=affiliate">android</a></p>
<p>ios网易云课堂微专业:<a href="http://mooc.study.163.com/smartSpec/detail/1001168001.htm?utm_source=832006&utm_medium=cps&utm_campaign=affiliate">ios</a></p>
<br/ >
<a href="http://blog.aaapei.com/article/2016/08/wang-yi-yun-ke-tang-de-androidwei-zhuan-ye-ke-cheng">查看全文</a>
</div>
<div class="meta">
<span class="author">Posted by <a href="http://blog.aaapei.com/author/zhengwen.html">zhengwen</a></span>
</div>
</article>
<hr/>
<article class="post" itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<div class="meta">
<div class="date">
<time datetime="2015-07-26T14:26:00.000000+0800" itemprop="datePublished">2015-07-26</time>
</div>
<div class="tags">
<a href="http://blog.aaapei.com/tags/android">android</a> , <a href="http://blog.aaapei.com/tags/applink">applink</a> </div>
</div> <h1 class="title" itemprop="name"><a href="http://blog.aaapei.com/article/2015/07/cong-deeplinkdispatchtan-tan-zu-jian-tiao-zhuan" itemprop="url">从DeepLinkDispatch谈谈组件跳转</a></h1>
<div class="entry-content" itemprop="description"><h3>前言</h3>
<p>最近airbnb开源了<a href="https://github.com/airbnb/DeepLinkDispatch">DeepLinkDispatch</a>项目,DeepLinkDispatch是一个基于注解的链接跳转库,简单了解完其实现后,想起了Facebook今年5月公布的另一个项目<a href="http://applinks.org/">AppLink</a>,于是有了这篇文章。</p>
<h3>AppLink</h3>
<p>与其说AppLink是一个框架,更不如说他是一个规范。当app内嵌WebView遇到自定义的Schema时,app只能简单的将url转交给系统,或直接显示页面无法加载。AppLink规范旨在解决各个平台的app跳转的问题。第三方网页或者app接入applink后,跳转方可以根据AppLink规范进行<em>精确</em>的目标跳转以及<em>数据传输</em>。
引用官方文档中的例子,example.hmtl:</p>
<div class="highlight"><pre><span></span><span class="nt"><html></span>
<span class="nt"><head></span>
<span class="nt"><meta</span> <span class="na">property=</span><span class="s">"al:ios:url"</span> <span class="na">content=</span><span class="s">"applinks://docs"</span> <span class="nt">/></span>
<span class="nt"><meta</span> <span class="na">property=</span><span class="s">"al:ios:app_store_id"</span> <span class="na">content=</span><span class="s">"12345"</span> <span class="nt">/></span>
<span class="nt"><meta</span> <span class="na">property=</span><span class="s">"al:ios:app_name"</span> <span class="na">content=</span><span class="s">"App Links"</span> <span class="nt">/></span>
<span class="nt"><meta …</span></pre></div>
<br/ >
<a href="http://blog.aaapei.com/article/2015/07/cong-deeplinkdispatchtan-tan-zu-jian-tiao-zhuan">查看全文</a>
</div>
<div class="meta">
<span class="author">Posted by <a href="http://blog.aaapei.com/author/zhengwen.html">zhengwen</a></span>
</div>
</article>
<hr/>
<nav id="pagenavi">
<a href="http://blog.aaapei.com" class="center">文章列表</a>
<a href="http://blog.aaapei.com/index2.html" class="next">前一页</a>
</nav>
</div>
</div>
<footer id="footer" class="inner">
<p>Copyright © 2013 - aaapei - <span class="credit">Powered by <a href="http://getpelican.com">Pelican</a></span></p> </footer>
</div>
</div>
</body>
</html>