-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1196 lines (826 loc) · 46.7 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
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha256-HtsXJanqjKTc8vVQjO4YMhiqFoXkfBsjBWcX91T1jr8=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
<script class="next-config" data-name="main" type="application/json">{"hostname":"www.lefo.me","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.18.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"fold":{"enable":false,"height":500},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果:${query}","hits_time":"找到 ${hits} 个搜索结果(用时 ${time} 毫秒)","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/js/config.js"></script>
<meta name="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
<meta property="og:type" content="website">
<meta property="og:title" content="lefo's blog">
<meta property="og:url" content="https://www.lefo.me/index.html">
<meta property="og:site_name" content="lefo's blog">
<meta property="og:description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="lefo">
<meta property="article:tag" content="android,java,kotlin,开发,编程,c++">
<meta name="twitter:card" content="summary">
<link rel="canonical" href="https://www.lefo.me/">
<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-CN","comments":"","permalink":"","path":"index.html","title":""}</script>
<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>lefo's blog</title>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-65991901-1"></script>
<script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-65991901-1","only_pageview":false}</script>
<script src="/js/third-party/analytics/google-analytics.js"></script>
<noscript>
<link rel="stylesheet" href="/css/noscript.css">
</noscript>
<link rel="alternate" href="/atom.xml" title="lefo's blog" type="application/atom+xml">
</head>
<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
<div class="headband"></div>
<main class="main">
<div class="column">
<header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏" role="button">
<span class="toggle-line"></span>
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<i class="logo-line"></i>
<h1 class="site-title">lefo's blog</h1>
<i class="logo-line"></i>
</a>
<p class="site-subtitle" itemprop="description">又一个android开发人员</p>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger" aria-label="搜索" role="button">
</div>
</div>
</div>
<nav class="site-nav">
<ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="fa fa-sitemap fa-fw"></i>站点地图</a></li>
</ul>
</nav>
</header>
<aside class="sidebar">
<div class="sidebar-inner sidebar-overview-active">
<ul class="sidebar-nav">
<li class="sidebar-nav-toc">
文章目录
</li>
<li class="sidebar-nav-overview">
站点概览
</li>
</ul>
<div class="sidebar-panel-container">
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
<div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
<p class="site-author-name" itemprop="name">lefo</p>
<div class="site-description" itemprop="description">lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.</div>
</div>
<div class="site-state-wrap animated">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="/archives/">
<span class="site-state-item-count">35</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/">
<span class="site-state-item-count">11</span>
<span class="site-state-item-name">分类</span></a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags/">
<span class="site-state-item-count">24</span>
<span class="site-state-item-name">标签</span></a>
</div>
</nav>
</div>
</div>
</div>
</div>
<div class="sidebar-inner sidebar-blogroll">
<div class="links-of-blogroll animated">
<div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
链接
</div>
<ul class="links-of-blogroll-list">
<li class="links-of-blogroll-item">
<a href="http://www.niuquery.com/" title="http://www.niuquery.com/" rel="noopener" target="_blank">20度</a>
</li>
<li class="links-of-blogroll-item">
<a href="/pages/pension.html" title="/pages/pension.html">在京退休</a>
</li>
</ul>
</div>
</div>
<div class="sidebar-inner">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6334086715606061"
crossorigin="anonymous"></script>
<!-- blog侧 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6334086715606061"
data-ad-slot="1986102848"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</aside>
</div>
<div class="main-inner index posts-expand">
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2024/05/12/build-pdfium/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2024/05/12/build-pdfium/" class="post-title-link" itemprop="url">如何构建一个pdfium.so</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2024-05-12 14:50:01" itemprop="dateCreated datePublished" datetime="2024-05-12T14:50:01+08:00">2024-05-12</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/android%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">android开发</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>项目中接入了打开pdf文件的功能,使用的是<a target="_blank" rel="noopener" href="https://github.com/barteksc/PdfiumAndroid/">https://github.com/barteksc/PdfiumAndroid/</a>。现在想升级一下pdfium库,旧库具体原因就不解释了,毕竟这个项目最后一个commit在6年前,当然,平常用来接入打开pdf也是没问题的。</p>
<h1 id="开源库"><a href="#开源库" class="headerlink" title="开源库"></a>开源库</h1><p>在google一通搜索,发现pdfium库包含两套,一套在aosp中,另一套在chromium中。</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://android.googlesource.com/platform/external/pdfium/">https://android.googlesource.com/platform/external/pdfium/</a></li>
<li><a target="_blank" rel="noopener" href="https://pdfium.googlesource.com/pdfium/">https://pdfium.googlesource.com/pdfium/</a><br>两款代码应该差不多,aosp的构建使用Android.bp,版本要比pdfium版本的落后一些。再看PdfiumAndroid项目README,第一句就说Uses pdfium library from AOSP,使用的库应该也是aosp的库。</li>
</ul>
<h1 id="构建aosp版"><a href="#构建aosp版" class="headerlink" title="构建aosp版"></a>构建aosp版</h1><h2 id="准备"><a href="#准备" class="headerlink" title="准备"></a>准备</h2><ol>
<li>ubuntu 可以使用virtual box去装个虚拟机</li>
<li>200GB以上硬盘空间,清华会推荐你下载aosp-latest.tar再解压,光压缩包80G了,解压完我就把tar包删了</li>
</ol>
<h2 id="获取aosp源码"><a href="#获取aosp源码" class="headerlink" title="获取aosp源码"></a>获取aosp源码</h2><p>推荐使用清华镜像<a target="_blank" rel="noopener" href="https://mirrors-i.tuna.tsinghua.edu.cn/help/AOSP/">https://mirrors-i.tuna.tsinghua.edu.cn/help/AOSP/</a>,可结合google的官方说明<a target="_blank" rel="noopener" href="https://source.android.com/docs/setup?hl=zh-cn">https://source.android.com/docs/setup?hl=zh-cn</a>。具体指令就不介绍了,主要是repo sync费时,注意选好你想构建的build tag。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2024/05/12/build-pdfium/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2024/02/20/nx54-telnet/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2024/02/20/nx54-telnet/" class="post-title-link" itemprop="url">H3C NX54路由器如何永久开telnet,永久关闭ipv6防火墙</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2024-02-20 11:17:40" itemprop="dateCreated datePublished" datetime="2024-02-20T11:17:40+08:00">2024-02-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/nx54/" itemprop="url" rel="index"><span itemprop="name">nx54</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>之前买了一台NX54路由器,结果这路由固件完全不给用户定制化的机会,研究如何保存ip6table的配置没有成功,但是成功保存了telnet开启配置,分享一下。这套固件的情况如下:</p>
<ol>
<li>默认开启ipv6防火墙,且关闭后,重启会失效,再次打开。</li>
<li>可以通过telnet连接路由,telnet配置也不保存,停电或者重启后失效。</li>
<li>根目录使用overlayfs做到了tmp下,是整个系统会恢复的主要原因。</li>
<li>提供了/mnt目录保存数据,/mnt/bak/startup.bak就是所有配置项。
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2024/02/20/nx54-telnet/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2024/01/30/jetpack/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2024/01/30/jetpack/" class="post-title-link" itemprop="url">重学安卓之Jetpack</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2024-01-30 22:07:12" itemprop="dateCreated datePublished" datetime="2024-01-30T22:07:12+08:00">2024-01-30</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/android/" itemprop="url" rel="index"><span itemprop="name">android</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="导读"><a href="#导读" class="headerlink" title="导读"></a>导读</h1><p>jetpack当时还没来得及用,整个项目就被砍掉了,这两年一直没有接触,最近好多岗位都要求会jetpack,这两年逐渐用的人越来越多,重学Android赶紧简单了解一下,做了一点整理,都是皮毛,供自己查笔记用吧,如果有一些知识点需要增加备注,随时修改。</p>
<h1 id="Navigation-用于fragment切换"><a href="#Navigation-用于fragment切换" class="headerlink" title="Navigation 用于fragment切换"></a>Navigation 用于fragment切换</h1><h2 id="优点"><a href="#优点" class="headerlink" title="优点"></a>优点</h2><ul>
<li>可视化,可以as中可视化编辑</li>
<li>通过destination和action完成页面的导航</li>
<li>参数传递安全, safe args</li>
<li>支持deeplink,支持创建PendingIntent
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2024/01/30/jetpack/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2023/10/06/frida/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2023/10/06/frida/" class="post-title-link" itemprop="url">第一次尝试frida</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2023-10-06 23:31:26" itemprop="dateCreated datePublished" datetime="2023-10-06T23:31:26+08:00">2023-10-06</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/android/" itemprop="url" rel="index"><span itemprop="name">android</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>大概半个月前,群里的一个小伙伴问,谁能把某电商APP的订单列表导出到电脑,有个私活,报个价。其实我对这种稍微有点了解,无非是抓包,破解。但通常App的网络请求会有一套签名验证机制,所以要想模拟出整套请求流程,也算比较复杂。和群里的讨论后,觉得用hook做合适,但群里和我一样,都是安卓开发,没有逆向工程师,首先想到的是xposed。</p>
<h1 id="xposed太重"><a href="#xposed太重" class="headerlink" title="xposed太重"></a>xposed太重</h1><p>我之前倒是写过xposed,xposed缺点有两个,第一就是环境复杂,你得安装xposed环境才可以,目前都是通过virtual xposed来使用。再就是插件一但有修改,就得重启手机。不过这也带来了一个有点就是持久化,只要装进去,就一直存在。那有没有更轻量级的工具可以达到这种效果,后来在网上找到了frida。(这也好几年了,我居然不知道)</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2023/10/06/frida/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2023/08/08/kotlin-coroutine/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2023/08/08/kotlin-coroutine/" class="post-title-link" itemprop="url">重学安卓之kotlin协程</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2023-08-08 02:03:24" itemprop="dateCreated datePublished" datetime="2023-08-08T02:03:24+08:00">2023-08-08</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/kotlin/" itemprop="url" rel="index"><span itemprop="name">kotlin</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="导读"><a href="#导读" class="headerlink" title="导读"></a>导读</h1><p>因为2021年开始做C++,之前的项目还没来得及怎么用kotlin,就直接被爸爸宣布死刑了。所以目前找工作等于需要再学一次kotlin,特别是协程,之前几乎没有了解。买了本书,再加上网上的各种文章,整理一点笔记出来。如果有和我差不多的,可以看一看</p>
<p>协程,协程可以理解为某种自由调度的任务,主要是对函数挂起,恢复。听起来像线程的唤醒,本质上和线程没什么关系。使用协程,我们可以以单线程的方式写多线程的代码,同时还能节省线程资源,并且能方便处理异常信息,返回结果等。我们给函数前面加一个<code>suspend</code>关键字,就变成一个挂起函数,可以在函数内操作协程的挂起和恢复。其中部分内容有重复,不必理会。主要参考资料<深入理解Kotlin协程>,算是一个简单的笔记整理。</p>
<h1 id="协程的API"><a href="#协程的API" class="headerlink" title="协程的API"></a>协程的API</h1><h2 id="什么是挂起"><a href="#什么是挂起" class="headerlink" title="什么是挂起"></a>什么是挂起</h2>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2023/08/08/kotlin-coroutine/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2021/08/13/cpp-note/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/08/13/cpp-note/" class="post-title-link" itemprop="url">C++学习笔记</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-13 13:28:05" itemprop="dateCreated datePublished" datetime="2021-08-13T13:28:05+08:00">2021-08-13</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/c/" itemprop="url" rel="index"><span itemprop="name">c++</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="第2节"><a href="#第2节" class="headerlink" title="第2节"></a>第2节</h1><p>防卫式声明,防止重复include引起的问题(guard)</p>
<figure class="highlight plaintext"><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><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">//complex.h</span><br><span class="line">#ifndef _COMPLEX_</span><br><span class="line">#def _COMPLEX_</span><br><span class="line">...</span><br><span class="line">#endif</span><br></pre></td></tr></table></figure>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2021/08/13/cpp-note/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2021/08/11/make-image/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/08/11/make-image/" class="post-title-link" itemprop="url">记一次编译安卓模拟器镜像</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-08-11 21:49:03" itemprop="dateCreated datePublished" datetime="2021-08-11T21:49:03+08:00">2021-08-11</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/android/" itemprop="url" rel="index"><span itemprop="name">android</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="背景"><a href="#背景" class="headerlink" title="背景"></a>背景</h1><p>想要编译一个自己的framework,用来在系统api中插入自己的代码,监听一下应用的行为,比如获取imei,获取网络。最直接的想法就是,修改安卓源码,直接编译出一个系统镜像,给模拟器使用。</p>
<p>准备:</p>
<ol>
<li><p>因为之前编译过android.jar,所以源码环境还有,直接开工,或者看以前编译的文章有讲。</p>
</li>
<li><p>修改代码,比如找到TelephonyManager.java,在getDeviceId()中插入自己的代码。</p>
</li>
</ol>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2021/08/11/make-image/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2020/09/04/jenkins-android-3/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/09/04/jenkins-android-3/" class="post-title-link" itemprop="url">使用jenkins为android工程打包,支持多包名,改资源(优化方案)</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-09-04 15:32:15" itemprop="dateCreated datePublished" datetime="2020-09-04T15:32:15+08:00">2020-09-04</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2024-08-25 05:40:15" itemprop="dateModified" datetime="2024-08-25T05:40:15+08:00">2024-08-25</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/android%E6%89%93%E5%8C%85/" itemprop="url" rel="index"><span itemprop="name">android打包</span></a>
</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="需求"><a href="#需求" class="headerlink" title="需求"></a>需求</h1><p>没有需求,自己看了一眼自己之前写的打包脚本,简直无法看下去。而且,产品经理的定制化需求越来越多,用shell脚本的可读性也越来越差,再加上里面一堆的sed命令,惨不忍睹。</p>
<p>改!!!</p>
<h1 id="分析"><a href="#分析" class="headerlink" title="分析"></a>分析</h1><p>gradle其实支持自定义参数,关于自定义参数的介绍,参考官方文档:<a target="_blank" rel="noopener" href="https://docs.gradle.org/current/userguide/build_environment.html%EF%BC%8C%E7%AE%80%E5%8D%95%E8%AF%B4%E4%B8%80%E4%B8%8B%E7%94%A8%E5%88%B0%E7%9A%84%EF%BC%9A[Gradle">https://docs.gradle.org/current/userguide/build_environment.html,简单说一下用到的:[Gradle</a> properties](<a target="_blank" rel="noopener" href="https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties)%EF%BC%9A">https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties):</a></p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/09/04/jenkins-android-3/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
<link itemprop="mainEntityOfPage" href="https://www.lefo.me/2020/08/24/keep-alive/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="lefo">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="lefo's blog">
<meta itemprop="description" content="lefo's blog个人blog,记录工作中碰到的开发相关内容。Android,Java,Kotlin.">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="undefined | lefo's blog">
<meta itemprop="description" content="">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/08/24/keep-alive/" class="post-title-link" itemprop="url">android进程保活(掌握黑心科技)</a>
</h2>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-08-24 21:31:23" itemprop="dateCreated datePublished" datetime="2020-08-24T21:31:23+08:00">2020-08-24</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>