android编译分析之7—product_config.mk

[笔记分享] [Build] Android编译系统源代码之product.mk 介绍源代码在build下,主要是在build/core下,下面是几个相对比较重要的文件。 main.mk: 主控Makefile, 如找到top目录下的所有Android.mk文件等。 base_rules.mk: 对Makefile的一些变量规则化。 binary.mk: 获取所有目标文件。 clear_vars.mk: 清楚编译系统中用到的临时变量。 config.mk: 包 阅读详情

顾名思义,product_config.mk为产品相关的配置makefile。(假设lunch时选择的是aosp_arm-eng)
通过该makefile,就可以将product相关makefile中定义的变量复制过来,以备其他makefile调用。这些变量包括:
TARGET_DEVICE
PRODUCT_LOCALES
PRODUCT_COPY_FILES
PRODUCT_PROPERTY_OVERRIDES
PRODUCT_PACKAGE_OVERLAYS
DEVICE_PACKAGE_OVERLAYS
等等……


首先定义了一个函数,判断字符串是否是c描述符,

###########################################################
## Return non-empty if $(1) is a C identifier; i.e., if it
## matches /^[a-zA-Z_][a-zA-Z0-9_]*$/.  We do this by first
## making sure that it isn't empty and doesn't start with
## a digit, then by removing each valid character.  If the
## final result is empty, then it was a valid C identifier.
##
## $(1): word to check
###########################################################

_ici_digits := 0 1 2 3 4 5 6 7 8 9
_ici_alphaunderscore := \
    a b c d e f g h i j k l m n o p q r s t u v w x y z \
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _
define is-c-identifier
$(strip \
  $(if $(1), \
    $(if $(filter $(addsuffix %,$(_ici_digits)),$(1)), \
     , \
      $(eval w := $(1)) \
      $(foreach c,$(_ici_digits) $(_ici_alphaunderscore), \
        $(eval w := $(subst $(c),,$(w))) \
       ) \
      $(if $(w),,TRUE) \
      $(eval w :=) \
     ) \
   ) \
 )
endef

检测sed的版本,如果不对,make直接就error了。

# TODO: push this into the combo files; unfortunately, we don't even
# know HOST_OS at this point.
trysed := $(shell echo a | sed -E -e 's/a/b/' 2>/dev/null)
ifeq ($(trysed),b)
  SED_EXTENDED := sed -E
else
  trysed := $(shell echo c | sed -r -e 's/c/d/' 2>/dev/null)
  ifeq ($(trysed),d)
    SED_EXTENDED := sed -r
  else
    $(error Unknown sed version)
  endif
endif

下面这个函数,在目录中找到指定的文件,然后表示成PRODUCT_COPY_FILES那种格式原文件:目标目录,例如

prodir/bootanimation/boot.wav:system/media/boot.wav 
###########################################################
## List all of the files in a subdirectory in a format
## suitable for PRODUCT_COPY_FILES and
## PRODUCT_SDK_ADDON_COPY_FILES
##
## $(1): Glob to match file name
## $(2): Source directory
## $(3): Target base directory
###########################################################

define find-copy-subdir-files
$(shell find $(2) -name "$(1)" | $(SED_EXTENDED) "s:($(2)/?(.*)):\\1\\:$(3)/\\2:" | sed "s://:/:g")
endef

默认的TARGET_BUILD_VARIANT包含user userdebug eng这三种,

# These are the valid values of TARGET_BUILD_VARIANT.  Also, if anything else is passed
# as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
# it will be treated as a goal, and the eng variant will be used.
INTERNAL_VALID_VARIANTS := user userdebug eng

判断make的目标是否为PRODUCT-prodname-goal这种类型,这里显然不是,

