Installation de JDK 8 http://qiita.com/niusounds/items/1f32dcd6fa1f57ade98a
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir -p aosp/7.1.2
$ cd aosp
$ ~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.2_r17
$ ~/bin/repo sync
...
Checking out files: 100% (6377/6377), done. out files: 26% (1719/6377)
Checking out files: 100% (1717/1717), done.
Checking out files: 100% (44431/44431), done.
Checking out files: 100% (62/62), done.king out files: 14% (9/62)
Checking out files: 100% (1756/1756), done.
Checking out files: 100% (8484/8484), done.
Checking out files: 100% (539/539), done.ng out files: 28% (151/539)
Checking out files: 100% (15774/15774), done.ut files: 7% (1128/15774)
Checking out files: 100% (25/25), done.
Syncing work tree: 100% (529/529), done.
Paramètres Java
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
$ export PATH=$PATH:$JAVA_HOME/bin
Paramètres de construction
$ source build/envsetup.sh
$ lunch
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. full_fugu-userdebug
8. aosp_fugu-userdebug
9. mini_emulator_arm64-userdebug
10. m_e_arm-userdebug
11. m_e_mips-userdebug
12. m_e_mips64-eng
13. mini_emulator_x86-userdebug
14. mini_emulator_x86_64-userdebug
15. aosp_dragon-userdebug
16. aosp_dragon-eng
17. aosp_marlin-userdebug
18. aosp_sailfish-userdebug
19. aosp_flounder-userdebug
20. aosp_angler-userdebug
21. aosp_bullhead-userdebug
22. hikey-userdebug
23. aosp_shamu-userdebug
Which would you like? [aosp_arm-eng] aosp_flounder-eng ← Sélectionnez en fonction du terminal que vous souhaitez construire(https://forum.xda-developers.com/wiki/Google/Device_Codenames)
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=aosp_flounder
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=denver64
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=denver
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-78-generic-x86_64-with-debian-stretch-sid
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47B
OUT_DIR=out
============================================
Construire
$ make -j8 &> makelog_`date "+%Y%m%d_%H%M%S"`.txt
makelog_20170627_010549.txt
...
[ 99% 49532/49533] host C++: primitives_tests_32 <= system/media/audio_utils/tests/primitives_tests.cpp
[100% 49533/49533] host Executable: primitives_tests_32 (out/host/linux-x86/obj32/EXECUTABLES/primitives_tests_intermediates/primitives_tests32)
[0;32m#### make completed successfully (02:12:53 (hh:mm:ss)) ####[00m
Écrivez le produit de construction ci-dessous. /out/target/product/flounder/system.img /out/target/product/flounder/boot.img
$ adb reboot bootloader
$ fastboot flash boot <boot.Chemin du dossier avec img>/boot.img
$ fastboot flash system <system.Chemin du dossier avec img>/system.img
$ fastboot reboot
Hello, World!
Personnalisez pour afficher la boîte de dialogue "Hellor, World!" Au démarrage.
Mettez les modifications suivantes à la fin d'ActivityManagerService # finishBooting qui est appelée lorsque le démarrage est terminé.
https://android.googlesource.com/platform/frameworks/base/+/android-7.1.2_r17/services/core/java/com/android/server/am/ActivityManagerService.java#finishBooting
ActivityManagerService.java
...
mUserController.sendBootCompletedLocked(
new IIntentReceiver.Stub() {
@Override
public void performReceive(Intent intent, int resultCode,
String data, Bundle extras, boolean ordered,
boolean sticky, int sendingUser) {
synchronized (ActivityManagerService.this) {
requestPssAllProcsLocked(SystemClock.uptimeMillis(),
true, false);
}
}
});
scheduleStartProfilesLocked();
}
}
+ AlertDialog.Builder builder = new AlertDialog.Builder(mContext)
+ .setTitle("Hello, World!");
+ Dialog dialog = builder.create();
+ dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
+ dialog.show();
}
"Construire Construction précise de la pièce modifiée
~/AOSP/7.1.2$ mmm frameworks/base/services
...
#### make completed successfully (32 seconds) ####
Le produit de construction est généré vers le suivant
out/target/product/flounder/system/framework/services.jar
Remplacez services.jar dans le terminal par les services.jar intégrés
$ adb remount
$ adb push <services.Chemin du dossier avec jar>/services.jar /system/framework/.
$ adb reboot
Recommended Posts