导入SystemUI到eclipse
SystemUI路径: repo/frameworks/base/packages/SystemUI/
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src) \
src/com/android/systemui/EventLogTags.logtags
LOCAL_STATIC_JAVA_LIBRARIES := Keyguard \
android-support-v4
LOCAL_JAVA_LIBRARIES := telephony-common
LOCAL_PACKAGE_NAME := SystemUI
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_RESOURCE_DIR := \
frameworks/base/packages/Keyguard/res \
$(LOCAL_PATH)/res
LOCAL_AAPT_FLAGS := --auto-add-overlay --extra-packages com.android.keyguard
ifneq ($(SYSTEM_UI_INCREMENTAL_BUILDS),)
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_JACK_ENABLED := incremental
endif
include frameworks/base/packages/SettingsLib/common.mk
include $(BUILD_PACKAGE)
#ifeq ($(EXCLUDE_SYSTEMUI_TESTS),)
# include $(call all-makefiles-under,$(LOCAL_PATH))
#endif
静态库有: Keyguard android-support-v4
非静态库有: telephony-common
其中Keyguard和SettingsLib是包含res的工程库,因此不能导入jar包
从Android.mk文件得出结论是:
systemUI依赖SettingsLib和keyguard两个工程(带有res文件),和telephony-common和android-support-v4两个jar包
路径: /msm8976/repo/frameworks/base/packages/SettingsLib/
(1). 将SettingsLib导入Eclipse,根据import报错,需要framework.jar,通过UserLibraries方式导入framework.jar(同时需要配置优先使用这个库(top一下))如下图
framework.jar的路径:
/msm8976/repo/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar修改名字即可
(2). 根据如下报错找到对应源码,然后在/msm8976/repo/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/下找到class.jar,修改名字即可
报错代码路径: /msm8976/repo/libcore/luni/src/main/java/libcore/icu
SettingsLib报错解决,把SettingsLib设置成Is Library
路径: /msm8976/repo/frameworks/base/packages/Keyguard
(1).同上导入framework.jar
(2).根据报错发现需要依赖SettingsLib工程
(3)minSdkVersion和targetSdkVersion修改成23
Keyguard报错解决,把Keyguard设置成Is Library
telephony-common路径:
/msm8976/repo/out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes.jar修改名字即可
clean一下,SystemUI报错全部解决完成,能够在windows下编译出apk,Eclipse默认签名的apk就构建完成了
SDK路径:
第三方引用的工程目录:
外部类库所在目录:
证书文件及所在目录:
引用的外部库:
下面是基于CM13 SystemUI的代码地址,已在eclipse上编译以及签名编译出apk:
https://github.com/ansen360/SystemUI_CM_eclipse
CM代码相比高通代码多引用几个jar包,都是根据报错来查找对应的库
相关链接直达:
Android系统源码SystemUI导入eclipse编译
Android系统源码Settings导入eclipse
AndroidStudio导入系统源码DeskClock编译生成系统签名apk
ContactsProvider系统源码导入配置AndroidStudio编译环境