android修改源码启动指定应用
来源:互联网 发布:php和mysql web开发 编辑:程序博客网 时间:2024/06/06 14:11
参考http://blog.csdn.net/mr_raptor/article/details/8006721 4. Android系统企业级定制
原理替换luncher
一、项目修改
将eclipse下编译好的项目如MyLunch2放入
/home/proud/AndroidSource/code/packages/apps下
添加Android.mk文件,可从其他项目内复制 加以修改
## Copyright (C) 2008 The Android Open Source Project## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.#LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optional#LOCAL_STATIC_JAVA_LIBRARIES := android-common android-support-v13LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)LOCAL_PACKAGE_NAME := MyLunch2LOCAL_CERTIFICATE := sharedLOCAL_PROGUARD_ENABLED := disabledLOCAL_OVERRIDES_PACKAGES := Home#LOCAL_PROGUARD_FLAG_FILES := proguard.flagsinclude $(BUILD_PACKAGE)include $(call all-makefiles-under,$(LOCAL_PATH))修改AndroidManifest.xml去掉versioncode versionname user-sdk的信息,编译的时候会有warm,源码中带的也没有
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.mylunch2" > <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.test.lunch.Main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.FS_HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> </application></manifest>
<category android:name="android.intent.category.FS_HOME" /> 这个是关键,第二步修改的,系统发出的只有该应用可接收到
二、修改frameWork
找到/home/proud/AndroidSource/code/frameworks/base/core/java/android/content
修改intent.java
@SdkConstant(SdkConstantType.INTENT_CATEGORY) public static final String CATEGORY_HOME = "android.intent.category.FS_HOME"; // public static final String CATEGORY_HOME = "android.intent.category.HOME";
修改/home/proud/AndroidSource/code/frameworks/base/api 目录下对应api的.txt和current.txt
将其中的android.intent.category.HOME换成android.intent.category.FS_HOME
field public static final java.lang.String CATEGORY_HOME = "android.intent.category.FS_HOME";
三、修改编译选项
/home/proud/AndroidSource/code/build/target/product目录下的
generic.mk文件
## Copyright (C) 2007 The Android Open Source Project## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.## This is a generic phone product that isn't specialized for a specific device.# It includes the base Android platform.$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_no_telephony.mk)$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk)# OverridesPRODUCT_BRAND := genericPRODUCT_DEVICE := genericPRODUCT_NAME := generic
引入了generic_no_telephony.mk文件
PRODUCT_PACKAGES := \ AccountAndSyncSettings \ DeskClock \ AlarmProvider \ Bluetooth \ Calculator \ Calendar \ CertInstaller \ DrmProvider \ Email \ Exchange \ Gallery2 \ LatinIME \ Launcher2 \ Music \ MusicFX \ Provision \ MyLunch2\ Phone \ QuickSearchBox \ Settings \ Sync \ SystemUI \ Updater \ CalendarProvider \ SyncProvider在文件中添加MyLunch2\
重新编译整个项目
0 0
- android修改源码启动指定应用
- 修改android 源码,启动模拟器
- android 跨应用跳转 启动其他应用指定界面
- Android源码中添加 修改应用
- Android源码中添加 修改应用
- Android源码中添加 修改应用
- Android源码中添加 修改应用
- 【Android源码学习】应用启动过程
- Android Launcher隐藏指定应用的启动图标
- adb 启动指定应用app
- android N版本启动应用白屏修改
- 源码分析Android 应用进程的启动过程
- Android源码解析之(十一)-->应用进程启动流程
- Android 6.0 应用启动全流程源码分析
- Android源码基础解析之应用进程启动流程
- Android 8.0系统源码分析--应用进程启动过程分析
- tomcat启动标题修改,指定jdk
- 修改Android启动画面
- MFC使用ADO连接SqlServer
- 值传递和引用传递的区别
- android 播放网络Flash视频 ,需要手机已安装Adobe Flash插件
- CTreeView的用法
- Linxu中命令的执行(前台、后台)
- android修改源码启动指定应用
- 页面跳转的三种方式
- 程序员的幽默笑话
- 流逝的时间
- ANDROID应用如何适配屏幕
- bash快捷操作
- 移动硬盘的文件损坏怎么处理
- 如何在Eclipse中查看JDK类库的源代码 (转载)
- [Android第三方类库]整理一下开发中常用的第三方开源类库