{"action":"opened","issue":{"url":"https://api.github.com/repos/Huoxubeiyin/Android-/issues/8","repository_url":"https://api.github.com/repos/Huoxubeiyin/Android-","labels_url":"https://api.github.com/repos/Huoxubeiyin/Android-/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/Huoxubeiyin/Android-/issues/8/comments","events_url":"https://api.github.com/repos/Huoxubeiyin/Android-/issues/8/events","html_url":"https://github.com/Huoxubeiyin/Android-/issues/8","id":318257300,"number":8,"title":"添加第三方应用到系统","user":{"login":"Huoxubeiyin","id":17829981,"avatar_url":"https://avatars3.githubusercontent.com/u/17829981?v=4","gravatar_id":"","url":"https://api.github.com/users/Huoxubeiyin","html_url":"https://github.com/Huoxubeiyin","followers_url":"https://api.github.com/users/Huoxubeiyin/followers","following_url":"https://api.github.com/users/Huoxubeiyin/following{/other_user}","gists_url":"https://api.github.com/users/Huoxubeiyin/gists{/gist_id}","starred_url":"https://api.github.com/users/Huoxubeiyin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huoxubeiyin/subscriptions","organizations_url":"https://api.github.com/users/Huoxubeiyin/orgs","repos_url":"https://api.github.com/users/Huoxubeiyin/repos","events_url":"https://api.github.com/users/Huoxubeiyin/events{/privacy}","received_events_url":"https://api.github.com/users/Huoxubeiyin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-27T02:30:22Z","updated_at":"2018-04-27T02:30:22Z","closed_at":null,"author_association":"OWNER","body":"### 源码编译之添加第三方应用到系统\r\n\r\n#### 不加源码,只添加apk到系统\r\n\r\n1. 在安卓源码路径/packages/apps下新建自己的app路径\r\n\r\n2.  新建Android.mk文件,如添加QQyinle.apk到系统,如下代码:\r\n\r\n\t      LOCAL_PATH := $(call my-dir)\r\n\t      include $(CLEAR_VARS)\r\n\t      LOCAL_MODULE := QQyinle\r\n\t      LOCAL_MODULE_TAGS := optional\r\n\t      LOCAL_SRC_FILES := $(LOCAL_MODULE).apk\r\n\t      LOCAL_MODULE_CLASS := APPS\r\n\t      LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)\r\n\t      LOCAL_CERTIFICATE := platform\r\n\t      # false -> /system/app/\r\n          # true -> /system/priv-app/\r\n\t      LOCAL_PRIVILEGED_MODULE := true\r\n\t      LOCAL_BUILT_MODULE_STEM := package.apk\r\n\t      include $(BUILD_PREBUILT)\r\n\r\n3. 添加程序到device.mk文件\r\n\t1. 查找到源码中对应的device.mk文件，添加自己的apk到系统（内置），当然也可以删除，例如：\r\n\t2. 路径：device/mstar/almond/device.mk\r\n\r\n\t        # Apps\r\n\t        PRODUCT_PACKAGES += \\\r\n\t            QQyinle \\           <-- 此处添加自己的app\r\n\t            livecap \\\r\n\t            MLeanbackTv \\\r\n\t            MTvPlayer \\\r\n\t            MTvHotkey \\\r\n\t            MTvMisc \\\r\n\t            MTvFactory \\\r\n\t            MTvTest \\\r\n\t            MBrowser3 \\\r\n\t            MLocalMM2 \\\r\n\t            MMCastDemo \\\r\n\t            Launcher3 \\\r\n\t        #    DMP \\\r\n\t            DMS\r\n\r\n4. 局部编译代码 mmm -B packages/apps/M_QQyinyue/(M_QQyinyue是自己建立的)\r\n\r\n      生成对应文件在android/out/target/product/almond/system/priv-app/M_QQyinyue/路径下\r\n\r\n5. make snod 将生成文件打包到system.img中即可\r\n\r\n#### 添加带源码的应用到系统\r\n\r\n1. 未经测试,待续\r\n"}}
{"actor":{"display_login":"Huoxubeiyin"}}