当前位置:   article > 正文

android 系统裁剪 apk_安卓系统 裁剪

安卓系统 裁剪

android 系统裁剪

有时候编译android 镜像会用到一些不需要的app 和 系统服务,我们尝试将其裁剪出去。

1.查看当前安装所有 apk
adb shell pm list packages
  • 1

在这里插入图片描述

2、裁剪

主要文件

build/target/product/*

device/**-project/object__/*

的 .mk 文件

然后选择自己不需要的apk 进行裁剪和屏蔽

在此下面有不少*.mk 文件,这一找到相应的app 进行规避修改:

diff --git a/target/product/core.mk b/target/product/core.mk
index afae7c0..7b1dae7 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -27,17 +27,12 @@ PRODUCT_PACKAGES += \
     org.simalliance.openmobileapi.xml \
     BasicDreams \
     BlockedNumberProvider \
-    BookmarkProvider \
-    Browser2 \
-    Calendar \
     CalendarProvider \
     CaptivePortalLogin \
     CertInstaller \
-    Contacts \
     DeskClock \
     DocumentsUI \
     DownloadProviderUi \
-    Email \
     ExactCalculator \
     ExternalStorageProvider \
     FusedLocation \
@@ -54,7 +49,6 @@ PRODUCT_PACKAGES += \
     PrintSpooler \
     PrintRecommendationService \
     ProxyHandler \
-    QuickSearchBox \
     Settings \
     SharedStorageBackup \
     Telecom \
diff --git a/target/product/full_base.mk b/target/product/full_base.mk
index 65bdf0f..da6eb4f 100644
--- a/target/product/full_base.mk
+++ b/target/product/full_base.mk
@@ -29,10 +29,6 @@ PRODUCT_PACKAGES := \
 
 PRODUCT_PACKAGES += \
     Galaxy4 \
-    HoloSpiralWallpaper \
-    LiveWallpapers \
-    LiveWallpapersPicker \
-    MagicSmokeWallpapers \
     NoiseField \
     PhaseBeam \
     PhotoTable
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 5c48358..4f9b27a 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -20,10 +20,6 @@
 PRODUCT_PACKAGES := \
     Bluetooth \
     BluetoothMidiService \
-    Camera2 \
-    Gallery2 \
-    Music \
-    MusicFX \
     OneTimeInitializer \
     Provision \
     SystemUI \
diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk
index fa257ae..13997ad 100644
--- a/target/product/sdk_base.mk
+++ b/target/product/sdk_base.mk
@@ -18,23 +18,16 @@ PRODUCT_PROPERTY_OVERRIDES :=
 
 PRODUCT_PACKAGES := \
 	ApiDemos \
-	CubeLiveWallpapers \
 	CustomLocale \
 	Development \
-	Dialer \
 	EmulatorSmokeTests \
 	Fallback \
-	Gallery \
 	GestureBuilder \
 	Launcher3 \
-	LegacyCamera \
 	librs_jni \
 	libwnndict \
 	libWnnEngDic \
 	libWnnJpnDic \
-	LiveWallpapersPicker \
-	Mms \
-	Music \
 	OpenWnn \
 	Protips \
 	rild \
diff --git a/target/product/telephony.mk b/target/product/telephony.mk
index e840ba1..5c05fa1 100644
--- a/target/product/telephony.mk
+++ b/target/product/telephony.mk
@@ -19,7 +19,6 @@
 
 PRODUCT_PACKAGES := \
     CarrierConfig \
-    Dialer \
     CallLogBackup \
     CellBroadcastReceiver \
     EmergencyInfo \
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100

对于一些服务 可以修改 frameworks/base/services/java/com/android/server/SystemServer.java

将里面的相关的 systemserver.java 去掉。

例如:


            mContentResolver = context.getContentResolver();

//            Slog.i(TAG, "Camera Service");
            // mSystemServiceManager.startService(CameraService.class);

          
            traceBeginAndSlog("StartAccountManagerService");
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/174200
推荐阅读
相关标签
  

闽ICP备14008679号