1. framework jar 路径:
\out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\classes-header.jar
重命名为framework.jar
2. apk 签名
java -Xmx2048m -jar apksigner.jar的路径 sign --key platform.pk8的路径 --cert platform.x509.pem的路径 --out 签过名的apk路径 签名之前apk路径
例如:
java -Xmx2048m -jar /home/test/code/apksigner.jar sign --key /home/test/key/platform.pk8 --cert /home/test/key/platform.x509.pem --out /home/test/apk/app-debug.apk_signed.apk /home/test/apk/app-debug.apk
apksigner.jar,V2用的这个, 它是在 SDK 中
3. android 中编译一个 bin文件
cc_binary {
name: "coolfsgetxattr",
srcs: ["getxattr.cpp"],
cflags: [
"-Wall",
"-Werror",
"-Wextra",
"-Wunreachable-code",
"-Wunreachable-code-break",
"-Wunreachable-code-return",
],
shared_libs: [
"libbase",
"libcutils",
"liblog",
"liblogwrap",
"libprocessgroup",
"libutils",
],
clang: true,
tidy: true,
tidy_checks: [
"-*",
"clang-analyzer-security*",
"cert-*",
"-cert-err58-cpp",
],
tidy_flags: [
"-warnings-as-errors=clang-analyzer-security*,cert-*"
],
}
4. 预编译apk
android_app_import {
name: "FileScanner",
certificate: "platform",
apk:"app-release.apk",
}
apk 源码编译
android_app {
name: "FileScanner",
certificate: "platform",
srcs: ["java/**/*.java",
"aidl/**/*.aidl",
],
static_libs: [
"androidx.appcompat_appcompat",
"androidx-constraintlayout_constraintlayout",
"com.google.android.material_material",
],
resource_dirs: ["res"],
platform_apis: true,
}
5. android studio 输出jar包
//Copy类型
task makeJar(type: Copy) {
//删除存在的
delete 'build/libs/clouddisk.jar'
//设置拷贝的文件
// from('build/intermediates/bundles/release/')
from('build/intermediates/aar_main_jar/release/')
//打进jar包后的文件目录
into('build/libs/')
//将classes.jar放入build/libs/目录下
//include ,exclude参数来设置过滤
//(我们只关心classes.jar这个文件)
include('classes.jar')
//重命名
rename ('classes.jar', 'clouddisk.jar')
}
6. Android Studio 添加系统签名
Android studio上开发系统APP 配置和步骤_gzn的博客-CSDN博客_android 开发系统app
编译错误:Could not get unknown property 'release' for SigningConfig container_a方的博客-CSDN博客
|