# ---------------------------------------------------------------
# Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build
# a particular configuration without needing to set up the environment.
#
product_goals := $(strip $(filter PRODUCT-%,$(MAKECMDGOALS)))
ifdef product_goals
  # Scrape the product and build names out of the goal,
  # which should be of the form PRODUCT-<productname>-<buildname>.
  #
  ifneq ($(words $(product_goals)),1)
    $(error Only one PRODUCT-* goal may be specified; saw "$(product_goals)")
  endif
  goal_name := $(product_goals)
  product_goals := $(patsubst PRODUCT-%,%,$(product_goals))
  product_goals := $(subst -, ,$(product_goals))
  ifneq ($(words $(product_goals)),2)
    $(error Bad PRODUCT-* goal "$(goal_name)")
  endif

  # The product they want
  TARGET_PRODUCT := $(word 1,$(product_goals))

  # The variant they want
  TARGET_BUILD_VARIANT := $(word 2,$(product_goals))

  ifeq ($(TARGET_BUILD_VARIANT),tests)
    $(error "tests" has been deprecated as a build variant. Use it as a build goal instead.)
  endif

  # The build server wants to do make PRODUCT-dream-installclean
  # which really means TARGET_PRODUCT=dream make installclean.
  ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
    MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
    TARGET_BUILD_VARIANT := eng
    default_goal_substitution :=
  else
    default_goal_substitution := $(DEFAULT_GOAL)
  endif

  # Replace the PRODUCT-* goal with the build goal that it refers to.
  # Note that this will ensure that it appears in the same relative
  # position, in case it matters.
  #
  # Note that modifying this will not affect the goals that make will
  # attempt to build, but it's important because we inspect this value
  # in certain situations (like for "make sdk").
  #
  MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))

  # Define a rule for the PRODUCT-* goal, and make it depend on the
  # patched-up command-line goals as well as any other goals that we
  # want to force.
  #
.PHONY: $(goal_name)
$(goal_name): $(MAKECMDGOALS)
endif
# else: Use the value set in the environment or buildspec.mk.

判断make的目标是否为APP-appname这种类型,这里显然不是,

# ---------------------------------------------------------------
# Provide "APP-<appname>" targets, which lets you build
# an unbundled app.
#
unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
ifdef unbundled_goals
  ifneq ($(words $(unbundled_goals)),1)
    $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)"))
  endif
  TARGET_BUILD_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
  ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
    MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
  else
    MAKECMDGOALS := $(patsubst $(unbundled_goals),$(DEFAULT_GOAL),$(MAKECMDGOALS))
  endif

.PHONY: $(unbundled_goals)
$(unbundled_goals): $(MAKECMDGOALS)
endif # unbundled_goals

默认dalvikvm 在host主机上也要编译,

# Default to building dalvikvm on hosts that support it...
ifeq ($(HOST_OS),linux)
# ... or if the if the option is already set
ifeq ($(WITH_HOST_DALVIK),)
  WITH_HOST_DALVIK := true
endif
endif

下面要Include三个makefile,其中的函数和变量在前面已经分析过,之所以include,那肯定是要用这些函数和变量啦。

# ---------------------------------------------------------------
# Include the product definitions.
# We need to do this to translate TARGET_PRODUCT into its
# underlying TARGET_DEVICE before we start defining any rules.
#
include $(BUILD_SYSTEM)/node_fns.mk
include $(BUILD_SYSTEM)/product.mk
include $(BUILD_SYSTEM)/device.mk

TARGET_BUILD_APPS为空,走else分支,然后调用get-all-product-makefiles函数,返回所有产品的makefile列表。

ifneq ($(strip $(TARGET_BUILD_APPS)),)
# An unbundled app build needs only the core product makefiles.
all_product_configs := $(call get-product-makefiles,\
    $(SRC_TARGET_DIR)/product/AndroidProducts.mk)
else
# Read in all of the product definitions specified by the AndroidProducts.mk
# files in the tree.
# 作用是将device和vendor下的AndroidProducts.mk找出来,然后全部include进来,返回包含类似aosp_flounder.mk这种的列表
all_product_configs := $(get-all-product-makefiles)
endif

就像注释所写,为当前product找到对应的config makefile,

