自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(47)
  • 收藏
  • 关注

原创 android linker和indirection function(IFUNC)

Android IFUNC支持IFUNC概念参考 GNU_IFUNC。Android支持限制在 Android linker changes for NDK developers 中描述,android api>=29才支持该特性:Use of IFUNC in libc (True for all API levels on devices running Q)Starting with Android Q (API level 29), libc uses IFUNC functi

2021-05-13 17:06:12 441

原创 android linker 开启日志

打开linker日志Enable logging of dlopen/dlsym and library loading errors for apps (Available in Android O)Starting with Android O it is possible to enable logging of dynamiclinker activity for debuggable apps by setting a property correspondingto the fully-

2021-05-13 17:05:20 800

原创 android inker和Exe加载 : linker_main函数解释

Linker和Exe加载 : linker_main函数解释linker main执行的任务前,在linker重定位,libc初始化,主线程初始化等一些列操作完成后,进程的用户空间已经具备动态链接的能力,开始可以动态链接exe相关的依赖了。linker main源码static ElfW(Addr) linker_main(KernelArgumentBlock& args, const char* exe_to_load) { ProtectedDataGuard guard;#if

2021-05-13 17:04:50 465

原创 android linker重定位后初始化

Linker重定位后初始化linker重定位后,进行一系列初始化工作,这个阶段,linker已经可以引用外部的符号和全局变量了。源码/* * This code is called after the linker has linked itself and fixed its own * GOT. It is safe to make references to externs and other non-local data at * this point. The compiler som

2021-05-13 17:04:13 235

原创 android linker和主线程初始化

Linker和主线程初始化NOTE: 这里分析arm64的情况。two-pass初始化主线程初始化流程在linker要分为三部分(都在__linker_init的中),分别为__libc_init_main_thread_early、__libc_init_main_thread_late和__libc_init_main_thread_final。1-pass : __libc_init_main_thread_early//----------------------------------

2021-05-13 17:03:37 394

原创 android linker自举

Android Linker Bootstraplinker作为动态链接器,但本身也是一个共享库,那么它由谁来链接?1. linker自举linker的链接是由它本身完成的,称为自举(bootstrap)。linker不能依赖其他共享库,其内部的全局和静态变量等的relocation必须由其自身完成。2. 自举实现linker的入口函数,即为其自举执行的入口,即_start:ENTRY(_start) // Force unwinds to end in this function.

2021-05-13 17:03:01 474 1

原创 android linker入口

Android Linker Entry通过实际编译的库文件,来反推linker entry。app进程入口众所周知,android的app进程,都是通过zygote fork出来的,而zygote进程的exec文件为(64位系统):app_process64。从aosp编译出的系统,通过readelf查看app_process64的program headers可见:xuwakao@chiefhsing-PC:~/android-11.0.0_r29/out/target/product/cro

2021-05-13 17:02:26 464 1

原创 dex字节码介绍和二进制译码分析

对于dex字节码的详细介绍,官方提供了三篇文档对其进行比较详尽的介绍,分别是:Dalvik bytecode :主要介绍的是Dalvik字节码的总体设计理念,还提供了全部的字节码指令介绍。如果没有一点计算机系统相关知识,还是比较难懂的,有部分的描述也不是太清晰,可参考本人这篇文章的翻译:Dalvik bytecode的总体设计Dalvik Executable instruction for...

2019-07-06 03:48:23 3577 1

原创 Dalvik bytecode的总体设计

Dakvik bytecode总体设计机器模型和调用约定大致是模仿常见的真实指令体系结构和C语言风格的调用约定:执行指令的机器是 基于寄存器 的,并且,帧的大小在 创建时 就已经 固定 。每个帧由特定数量的寄存器(由方法指定)以及用于执行方法的附加数据组成,例如,程序计数器PC和指向包含该方法的 dex 文件的引用。当寄存器用于处理数字常量时(例如int,float等),寄存器的位宽为3...

2019-07-04 21:10:04 480

原创 ConcurrentHashMap分析和总结

官方文档总结A hash table supporting full concurrency of retrievals and high expected concurrency for updates. This class obeys the same functional specification as Hashtable, and includes versions of meth...

2019-07-03 18:16:39 678

原创 HashTable分析和总结

官方文档总结This class implements a hash table, which maps keys to values. Any non-null object can be used as a key or as a value.To successfully store and retrieve objects from a hashtable, the objects ...

2019-07-03 18:06:10 345

原创 HashMap分析和总结

官方文档总结Hash table based implementation of the Map interface. This implementation provides all of the optional map operations, and permits null values and the null key. (The HashMap class is roughly e...

2019-07-03 18:01:13 235

原创 从一段奇怪代码开始说

看Fresco的代码中,有这样的一个类:/** * To eliminate the possibility of some of our objects causing an OutOfMemoryError when they are * not used, we reference them via SoftReferences. * What is a SoftRe

2016-12-29 01:26:09 1175

原创 android multidex异步加载

文章写了很久很久,今天再次看到一个相关的项目的Android-Easy-MultiDex,那么我也把自己的方案分享一下,代码待放。。。技术交流可加 QQ : 1831594078Multidex背景官方文档已经对这个做了比较详述的说明。 简单总结就是:早期dex执行文件的方法数限制在65536范围之内,如果超出这个限制,构建就会失败。然而,为什么会构建失败,这个65536限制究竟是在哪里?既然de

2016-12-29 01:22:33 4525

原创 谈谈fresco的bitmap内存分配

bitmap的内存分配主要有两个含义:应用程序实现时针对bitmap的内存缓存;从原始数据(byte[])经过decode生成bitmap过程中的内存分配问题;其中第一个含义,在Fresco中实现对应的就是interface MemoryCache,这里略有提及,不会大费章节,主要关注decode过程中的内存分配问题。

2016-12-29 01:18:44 5592 1

原创 编译android源代码(aosp)

步骤1:按照官方的文档,下载源码,配置环境,并执行相应的命令。最好按照官方的硬件和系统配置build。 build的版本是6.0,源码目录是/home/koder/android-source-20151229 Requirements:下载的源码很大,估计有30,40G左右。加上build,最好腾出100+的空间来。按官方说的MAC O

2016-03-08 13:46:39 865

原创 【Android】Fresco图片加载框架(二)————Producer

/*** 本文可以随意转载到任何网站或者App,* BUT* 转载也要按“基本法”,* 请注明原文出处和作者*/  官方源码地址 fresco官方高大上介绍(1)(注意:前方有堵墙)fresco官方高大上介绍(2)(注意:前方有堵墙) 介绍:上一篇大概介绍了fresco这个lib的整体结构和流程,这篇主要介绍fresco中

2016-03-08 13:46:33 603

原创 【Android】Fresco图片加载框架(一)————源码简要分析

/*** 本文原创* BUT* 可以随意转载到任何网站或者App* BUT* 转载也要按“基本法”* SO* 请注明原文出处和作者*/ 官方源码地址 fresco官方高大上介绍(1)(注意:前方有堵墙)fresco官方高大上介绍(2)(注意:前方有堵墙) 前言 虽然标题是fresco分析(一),但是并不代表会有2345的啦。

2016-03-08 13:46:24 924 1

原创 TSL(SSL)相关内容

内容基本包括以下各个方面(出自维基百科):Transport Layer SecurityPublic-key cryptographySymmetric-key algorithmDigital signatureX.509 在说SSL之前介绍相关一些相关的概念,这些东西大学老师都有讲过,就是基本忘光了,没学好啊。 Sysmmetric-key algorit

2016-03-08 13:46:16 561

原创 谨慎使用AsyncTask

AsyncTask估计很多人都使用过这个东西,感觉很美好的东西,asynchronize 特性,多线程支持但不需要关心具体线程执行细节,杠杠的好玩意儿。而事实上呢,稍有不慎,就是大悲剧。 AsyncTask有段注释:  * AsyncTask is designed to be a helper class around {@link Thread} and {@link Ha

2016-03-08 13:46:09 435

原创 解决:【android studio创建新工程时,卡在下载gardle】

类题类似于:http://stackoverflow.com/questions/16580873/android-studio-stuck-at-gradle-download-on-create-new-project今天更新了以下studio(0.2.6),然后发现当我创建工程的时候一直卡在下载gradle那里,一开始以为是网速问题,一直等啊等,还是不行,搞了半天终于搞定。 本人

2016-03-08 13:46:02 641

原创 How browsers work(浏览器是如何工作的)

How browsers work<!-- div.autonum ol { counter-reset: item } div.autonum li { display: block } div.autonum li:before { content: counters(item, ".") ". "; counter-incr

2016-03-08 13:45:56 1244

原创 初识Github

Github<!--body{ font-family: 微软雅黑,"Microsoft YaHei", Georgia,Helvetica,Arial,sans-serif,宋体, PMingLiU,serif; font-size: 10.5pt; line-height: 1.5;}html, body{ }

2016-03-08 13:45:49 353

原创 磁盘和文件系统

摘自《鸟哥的linux私房菜》以旧有的 Windows 观点来看,你可能会有一颗磁盘并且将他分割成为 C:, D:, E:槽,那个 C, D, E就是分割槽(partition)。 磁盘组成:   磁盘的第一个扇区(sector磁区)主要记录了两个重要癿信息,分别是: 主要启动记录区(Master Boot Record, MBR):可以安装开机管理程序的

2016-03-08 13:45:43 398

原创 Re-Learn C(The C Programming Language.2Nd)

Chapter 1 - A Tutorial Introduction printf is not part of the C language; there is no input or output defined in C itself. printf is just a useful function from the standard library of functions t

2016-03-08 13:45:36 444

原创 processor register

​In computer architecture, a processor register is a small amount of storage available as part of a CPU or other digital processor. Such registers are (typically) addressed by mechanisms other than 

2016-03-08 13:45:29 556

原创 深入探索透视投影变换

深入探索透视投影变换引用自:原文(作者:Twinsen) -Twinsen编写-本人水平有限,疏忽错误在所难免,还请各位数学高手、编程高手不吝赐教-email: popyy@netease.com 透视投影是3D固定流水线的重要组成部分,是将相机空间中的点从视锥体(frustum)变换到规则观察体(Canonical View Volume)中,待裁剪完毕后进行透视除法的行为。

2016-03-08 13:45:21 465

原创 CAMediaTimingFunction相关

一:Animation Timing Curves 1:Linear Animation Timing 2:Ease-In Animation Timing 3:Ease-Out Animation Timing 4:Ease-In Ease-Out Animation Timing5:Custom Animation Timing 

2016-03-08 13:45:14 508

原创 UML类图关系

《The Unified Modeling Language User Guide;2nd 》的对于几种关系的描述  In the UML, the ways that things can connect to one another, either logically or physically, are modeled as relationships. In object-or

2016-03-08 13:45:08 630

原创 C声明阅读

C Right-Left Rule (Rick Ord's CSE 30 - UC San Diego)The "right-left" rule is a completely regular rule for deciphering Cdeclarations. It can also be useful in creating them.Right-left rule's

2016-03-08 13:45:00 405

原创 iOS并发编程

iOS和OS X使用异步设计方法(asynchronous design approach)去解决并发的问题,而不是直接使用线程。以下是两种解决并发执行的方法: Grand Central Dispatch (GCD) GCD帮组管理线程代码并把这部分代码移到系统层次。开发者需要做的只是定义需要完成的任务然后把其放到合适的dispatch queue(下面简写为DQ)中。GCD负责

2016-03-08 13:44:54 423

原创 Block和GCD介绍

Block Objectsblock object对比函数指针的好处:Block objects (informally, “blocks”) are an extension to C, as well as Objective-C and C++, that make it easy for programmers to define self-contained units of w

2016-03-08 13:44:47 474

原创 CALayer和UIView

At a Glance UIView是在/System/Library/Frameworks/UIKit.framework定义,也就是处于Cocoa Touch层。CALyer是在/System/Library/Frameworks/QuartzCore.framework定义,也就是处于Media层。 从iOS整个体系分层结构看,CALayer较UIView更底层。 

2016-03-08 13:44:40 269

原创 Memory Management in Cocoa Program

内存管理模型基于对象的引用计数。一个对象至少有一个拥有者。如果一个对象没有拥有者,运行时系统会自动destroy它。为了保证正确清除掉拥有的调用,Cocoa设定了以下的基本准则。 基本准则:创建一个对象,你就持有了它。(创建一个对象的方法往往是已“alloc”,“new”,“copy”或者“mutableCopy”为前序)可以通过retain去持有一个对象当不再需要对象时,

2016-03-08 13:44:34 418

原创 认识View Controller

重复一万遍:基础很重要。。。。。 内容基本来自官方文档,确保可信。 @interface UIViewController : UIResponder NSCoding, UIAppearanceContainer> {}@end 继承(Inherits from)UIResponder。遵守(conform to)协议(protocol)NSCoding,UI

2016-03-08 13:44:28 410

原创 volatile

来源: http://www.ibm.com/developerworks/cn/java/j-jtp06197.html> Java 语言中的 volatile 变量可以被看作是一种 “程度较轻的 synchronized”;与 synchronized 块相比,volatile 变量所需的编码较少,并且运行时开销也较少,但是它所能实现的功能也仅是 synchronized 的一部分。本

2016-03-08 13:44:22 181

原创 iOS分类和扩展(Categories和Extensions)

分类(Category) 分类能够做到的事情主要是:即使在你不知道一个类的源码情况下,向这个类添加扩展的方法。 此外,分类能够保证你的实现类和其他的文件区分开。 View Code 1 #import “UIViewController.h”2 @interface UIViewController(CustomView)3 -(void)extMeth

2016-03-08 13:44:14 209

原创 Property Declaration Attributes

题目不知道应该怎么翻译?硬是要翻译,只能是属性声明的特性。 对于这部分内容,《The Object C 2.0 Programming Language》的介绍是: You can decorate a property with attributes by using the form @property(attribute[,attribute2,...]). Like m

2016-03-08 13:44:09 377

原创 iOS Apps核心对象

UIApplication:处理来自系统的事件并将这些事件分发到开发者的自定义代码去处理。作为一个controller对象 ,它处理app的事件循环和协调其他上层的app行为。开发者自定义的app层逻辑位于app的delegate对象,与UIApplication联合一起工作。 App Delegate Object:app delegate对象是一个自定义对象,在app启动的时候

2016-03-08 13:44:03 398

原创 iOS 系统框架分层结构

简要介绍iOS各层的作用和包含的东西。  Cocoa Touch Layer包含创建一个ios应用的关键框架(framework)。定义支撑起一个app的基础内容和核心技术,例如多线程、基于touch的输入、手势、标准的系统view contoller、push通知和一些高层次的系统服务。(因为名字的原因,初级开发者很容易被误导认为Cocoa Touch只是涉及到UI上的一些t

2016-03-08 13:43:56 556

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除