文章目录
- 单独拉取framework
- 开机与开机动画横屏
- Android.mk语法
- 单独编译SDK
- make 忽略warning
- 单独修改和编译Camera2
- 单独编译Launcher3
- Android Studio 导入、修改、编译Settings
- 导入
- Android Studio 导入、修改、编译Launcher3
- android 开机默认进入指定Launcher
- 植入自己的apk到系统当中
- 内置第三方输入法
- Settings USB 调试默认打开
- git代码管理
- 快速修改系统app
- 替换启动开机画
- 打包服务应用Car
- 模块打包到镜像中
- 预装带so的apk
- 搜集命令
单独拉取framework
repo sync platform/frameworks/base
开机与开机动画横屏
https://cczheng.blog.csdn.net/article/details/107951773
Android.mk语法
https://www.jianshu.com/p/703ef39dff3f
单独编译SDK
https://blog.csdn.net/starhosea/article/details/78663285
make sdk -j12 'ANDROID_COMPILE_WITH_JACK:=false'
make 忽略warning
在Makefile编译命令后面:
添加 -w(小写) 可以忽略warning;
添加 -Werror 可以将warning当作error,出现warning时停止编译;
添加 -Wall 可以输出所有
单独修改和编译Camera2
先找到包名
maqi@ubuntu:~/data/android-11.0.0_r9$ adb shell dumpsys window | grep mCurrentFocusmCurrentFocus=Window{dc54f28 u0 com.android.camera2/com.android.camera.CameraLauncher}
targetActivity 找到 CameraActivity
<activity-aliasandroid:name="com.android.camera.CameraLauncher"android:label="@string/app_name"android:targetActivity="com.android.camera.CameraActivity"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.DEFAULT" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity-alias>
加入一个标志
<com.android.camera.ui.MainActivityLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/activity_root_view"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@null"><include layout="@layout/camera" /><include layout="@layout/camera_filmstrip" /><com.android.camera.ui.ModeTransitionViewandroid:id="@+id/mode_transition_view"android:visibility="gone"android:layout_width="match_parent"android:layout_height="match_parent" /><TextViewandroid:id="@+id/txtOne"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="MAQI666"android:textColor="#EA5246"android:textStyle="bold|italic"android:background="#000000"android:textSize="18sp" /></com.android.camera.ui.MainActivityLayout>
编译成功
cd packages/apps/Camera2
mm -j12
* Connection #0 to host localhost left intact
[100% 10/10] Install: out/target/product/angler/data/app/Camera2Tests/Camera2Tests.apk
make: Leaving directory '/home/maqi/data/android-11.0.0_r9'
#### make completed successfully (05:40 (mm:ss)) ####
查看输出
maqi@ubuntu:~/data/android-11.0.0_r9/out/target/product/angler/system/app$ ls -l Camer*
total 5768
-rw-rw-r-- 1 maqi maqi 5894746 Nov 23 17:51 Camera2.apk
drwxrwxr-x 3 maqi maqi 4096 Nov 17 16:42 lib
drwxrwxr-x 3 maqi maqi 4096 Nov 17 16:45 oat
烧入&&重启
adb push Camera2.apk /system/app/Camera2/adb shell am restart
效果图
单独编译Launcher3
单独编译Launcher3
ninja: error: ‘out/host/linux-x86/framework/host-libprotobuf-java-nano.jar’, needed by
cd /package/apps/Launcher3
mma -j12
Android Studio 导入、修改、编译Settings
https://blog.csdn.net/qq_45815991/article/details/130278276
mm -j8 WITH_DEXPREOPT=false
make SettingsLib -j12 'ANDROID_COMPILE_WITH_JACK:=false'
https://note.qidong.name/2017/07/06/disable-jack-when-make-android/
导入
先学一下Git控制指令,玩转repo
repo sync packages/apps/Settings
Resolving deltas: 100% (33776/33776)
Resolving deltas: 100% (33776/33776), completed with 494 local objects.
Fetching: 0% (0/1) 12:43 | 1 job | 12:43 platform/packages/apps/Settings @ packages/apps/SettingsFetching: 100% (1/1), done in 16m4.670s
Updating files: 100% (3143/3143), done.
Checking out: 100% (1/1), done in 16.036s
repo sync has finished successfully.
方式二
maqi@ubuntu:~/data/source/.repo/manifests$ vim default.xml
git clone git://mirrors.ustc.edu.cn/aosp/platform/packages/apps/Settings
Android Studio 导入、修改、编译Launcher3
https://blog.csdn.net/u012932409/article/details/128772883
android 开机默认进入指定Launcher
https://blog.csdn.net/mj475002864/article/details/104759067
植入自己的apk到系统当中
https://blog.csdn.net/byhook/article/details/51900277
内置第三方输入法
https://www.jianshu.com/p/e782897c6ab8
Settings USB 调试默认打开
git代码管理
https://blog.csdn.net/qq_20330595/article/details/134042749?spm=1001.2014.3001.5502
快速修改系统app
https://blog.csdn.net/qq_20330595/article/details/146269135?spm=1001.2014.3001.5502
替换启动开机画
https://blog.csdn.net/qq_20330595/article/details/140856458
nanopc -t4 官方替换教程
打包服务应用Car
nothing…
模块打包到镜像中
make snod
预装带so的apk
预装带so的apk
搜集命令
模块 | make命令 | mmm 命令 |
---|---|---|
init | make init | mmm system/core/init |
zygot | make app_process | mmm frameworks/base/cmds/app_process |
system_server | make services | mmm frameworks/base/services |
java framwork | make framework | mmm frameworks/base |
framework res | make framework-res | mmm frameworks/base/core/res |
framework jni | make libandroid_runtime | mmm frameworks/base/core_jni |
binder | make libbinder | mmm frameworks/base/libs/binder |