# Find the product config makefile for the current product.
# all_product_configs consists items like:
# <product_name>:<path_to_the_product_makefile>
# or just <path_to_the_product_makefile> in case the product name is the
# same as the base filename of the product config makefile.
# 这里all_product_configs都是类似makefile文件的列表,没有:
# 所以_cpm_word2为空,all_product_makefiles这时候是所有产品的mk的文件列表
# 而current_product_makefile为build/target/product/aosp_arm.mk
current_product_makefile :=
all_product_makefiles :=
$(foreach f, $(all_product_configs),\
    $(eval _cpm_words := $(subst :,$(space),$(f)))\
    $(eval _cpm_word1 := $(word 1,$(_cpm_words)))\
    $(eval _cpm_word2 := $(word 2,$(_cpm_words)))\
    $(if $(_cpm_word2),\
        $(eval all_product_makefiles += $(_cpm_word2))\
        $(if $(filter $(TARGET_PRODUCT),$(_cpm_word1)),\
            $(eval current_product_makefile += $(_cpm_word2)),),\
        $(eval all_product_makefiles += $(f))\
        $(if $(filter $(TARGET_PRODUCT),$(basename $(notdir $(f)))),\
            $(eval current_product_makefile += $(f)),)))
_cpm_words :=
_cpm_word1 :=
_cpm_word2 :=
current_product_makefile := $(strip $(current_product_makefile))
all_product_makefiles := $(strip $(all_product_makefiles))

调用import-products(build/target/product/aosp_arm.mk),将产品中定义的变量都import进来。例如,产品中定义了PRODUCT_NAME,则最终PRODUCT_NAME的值会保存在PRODUCTS.aosp_arm.mk.PRODUCT_NAME中。

# 如果目标是打印产品,如product-graph dump-products,打印产品,则是将所有的产品都import,
ifneq (,$(filter product-graph dump-products, $(MAKECMDGOALS)))
# Import all product makefiles.
$(call import-products, $(all_product_makefiles))
else
# Import just the current product.
ifndef current_product_makefile
$(error Can not locate config makefile for product "$(TARGET_PRODUCT)")
endif
ifneq (1,$(words $(current_product_makefile)))
$(error Product "$(TARGET_PRODUCT)" ambiguous: matches $(current_product_makefile))
endif
#将aosp_arm.mk 利用import-products import
$(call import-products, $(current_product_makefile))
endif  # Import all or just the current product makefile

然后调用check-all-products检查产品是否正确import,要保证必须的变量在product中都被定义。

# Sanity check
$(check-all-products)

如果make目标为dump-products,打印产品。

ifneq ($(filter dump-products, $(MAKECMDGOALS)),)
$(dump-products)
$(error done)
endif

INTERNAL_PRODUCT,为产品的全部路径,例如TARGET_PRODUCT=aosp_arm,则INTERNAL_PRODUCT为build/target/product/aosp_arm.mk

# Convert a short name like "sooner" into the path to the product
# file defining that product.
#
INTERNAL_PRODUCT := $(call resolve-short-product-name, $(TARGET_PRODUCT))
ifneq ($(current_product_makefile),$(INTERNAL_PRODUCT))
$(error PRODUCT_NAME inconsistent in $(current_product_makefile) and $(INTERNAL_PRODUCT))
endif
current_product_makefile :=
all_product_makefiles :=
all_product_configs :=

下面的变量都是在产品中定义的,将其拷贝到product_config.mk中,以备其他makefile使用。

#############################################################################

# A list of module names of BOOTCLASSPATH (jar files)
PRODUCT_BOOT_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOT_JARS))
PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_JARS))

# Find the device that this product maps to.
TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)

# Figure out which resoure configuration options to use for this
# product.
# 产品中定义的语言
PRODUCT_LOCALES := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_LOCALES))
# TODO: also keep track of things like "port", "land" in product files.

