-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
501 lines (318 loc) · 17.8 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<title>Ajava攻城师的博客</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="90后、IT男、技术控">
<meta property="og:type" content="website">
<meta property="og:title" content="Ajava攻城师的博客">
<meta property="og:url" content="http://zengfantian.github.io/index.html">
<meta property="og:site_name" content="Ajava攻城师的博客">
<meta property="og:description" content="90后、IT男、技术控">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Ajava攻城师的博客">
<meta name="twitter:description" content="90后、IT男、技术控">
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<div id="container">
<div class="left-col">
<div class="overlay"></div>
<div class="intrude-less">
<header id="header" class="inner">
<a href="/" class="profilepic">
<img lazy-src="/avatar.png" class="js-avatar">
</a>
<hgroup>
<h1 class="header-author"><a href="/">Ajava攻城师</a></h1>
</hgroup>
<p class="header-subtitle">记录成长的足迹</p>
<div class="switch-btn">
<div class="icon">
<div class="icon-ctn">
<div class="icon-wrap icon-house" data-idx="0">
<div class="birdhouse"></div>
<div class="birdhouse_holes"></div>
</div>
<div class="icon-wrap icon-ribbon hide" data-idx="1">
<div class="ribbon"></div>
</div>
<div class="icon-wrap icon-link hide" data-idx="2">
<div class="loopback_l"></div>
<div class="loopback_r"></div>
</div>
<div class="icon-wrap icon-me hide" data-idx="3">
<div class="user"></div>
<div class="shoulder"></div>
</div>
</div>
</div>
<div class="tips-box hide">
<div class="tips-arrow"></div>
<ul class="tips-inner">
<li>菜单</li>
<li>标签</li>
<li>友情链接</li>
<li>关于我</li>
</ul>
</div>
</div>
<div class="switch-area">
<div class="switch-wrap">
<section class="switch-part switch-part1">
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/archives">所有文章</a></li>
<li><a href="/">相册</a></li>
<li><a href="/tags/nature">随笔</a></li>
</ul>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/zengfantian" title="github">github</a>
<a class="weibo" target="_blank" href="http://t.qq.com/my100fly" title="weibo">weibo</a>
<a class="mail" target="_blank" href="mailto:zftlive@163.com" title="mail">mail</a>
<a class="rss" target="_blank" href="/sitemap.xml" title="rss">rss</a>
</div>
</nav>
</section>
<section class="switch-part switch-part2">
<div class="widget tagcloud" id="js-tagcloud">
<a href="/tags/Android/" style="font-size: 10px;">Android</a> <a href="/tags/Hexo/" style="font-size: 20px;">Hexo</a> <a href="/tags/Nodejs/" style="font-size: 20px;">Nodejs</a> <a href="/tags/反编译/" style="font-size: 10px;">反编译</a> <a href="/tags/打包混淆/" style="font-size: 10px;">打包混淆</a> <a href="/tags/nature/" style="font-size: 10px;">随笔</a>
</div>
</section>
<section class="switch-part switch-part3">
<div id="js-friends">
<a target="_blank" class="main-nav-link switch-friends-link" href="http://git.oschina.net/zftlive/zftlive">开源中国</a>
<a target="_blank" class="main-nav-link switch-friends-link" href="http://tool.oschina.net/">在线工具</a>
<a target="_blank" class="main-nav-link switch-friends-link" href="http://p.codekk.com/">CodeKK</a>
<a target="_blank" class="main-nav-link switch-friends-link" href="https://hexo.io/zh-cn/">Hexo官网</a>
</div>
</section>
<section class="switch-part switch-part4">
<div id="js-aboutme">小学文化,2010年9月开始编程生涯,目前从事移动端安卓研发。擅长专研各种前沿主流技术</div>
</section>
</div>
</div>
</header>
</div>
</div>
<div class="mid-col">
<nav id="mobile-nav">
<div class="overlay">
<div class="slider-trigger"></div>
<h1 class="header-author js-mobile-header hide">Ajava攻城师</h1>
</div>
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img lazy-src="/avatar.png" class="js-avatar">
</div>
<hgroup>
<h1 class="header-author">Ajava攻城师</h1>
</hgroup>
<p class="header-subtitle">记录成长的足迹</p>
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/archives">所有文章</a></li>
<li><a href="/">相册</a></li>
<li><a href="/tags/nature">随笔</a></li>
<div class="clearfix"></div>
</ul>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/zengfantian" title="github">github</a>
<a class="weibo" target="_blank" href="http://t.qq.com/my100fly" title="weibo">weibo</a>
<a class="mail" target="_blank" href="mailto:zftlive@163.com" title="mail">mail</a>
<a class="rss" target="_blank" href="/sitemap.xml" title="rss">rss</a>
</div>
</nav>
</header>
</div>
</nav>
<div class="body-wrap">
<article id="post-say-hexo-to-hello" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/posts/github/2016-05-13/say-hexo-to-hello.html" class="article-date">
<time datetime="2016-05-13T09:35:19.000Z" itemprop="datePublished">2016-05-13</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/posts/github/2016-05-13/say-hexo-to-hello.html">Hexo初识</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Hexo/">Hexo</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Nodejs/">Nodejs</a></li></ul>
</div>
<div class="article-category tagcloud">
<a class="article-category-link" href="/categories/github/">Github博客</a>
</div>
<p class="article-more-link">
<a href="/posts/github/2016-05-13/say-hexo-to-hello.html#more">阅读全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-hexo-guide-01" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/posts/github/2016-05-13/hexo-guide-01.html" class="article-date">
<time datetime="2016-05-13T09:35:19.000Z" itemprop="datePublished">2016-05-13</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/posts/github/2016-05-13/hexo-guide-01.html">Hexo 入门指南(一) - 简介 & 准备 -- Hexo是一个开源的静态博客生成器</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>Hexo是一个开源的静态博客生成器,用node.js开发,作者是台湾大学生tommy351。</p>
<p>为什么是博客</p>
<p>对于个人网站来说,没有比博客更合适的形式了。在博客中,文章才是最主要的,一切都显得主次分明,干净利落。相比之下,论坛中主题和回复鱼龙混杂,阅读体验非常差。同时,博客比论坛的数据库小很多,便于维护。</p>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Hexo/">Hexo</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Nodejs/">Nodejs</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/nature/">随笔</a></li></ul>
</div>
<div class="article-category tagcloud">
<a class="article-category-link" href="/categories/github/">Github博客</a>
</div>
<p class="article-more-link">
<a href="/posts/github/2016-05-13/hexo-guide-01.html#more">阅读全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-android-proguard-instruction" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/posts/github/2016-05-13/android-proguard-instruction.html" class="article-date">
<time datetime="2016-05-13T09:35:19.000Z" itemprop="datePublished">2016-05-13</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/posts/github/2016-05-13/android-proguard-instruction.html">Android基础混淆配置说明</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="混淆配置说明"><a href="#混淆配置说明" class="headerlink" title="混淆配置说明"></a>混淆配置说明</h1><p>本文清楚的记录混淆可以适应于哪些元素、分别该如何配置,哪些可以混淆,哪些不需要混淆</p>
<h2 id="混淆支持的元素"><a href="#混淆支持的元素" class="headerlink" title="混淆支持的元素"></a>混淆支持的元素</h2><p>类名、包名、方法名、类成员属性、字段\变量名</p>
<h2 id="哪些不能混淆"><a href="#哪些不能混淆" class="headerlink" title="哪些不能混淆"></a>哪些不能混淆</h2><ul>
<li><p>反射需要用到的元素</p>
</li>
<li><p>json需要序列化与反序列化的元素</p>
</li>
<li><p>枚举类型元素</p>
</li>
<li><p>所有的注解</p>
</li>
<li><p>Android四大组件</p>
</li>
<li><p>自定义控件</p>
</li>
<li><p>R和Application</p>
</li>
<li><p>JNI/Native/js调用的方法</p>
</li>
<li><p>第三方开源库</p>
</li>
</ul>
<h2 id="常见的混淆配置"><a href="#常见的混淆配置" class="headerlink" title="常见的混淆配置"></a>常见的混淆配置</h2><h3 id="keep"><a href="#keep" class="headerlink" title="-keep"></a>-keep</h3><p>1、保留某个包下面的类以及子包</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-keep public class com.droidyue.com.widget.**</span><br></pre></td></tr></table></figure>
<p>2、保留所有类中使用otto的public方法</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">-keepclassmembers class ** {</span><br><span class="line"> @com.squareup.otto.Subscribe public *;</span><br><span class="line"> @com.squareup.otto.Produce public *;</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<p>3、保留Contants类的BOOK_NAME属性</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">-keepclassmembers class com.example.admin.proguardsample.Constants {</span><br><span class="line"> public static java.lang.String BOOK_NAME;</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<h3 id="dontwarn"><a href="#dontwarn" class="headerlink" title="-dontwarn"></a>-dontwarn</h3><p>dontwarn是一个和keep可以说是形影不离,尤其是处理引入的library时.</p>
<p>引入的library可能存在一些无法找到的引用和其他问题,在build时可能会发出警告,如果我们不进行处理,通常会导致build中止.因此为了保证build继续,我们需要使用dontwarn处理这些我们无法解决的library的警告.</p>
<p>比如关闭Twitter sdk的警告:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-dontwarn com.twitter.sdk.**</span><br></pre></td></tr></table></figure>
<h2 id="混淆堆栈错误还原"><a href="#混淆堆栈错误还原" class="headerlink" title="混淆堆栈错误还原"></a>混淆堆栈错误还原</h2><h3 id="retrace脚本"><a href="#retrace脚本" class="headerlink" title="retrace脚本"></a>retrace脚本</h3><p>Android 开发环境默认带着retrace脚本,一般情况下路径为./tools/proguard/bin/retrace.sh</p>
<h3 id="mapping映射表"><a href="#mapping映射表" class="headerlink" title="mapping映射表"></a>mapping映射表</h3><p>Proguard进行混淆之后,会生成一个映射表,文件名为mapping.txt (./app/build/outputs/mapping/release/mapping.txt)</p>
<h3 id="堆栈还原"><a href="#堆栈还原" class="headerlink" title="堆栈还原"></a>堆栈还原</h3><p>1、将错误堆栈保存成一个文本文件npe_stacktrace.txt</p>
<p>2、使用命令还原(路径自行修改)</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./tools/proguard/bin/retrace.sh E:/storage/git/github/AjavaSample/apps/build/outputs/mapping/release/mapping.txt /tmp/npe_stacktrace.txt</span><br></pre></td></tr></table></figure>
<h2 id="参考资源"><a href="#参考资源" class="headerlink" title="参考资源"></a>参考资源</h2><p>1、《读懂Android中的代码混淆》 <a href="http://blog.csdn.net/qq_35224673/article/details/52038093" target="_blank" rel="external">http://blog.csdn.net/qq_35224673/article/details/52038093</a></p>
<p>2、《对ProGuard使用方法的思考》 <a href="http://www.jianshu.com/p/14af4a474d55" target="_blank" rel="external">http://www.jianshu.com/p/14af4a474d55</a></p>
<p>3、《Android项目的代码混淆,Android-Proguard使用说明》 <a href="http://blog.csdn.net/catoop/article/details/47208833" target="_blank" rel="external">http://blog.csdn.net/catoop/article/details/47208833</a></p>
<p>4、《压缩代码和资源》 <a href="https://developer.android.com/studio/build/shrink-code.html" target="_blank" rel="external">https://developer.android.com/studio/build/shrink-code.html</a></p>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/反编译/">反编译</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/打包混淆/">打包混淆</a></li></ul>
</div>
<div class="article-category tagcloud">
<a class="article-category-link" href="/categories/github/">Github博客</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
© 2017 Ajava攻城师
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
</div>
</div>
</div>
</footer>
</div>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
<script>
var yiliaConfig = {
fancybox: true,
mathjax: true,
animate: true,
isHome: true,
isPost: false,
isArchive: false,
isTag: false,
isCategory: false,
open_in_new: true
}
</script>
<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>
<script src="/js/main.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for(i=0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</div>
</body>
</html>