android 源码启动程序,android修改源码启动指定应用

参考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-v13

LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)

LOCAL_PACKAGE_NAME := MyLunch2

LOCAL_CERTIFICATE := shared

LOCAL_PROGUARD_ENABLED := disabled

LOCAL_OVERRIDES_PACKAGES := Home

#LOCAL_PROGUARD_FLAG_FILES := proguard.flags

include $(BUILD_PACKAGE)

include $(call all-makefiles-under,$(LOCAL_PATH))修改AndroidManifest.xml去掉versioncode versionname user-sdk的信息,编译的时候会有warm,源码中带的也没有

package="com.example.mylunch2"

>

android:allowBackup="true"

android:icon="@drawable/ic_launcher"

android:label="@string/app_name"

android:theme="@style/AppTheme" >

 这个是关键,第二步修改的,系统发出的只有该应用可接收到

二、修改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)

# Overrides

PRODUCT_BRAND := generic

PRODUCT_DEVICE := generic

PRODUCT_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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值