# 如果CUSTOM_LOCALES中定义了PRODUCT_LOCALES中没有的,则添加到PRODUCT_LOCALES中
# If CUSTOM_LOCALES contains any locales not already included
# in PRODUCT_LOCALES, add them to PRODUCT_LOCALES.
extra_locales := $(filter-out $(PRODUCT_LOCALES),$(CUSTOM_LOCALES))
ifneq (,$(extra_locales))
  ifneq ($(CALLED_FROM_SETUP),true)
    # Don't spam stdout, because envsetup.sh may be scraping values from it.
    $(info Adding CUSTOM_LOCALES [$(extra_locales)] to PRODUCT_LOCALES [$(PRODUCT_LOCALES)])
  endif
  PRODUCT_LOCALES += $(extra_locales)
  extra_locales :=
endif

# Add PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
PRODUCT_AAPT_CONFIG := $(strip $(PRODUCT_LOCALES) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_CONFIG))
PRODUCT_AAPT_PREF_CONFIG := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREF_CONFIG))
PRODUCT_AAPT_PREBUILT_DPI := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREBUILT_DPI))

# Keep a copy of the space-separated config
PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)

# Convert spaces to commas.
PRODUCT_AAPT_CONFIG := \
    $(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_CONFIG)))

# product-scoped aapt flags
PRODUCT_AAPT_FLAGS :=
ifneq ($(filter en_XA ar_XB,$(PRODUCT_LOCALES)),)
# Force generating resources for pseudo-locales.
PRODUCT_AAPT_FLAGS += --pseudo-localize
endif

PRODUCT_BRAND := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BRAND))

PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MODEL))
ifndef PRODUCT_MODEL
  PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_NAME))
endif

PRODUCT_MANUFACTURER := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MANUFACTURER))
ifndef PRODUCT_MANUFACTURER
  PRODUCT_MANUFACTURER := unknown
endif

ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS),)
  TARGET_AAPT_CHARACTERISTICS := default
else
  TARGET_AAPT_CHARACTERISTICS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_CHARACTERISTICS))
endif

PRODUCT_DEFAULT_WIFI_CHANNELS := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_WIFI_CHANNELS))

PRODUCT_DEFAULT_DEV_CERTIFICATE := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_DEV_CERTIFICATE))
ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
ifneq (1,$(words $(PRODUCT_DEFAULT_DEV_CERTIFICATE)))
    $(error PRODUCT_DEFAULT_DEV_CERTIFICATE='$(PRODUCT_DEFAULT_DEV_CERTIFICATE)', \
      only 1 certificate is allowed.)
endif
endif

# A list of words like <source path>:<destination path>[:<owner>].
# The file at the source path should be copied to the destination path
# when building  this product.  <destination path> is relative to
# $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml".
# The rules for these copy steps are defined in build/core/Makefile.
# The optional :<owner> is used to indicate the owner of a vendor file.
PRODUCT_COPY_FILES := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COPY_FILES))

# A list of property assignments, like "key = value", with zero or more
# whitespace characters on either side of the '='.
PRODUCT_PROPERTY_OVERRIDES := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PROPERTY_OVERRIDES))

# A list of property assignments, like "key = value", with zero or more
# whitespace characters on either side of the '='.
# used for adding properties to default.prop
PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES))

# Should we use the default resources or add any product specific overlays
PRODUCT_PACKAGE_OVERLAYS := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGE_OVERLAYS))
DEVICE_PACKAGE_OVERLAYS := \
        $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).DEVICE_PACKAGE_OVERLAYS))

# The list of product-specific kernel header dirs
PRODUCT_VENDOR_KERNEL_HEADERS := \
    $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_KERNEL_HEADERS)

# Add the product-defined properties to the build properties.
ADDITIONAL_BUILD_PROPERTIES := \
    $(ADDITIONAL_BUILD_PROPERTIES) \
    $(PRODUCT_PROPERTY_OVERRIDES)

