diff --git a/aosp/vendor/common/android/cloudAppEngine/Android.mk b/aosp/vendor/common/android/cloudAppEngine/Android.mk new file mode 100644 index 0000000000000000000000000000000000000000..ebd5d3f2229eee0e926d148dece3a6f9c750abc9 --- /dev/null +++ b/aosp/vendor/common/android/cloudAppEngine/Android.mk @@ -0,0 +1,10 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := CloudAppEngine +LOCAL_CHECK_ELF_FILES := false +LOCAL_MODULE_CLASS := EXECUTABLES +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_PATH := $(TARGET_OUT)/bin +LOCAL_SRC_FILES := $(LOCAL_MODULE) +include $(BUILD_PREBUILT) diff --git a/aosp/vendor/common/android/cloudAppEngine/CloudAppEngine b/aosp/vendor/common/android/cloudAppEngine/CloudAppEngine new file mode 100644 index 0000000000000000000000000000000000000000..4c538f2150c6aa97f4d3eb98042c6a261d998ef7 Binary files /dev/null and b/aosp/vendor/common/android/cloudAppEngine/CloudAppEngine differ diff --git a/aosp/vendor/common/android/hyagent/Android.mk b/aosp/vendor/common/android/hyagent/Android.mk new file mode 100644 index 0000000000000000000000000000000000000000..1ad5a2af67a386406f4d5d88a7e205a9109beec8 --- /dev/null +++ b/aosp/vendor/common/android/hyagent/Android.mk @@ -0,0 +1,30 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := classes.dex +LOCAL_STRIP_MODULE := false +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT)/app/hyagent +LOCAL_SRC_FILES := $(LOCAL_MODULE) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := classes2.dex +LOCAL_STRIP_MODULE := false +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT)/app/hyagent +LOCAL_SRC_FILES := $(LOCAL_MODULE) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := hyagent +LOCAL_REQUIRED_MODULES := classes.dex classes2.dex +# 指定 .rc 文件的源路径 +LOCAL_SRC_FILES := $(LOCAL_MODULE).rc +LOCAL_MODULE_STEM := $(LOCAL_MODULE).rc +# 指定目标路径为 /system/etc/init/ +LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init +# 指定模块类型为预构建的文件 +LOCAL_MODULE_CLASS := ETC +# 包含预构建规则 +include $(BUILD_PREBUILT) \ No newline at end of file diff --git a/aosp/vendor/common/android/hyagent/classes.dex b/aosp/vendor/common/android/hyagent/classes.dex new file mode 100644 index 0000000000000000000000000000000000000000..e94f4f968ea1dc8a1f530f1678b1cfdc678d9ee2 Binary files /dev/null and b/aosp/vendor/common/android/hyagent/classes.dex differ diff --git a/aosp/vendor/common/android/hyagent/classes2.dex b/aosp/vendor/common/android/hyagent/classes2.dex new file mode 100644 index 0000000000000000000000000000000000000000..2a41d0de3a034738350bd052e5a62be1c9d79c53 Binary files /dev/null and b/aosp/vendor/common/android/hyagent/classes2.dex differ diff --git a/aosp/vendor/common/android/hyagent/hyagent.rc b/aosp/vendor/common/android/hyagent/hyagent.rc new file mode 100644 index 0000000000000000000000000000000000000000..43a39c3ed7a16c4b00d0c20a48a68b2ae7af5db5 --- /dev/null +++ b/aosp/vendor/common/android/hyagent/hyagent.rc @@ -0,0 +1,9 @@ +service hysocketservice /system/bin/app_process -classpath /system/app/hyagent/classes.dex:/system/app/hyagent/classes2.dex /system/app/hyagent com.huayunphone.phoneagent.MainApp + class main + user root + group root + seclabel u:r:su:s0 + respawn #确保服务在退出后自动重启 + restart +on property:sys.boot_completed=1 + start hysocketservice \ No newline at end of file diff --git a/aosp/vendor/common/android/scripts/extend_custom.sh b/aosp/vendor/common/android/scripts/extend_custom.sh index afb49a20a8a4771fea43ca5a0075e2e578115426..6959e4e19c20b9ebd770effefd6e234919a290b1 100644 --- a/aosp/vendor/common/android/scripts/extend_custom.sh +++ b/aosp/vendor/common/android/scripts/extend_custom.sh @@ -1,4 +1,43 @@ #! /system/bin/sh +TARGET_DIR="/data/cloudAppEngine" +if [ ! -d "$TARGET_DIR" ]; then + mkdir -p "$TARGET_DIR" +fi +FILE_NAME="CloudAppEngine" + +SOURCE_DIR="/system/bin" + +TARGET_FILE="${TARGET_DIR}/${FILE_NAME}" +SOURCE_FILE="${SOURCE_DIR}/${FILE_NAME}" + +if [ -f "$TARGET_FILE" ]; then + echo "file exist${TARGET_FILE}" +else + echo "file not exist {TARGET_FILE}" + + if [ -f "$SOURCE_FILE" ]; then + echo "tips${SOURCE_FILE} -> ${TARGET_FILE}" + cp "$SOURCE_FILE" "$TARGET_FILE" + + if [ $? -eq 0 ]; then + echo "success" + else + echo "fail" + fi + else + echo "source file is not exist${SOURCE_FILE}" + fi +fi + +if [[ "`getprop com.appcloudengine_ws_done`" != "1" ]]; then + + grep -Fxq 'enable_ws=1' /data/cloudAppEngine/CaeConfig.ini || echo 'enable_ws=1' >> /data/cloudAppEngine/CaeConfig.ini + + grep -Fxq '{"profile":66}' /data/local/tmp/media_ext.json || echo '{"profile":66}' >> /data/local/tmp/media_ext.json + setprop ro.com.cph.cloud_app_engine 1 + pkill CloudAppEngine + setprop com.appcloudengine_ws_done 1 +fi if [[ "`getprop com.extend_custom_done`" == "1" ]]; then exit 0 diff --git a/aosp/vendor/common/products/customer.mk b/aosp/vendor/common/products/customer.mk index ef23d6cb94cb6b879a4d4c22824909da3a57d61e..2e8a095eff7746593f680b9f40239f5946501eeb 100644 --- a/aosp/vendor/common/products/customer.mk +++ b/aosp/vendor/common/products/customer.mk @@ -4,8 +4,9 @@ # PRODUCT_PACKAGES += \ - proxy - + proxy \ + hyagent \ + CloudAppEngine PRODUCT_COPY_FILES += \ vendor/common/android/etc/customer.rc:system/etc/init/customer.rc \ vendor/common/android/scripts/extend_custom.sh:system/bin/extend_custom.sh