# The OTA key(s) specified by the product config, if any.  The names
# of these keys are stored in the target-files zip so that post-build
# signing tools can substitute them for the test key embedded by
# default.
PRODUCT_OTA_PUBLIC_KEYS := $(sort \
    $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_PUBLIC_KEYS))

PRODUCT_EXTRA_RECOVERY_KEYS := $(sort \
    $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_EXTRA_RECOVERY_KEYS))

PRODUCT_DEX_PREOPT_DEFAULT_FLAGS := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_FLAGS))
PRODUCT_DEX_PREOPT_BOOT_FLAGS := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_FLAGS))
# Resolve and setup per-module dex-preopot configs.
PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \
    $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_MODULE_CONFIGS))
# If a module has multiple setups, the first takes precedence.
_pdpmc_modules :=
$(foreach c,$(PRODUCT_DEX_PREOPT_MODULE_CONFIGS),\
  $(eval m := $(firstword $(subst =,$(space),$(c))))\
  $(if $(filter $(_pdpmc_modules),$(m)),,\
    $(eval _pdpmc_modules += $(m))\
    $(eval cf := $(patsubst $(m)=%,%,$(c)))\
    $(eval cf := $(subst $(_PDPMC_SP_PLACE_HOLDER),$(space),$(cf)))\
    $(eval DEXPREOPT.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
_pdpmc_modules :=
Android构建系统演进:从Android.mk到Android.bp的全面解析与迁移指南 在大型软件项目构建领域,构建系统负责将源代码转换为可执行程序或库文件,其设计直接影响开发效率和软件质量。传统基于Makefile的构建系统(如Android.mk)虽然灵活,但面临语法复杂、构建缓慢、并行困难等挑战。现代构建系统通过声明式配置和构建图分析技术,实现了更高效、可维护的构建流程。Android平台引入的Soong构建系统与Android.bp配置文件,正是这一技术演进的具体实践。Android.bp采用简洁的类JSON语法,通过模块化描述和精确依赖管理,显著提升了Android源码的构建速度与可 阅读详情

相关推荐

RK3568平台开发系列讲解(安卓适配篇)Android 源码的 device 目录

📢本篇将介绍 Android 源码的 device 目录。

内核笔记 3802

android 避免编译mk,Android系统编译时遇到的几个.mk的疑惑。

在Android4.2的源代码Build/prduct_config.mk里面遇到几个疑惑:# Convert a short name like "sooner" into the path to the product# file defining that product.#INTERNAL_PRODUCT := $(call resolve-short-product-name, $(TA...

weixin_39816024的博客 745

大疆智图002:大疆智图倾斜摄影建模流程

本文主要介绍大疆智图倾斜摄影建模流程,包括新建工程、成果路径设置、导入照片、第一遍空三、像控刺点、第二遍空三、精度报告查看、三维重建等流程。

qq_31762031的博客 1万+

Android Build系列专题【篇二:AOSP编译流程】

众所周知,Android系统其实就是一个运行在Linux系统上面的应用桌面程序,当然这样概括可能不是很准确,但是他们的编译确实异曲同工之妙。 在Linux系统中,我们可以通过make命令来编译代码。执行Make命令默认会在当前目录找到一个Makefile文件,然后根据Makefile文件中的指令来对代码进行编译(makefile语法课参考《GNU make中文手册》)。也就是说make命令执行的是Makefile文件中的指令,Makefile文件中的指令可以是编译命令(例如gcc,也可以是其它命令)。

qq_27672101的博客 1万+

可视化大屏系列(5):设备状态面板与数据分析仪表盘

在这篇文章中,我们将重点讨论如何通过智能化手段提升工地设备的管理效率与维护质量。随着智能工地系统的不断发展,设备监控与维护管理变得尤为重要。本篇将从 设备状态实时监控、自动化维护提醒、设备管理与维修记录 三个方面入手,展示如何通过 Vue3 和 ECharts 构建一个智能化的设备管理平台,实时采集和展示设备运行状态、及时生成维护提醒并记录维修历史,以提高设备的使用效率与安全性。我们还将结合实际代码示例,详细讲解如何实现这些功能,帮助你在智能工地项目中实现设备管理的智能化、数字化和自动化。

一名热衷于技术的全栈开发者,专注于前端与后端的全面技术探索。在这里,我将分享我在技术领域的学习与成长,助力更多开发者的进步。 3371

别再手动算频谱了!用这个在线FFT工具,5分钟搞定JSON/CSV数据分析

本文介绍了一款高效的在线FFT工具,帮助用户快速分析JSON/CSV格式的时域数据,5分钟内完成频谱分析。通过傅里叶变换(FFT)算法,大幅提升计算效率,解决传统手动计算的痛点,适用于工业振动分析、设备故障诊断等场景。

weixin_29172201的博客 275

android R做services.jar使用的动态jar包(java.lang.NoClassDefFoundError)

参考我之前android O做动态jar包的文档:android O做services.jar使用的动态jar包_sui1005316018的博客-CSDN博客 有一些区别: 1、android R用的Android.bp,而android O用的是android.mk,下面的是正式项目的一个android.mk,这里面主要注意两点: (1)android O的android.mk里面的 LOCAL_DEX_PREOPT := false 用 dex_preopt: { ...

sui1005316018的博客 3074

契约锁代码审计分析

但是正常来讲,定义了这么多的路由,肯定会有一个通用的判断逻辑,来判断请求的url是否和这些路由匹配。POC中有一点值得注意,Spring新一些的版本中支持以表单的形式来为参数赋值,且无需用注解。但是需要注意4.2.8的代码逻辑和新版本中的不同,此漏洞可能存在于版本大于4.2.8的版本中。方法用于解析LICENSE,先进行AES解密,再从字符串转换成json格式的License。loadPath实际判断传入的path是否和下面的path相等,如果不相等返回null。,如果包含这三个中的一个就会抛出异常。

好记性不如烂笔头 5792

[Boot]Android系统启动-SystemServer上篇

本文转载自Gityuan的博客,原文地址为:http://gityuan.com/2016/02/14/android-system-server/ 转载请注明作者及原文链接。 基于Android 6.0的源码剖析, 分析Android启动过程的system_server进程 /frameworks/base/core/java/com/android/internal/os/ - Zy...

Letcos 258

预编码算法(个人总结)

预编码算法是无线通信系统中的关键技术,通过在发送端对信号进行处理,可以有效减少干扰,提高系统性能。预编码算法在5G、Wi-Fi、卫星通信等领域具有广泛的应用前景,同时,随着深度学习、大规模MIMO和物理层安全等技术的发展,预编码算法的研究将进一步推动无线通信技术的发展。CSI的准确性直接影响到预编码的效果。预编码是一种在发送端对信号进行线性变换的技术,以优化信号的空间分布,使得接收端能够更好地接收和解码信号。预编码算法,特别是基于矩阵分解的预编码算法,计算复杂度较高,限制了其在实际系统中的应用。

年糕的博客 5299

【读论文】ASR大模型动态热词新方案

大型语言模型(LLMs)以其卓越的通用知识和推理能力重塑了 AI 领域,但它们在处理特定领域或用户的专有词汇(即“热词”)时,往往表现出“选择性失忆”。传统的 RAG 或 Prompting 方案在实时性和准确性上存在瓶颈。阿里的《Hotword Model for Large Models》论文提出了一种“神经插件”方案,它能够在不修改基座模型权重的前提下,动态、精准地将热词能力注入到生成过程中。本文将从架构设计、训练范式到推理逻辑,全方位拆解这一技术的内核,并探讨其在工业级应用中的价值。

kakaZhui的博客 300

android makefile 编译分析及 android.mk分析

android makefile 编译分析及 android.mk分析 From: http://blog.csdn.net/kobeyxyx/article/details/6614970 下面是main.mk文件包含关系,本文档主要说明的就是这些文件里到底做了什么。(这个文件被根目录下的makefile文件包含) 一. main.mk 1.检查版本号,设置环境变量(BU

Hansel的专栏 1090

AUTOSAR从入门到精通-中间件通信DDS(一)

汽车开放系统架构(automotive open system architecture,autosar)是由全球各大汽车oem、零部件供应商、汽车电子软件公司联合建立的一套标准协议。该协议规范了一个符合汽车电子软件开发的、开放的以及标准化的软件架构。最初的autosar规范的制定只考虑传统汽车电子电器架构,基于硬件算力有限场景,提供确定的功能。

getusushu的博客 1874

android makefile及android.mk编译文件分析

下面是main.mk文件包含关系,本文档主要说明的就是这些文件里到底做了什么。(这个文件被根目录下的makefile文件包含) 一. main.mk 1.检查版本号,设置环境变量(BUILD_SYSTEM)和缺省的目标。$(MAKE_VERSION) >= 3.81,BUILD_SYSTEM= build/core 2.包含文件BUILD_SYSTEM/config.mk。根据配置信息和

dongwuming的专栏 1282

编程实践:寒武纪-LLM&VLM模型量化&部署

本文介绍了在MLU370-S4平台上对大模型(LLM/VLM)进行量化的两种方法:SmoothQuant和WeightOnly。以Qwen2-VL-2B模型为例,详细说明了两种量化方式的命令行参数配置,包括必须设置的per_channel选项和量化参数调整建议。量化完成后,提供了模型部署的具体命令示例,包含设备分配、端口设置、并行度等关键参数。文章强调在MLU370芯片上需要手动设置block_size,并指出两种量化方式只能二选一使用。配套资料已上传至百度网盘供参考。

微风❤水墨 518

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Android源码分析(二):mk文件具体的具体的执行流程

Android编译系统集中于build/core下,几个很重要的*.mk文件如下: main.mk(主控Makefile) base_rules.mk(对一些Makefile的变量规则化) config.mk(关于编译参数、编译命令的一些配置) definations...

weixin_34248849的博客 982

InTheHand.Net.Personal+BlueTooth4,蓝牙开发

项目中有蓝牙开发的必备dll,现在网上相关的文档博客不少,有的说的多有的说少,但是却很少有这两个dll,分享一下。

Anbox编译实战:解决CMake与Android.mk混合构建的常见错误

在Linux系统上构建Android运行时环境,常涉及CMake与Android.mk(ndk-build)两种构建系统的混合使用。CMake以其跨平台和模块化优势,负责管理项目的主体架构和平台无关代码;而Android.mk则是Android原生开发的核心,专门处理深度依赖AOSP框架、Bionic C库及Binder等系统服务的组件。这种混合模式在实现跨平台兼容性与利用Android原生能力方面具有重要技术价值,尤其适用于容器化Android运行时、系统服务模拟等场景。然而,工具链不一致、头文件路径冲突

weixin_30700977的博客 372

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Android系统编译脚本理解

 android源码编译步骤: 1. repo sync 代码(下载代码) 2.start branch(用哪个分支,git相关) 3. 到根目录(android目录)   $cd android/ 4. 加载编译选项(函数调用之类,相当于include一些函数)   $ source build/envsetup.sh 5.加载lunch   $lunch [produ

abcdefg的专栏 1215

Android系统编译环境初始化时Product产品的import-nodes过程

从运行make -f config,mk文件開始,config,mk作为当前的makefile文件。将会被make解析,一般make解析Makefile文件流程首先是载入当中include的各种其它mk文件,同一时候在载入的过程中会初始化自己定义的变量,相似于预编译,在完毕各种初始化后,确定目标以及依赖关系,终于运行目标输出动作。在config.mk中存在多个须要include的mk文件。这里...

weixin_34297704的博客 191
上一篇: android编译分析之6—device.mk
下一篇: android编译分析之8—envsetup.mk
lyf5231
博客等级 码龄18年 483粉丝 136原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值