重点 (Top highlight)

Android’s underlying kernel is based on Linux, but it has been customized to suit Google’s directions. There is no support for the GNU libraries and it does not have a native X Windows system. Inside the Linux kernel are found drivers for the display, camera, flash memory, keypad, WiFi and audio. The Linux kernel serves as an abstraction between the hardware and the rest of the software on the phone. It also takes care of core system services like security, memory management, process management, and the network stack.

Android的基础内核基于Linux,但已针对Google的指示进行了自定义。 不支持GNU库,它没有本机X Windows系统。 在Linux内核中可以找到显示器,相机,闪存,小键盘,WiFi和音频的驱动程序。 Linux内核是电话上的硬件和其余软件之间的抽象。 它还负责核心系统服务,例如安全性,内存管理,进程管理和网络堆栈。

Installing apps on your Android device is an absolute breeze. Just search for the app on the Play Store and click on the Install button. You can install it either as system apps or as user apps.

在您的Android设备上安装应用程序绝对是一件轻而易举的事。 只需在Play商店中搜索该应用,然后单击“安装”按钮即可。 您可以将其安装为系统应用程序或用户应用程序。

什么是系统应用程序? (What is System App?)

In simple words “The App which came as pre-installed or as a system.img (AOSP system image as an android OS), called system App. System apps can easily access some platform(app-framework) level API call”.

简而言之,“该应用是作为预安装的或作为system.img(作为Android操作系统的AOSP系统映像)提供的,称为系统App。 系统应用程序可以轻松访问某些平台(应用程序框架)级的API调用”。

System apps are pre-installed apps in the system partition with your ROM. In other words, a system app is simply an app placed under /system/app folder on an Android device.

系统应用程序是ROM在系统分区中的预安装应用程序。 换句话说,系统应用程序就是放置在Android设备上/ system / app文件夹下的应用程序。

/system/app is a read-only folder. Android device users do not have access to this partition. Hence, users cannot directly install or uninstall apps to/from it.

/ system / app是只读文件夹。 Android设备用户无权访问此分区。 因此,用户无法直接从中安装或卸载应用程序。

Apps such as camera, settings, messages, Google Play Store, etc. come pre-installed with the phone and manufacturers do not generally provide an option to remove such apps as this might impact the functioning of your device. If you want to remove a system app you need to root your device first.

手机预装了相机,设置,消息,Google Play商店等应用,制造商通常不提供删除此类应用的选项,因为这可能会影响设备的功能。 如果要删除系统应用程序,则需要先对设备进行root用户操作。

什么是非系统APP? (What is a Non-System APP?)

Non-system/third-party/User apps are apps downloaded from Google Play Store or sideloaded with an APK file.

非系统/第三方/用户应用程序是从Google Play商店下载的应用程序,或侧载有APK文件的应用程序。

A non-system app is installed under /data/app folder and has read, write privileges. If there are apps that you have installed but you no longer use, you can simply uninstall them to free up storage space.

非系统应用程序安装在/ data / app文件夹下,并且具有读取和写入权限。 如果有已安装但不再使用的应用程序,则只需卸载它们即可释放存储空间。

普通应用和系统应用之间的区别 (Difference between the normal app and system app)

  1. A System application is NOT an application that is signed by the OS’s platform signatures. This is a common mistake believed by many and we shall come to this later on. A System application is merely an application that is placed under /system/app folder in an Android device. An application can only be installed in that folder if we have access to the OS’s ROM (system.img). The application is placed under /app folder after the ROM has been extracted. A device which loads the custom ROM will have the new System application added. The benefit of a System application is that the application cannot be removed from the device (cannot be uninstalled by the user). This is only because /system/app is a read-only folder. A non-System application is an ordinary application, which will be installed under /data/app folder, and which is read-write. A user can uninstall such applications normally from the Settings application. One can check if an application is a System application or not using “ApplicationInfo.FLAG_SYSTEM”. If the constant returns true, then the application in question is a System application.

    系统应用程序不是由操作系统的平台签名签名的应用程序。 这是许多人都相信的常见错误,我们将在稍后讨论。 系统应用程序仅仅是位于Android设备中/ system / app文件夹下的应用程序 。 如果我们可以访问操作系统的ROM(system.img),则只能将应用程序安装在该文件夹中。 提取ROM后,该应用程序将放置在/ app文件夹下。 加载自定义ROM的设备将添加新的系统应用程序。 系统应用程序的好处是无法从设备中删除该应用程序(用户无法将其卸载)。 这仅是因为/ system / app是只读文件夹。 非系统应用程序是普通应用程序,它将安装在/ data / app文件夹下,并且是可读写的。 用户可以从“设置”应用程序正常卸载此类应用程序。 可以使用“ ApplicationInfo.FLAG_SYSTEM”检查应用程序是否为系统应用程序 。 如果常量返回true,则说明该应用程序是系统应用程序。

  2. Permission: System apps are granted the ability to request certain system-only permissions that are never available to user apps. This is not the same as root/sudo/su permissions. One example that I know of and use daily is the ability to reset the missed call notification counter. I have Go Dialer, which is a replacement for the stock dialer and contact app (how you make phone calls). When I miss a call, android lets me know that with a notification. However, Go Dialer is not allowed to reset this counter, even though it asks for that permission when you install the app. Android 2.2 and earlier let user apps reset it, but made this permission system-only accessible permission for android 2.3

    权限:系统应用程序被授予请求某些特定于系统的权限的能力,这些权限永远不会对用户应用程序可用。 这是一样的根/须藤/苏权限。 我知道并每天使用的一个示例是重置未接来电通知计数器的功能。 我有Go Dialer,它可以代替股票拨号器和联系人应用程序(拨打电话的方式)。 当我错过来电时,Android会通过通知告知我。 但是,即使Go Dialer在安装应用程序时要求该许可,也不允许重置该计数器。 Android 2.2及更早版本允许用户应用重置它,但为Android 2.3设置了仅系统可访问的权限

  3. Updates: System apps can be updated just like user apps, but the update is never integrated into the original rom. That is, system apps have the unique ability to roll back to the version that existed when the rom was first installed.

    更新:系统应用程序可以像用户应用程序一样进行更新,但是更新从未集成到原始rom中。 也就是说,系统应用程序具有独特的功能,可以回滚到首次安装rom时存在的版本。

  4. Moved to SD: Android lets users move user apps from internal memory to the sd card. System apps cannot be moved and always take up some internal space. Most (all?) devices, though, have internal user apps on a different partition, so uninstalling a system app would not give you any more user app space (other than the Dalvik-cache being removed).

    移至SD: Android允许用户将user应用程序从内部存储器移至SD卡。 系统应用程序无法移动,并且始终占用一些内部空间。 但是,大多数(所有?)设备在不同的分区上都具有内部用户应用程序,因此,卸载系统应用程序不会给您更多的用户应用程序空间(除了要删除的Dalvik缓存外)。

To see the complete list of user apps in android device type below command on terminal:

要查看android设备中用户应用的完整列表,请在终端上键入以下命令:

adb shell pm list packages -3

To see the complete list of installed system apps type below command on the terminal:

要查看已安装系统应用程序的完整列表,请在终端上键入以下命令:

adb shell pm list packages -s

Note: Make sure adb installed and android device connected to the computer.

注意:确保已安装adb,并且android设备已连接到计算机。

系统应用程序相对于用户应用程序的优势 (Advantages of System apps over User apps)

Google provides limited permissions on user apps. We cannot use various permissions, especially at the system level. With system apps, we can get additional permissions for our application. For example, we want to make an application that is able to install other applications (like the Google Play Store), we can get INSTALL_PACKAGES permission. We can also restart our Android device with REBOOT permissions. In addition, we can set the time on our Android system with SET_TIME permissions.

Google对用户应用程序提供了有限的权限。 我们不能使用各种权限,尤其是在系统级别。 使用系统应用程序,我们可以获得应用程序的其他权限。 例如,我们要制作一个能够安装其他应用程序的应用程序(例如Google Play商店),我们可以获得INSTALL_PACKAGES权限。 我们还可以使用REBOOT权限重新启动我们的Android设备。 此外,我们可以使用SET_TIME权限在Android系统上设置时间。

To see more lists of permissions on our Android device, please type the command below the computer terminal.

要查看我们的Android设备上的更多权限列表,请在计算机终端下方输入命令。

adb shell pm list permissions -g

如何制作系统应用程序? (How to make system apps?)

The mandatory thing to do with our application is to add android: sharedUserId = “android.uid.system” in the application tag in AndroidManifest.xml.

我们的应用程序必须执行的操作是添加android: sharedUserId =“ android.uid.system” 在AndroidManifest.xml的application标签中。

Then build the APK of our Android project that is ready. After that, just place the APK file in the directory / system / app / or for Android versions of KitKat and above, it can go to the / system / priv-app / director

然后构建我们准备好的Android项目的APK。 之后,只需将APK文件放在目录/ system / app /中,或者将Android文件安装到KitKat及更高版本中,即可将其转到/ system / priv-app / director

The first is to use a signing key. Signing key consists of 2 files, namely certificate (.pem) and private key (.pk8). The signing key here must be the same as the one used for signing our Android ROM. SO signing key is always specific to OEM’S(Samsung, Nokia etc.) And as I explained above, that system apps use permissions at the system level, so potentially people will create dangerous malware for Samsung devices. So keep it a secret for the trusted developer.

第一种是使用签名密钥。 签名密钥包含2个文件,即证书(.pem)和私钥(.pk8)。 此处的签名密钥必须与用于签署我们的Android ROM的密钥相同。 SO签名密钥始终特定于OEM'S(三星,诺基亚等)。如上所述,系统应用程序使用系统级别的权限,因此潜在的人们可能会为三星设备创建危险的恶意软件。 因此,对于可信任的开发人员来说,要保密。

But if we have our own custom ROM, or then we can actually get our Android ROM signing key. We can sign the APK we can use the method below. The signapk.jar file can be found here.

但是,如果我们有自己的自定义ROM,则实际上可以获取我们的Android ROM签名密钥。 我们可以使用以下方法对APK进行签名。 您可以在此处找到signapk.jar文件。

java -jar signapk.jar certificate.pem key.pk8 file-name.apk file-name-signed.apk

Then install the name-file-signed.apk on your Android device as usual. The Android system will automatically recognize it as system apps because it has the same signing key as the ROM and then places it in the partition / system.

然后像往常一样在您的Android设备上安装name-file-signed.apk。 Android系统会自动将其识别为系统应用程序,因为它具有与ROM相同的签名密钥,然后将其放置在分区/系统中。

There are two ways to create system apps:

有两种创建系统应用程序的方法:

  1. Have source code有源代码
  2. Have .apk Only仅具有.apk

Step 1 Create a folder inside packages/apps/ First, create a folder for your app ( Let say MyTestApp) inside packages/apps/ of your android AOSP downloaded source code. Then create a Android.mk file inside the folder(MyTestApp), and in last copy your app source code inside the folder(MyTestApp) as for example following folder and file

步骤1packages / apps /内创建一个文件夹首先,在您的android AOSP下载源代码的packages / apps /内为您的应用创建一个文件夹(假设为MyTestApp)。 然后在文件夹(MyTestApp)内创建一个Android.mk文件,最后在文件夹(MyTestApp)内复制您的应用程序源代码,例如,跟随文件夹和文件

  • assets,资产,
  • build,建立,
  • res,RES,
  • src andsrc和
  • AndroidManifest.xml etcAndroidManifest.xml等

Step 2 open Android.mk file and add folowing code Snippet

第2步打开Android.mk文件并添加以下代码段

LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optional LOCAL_UNINSTALLABLE_MODULE := trueLOCAL_MODULE_PATH := $(TARGET_OUT_APPS)LOCAL_CERTIFICATE := platform LOCAL_SRC_FILESLOCAL_SRC_FILES := $(call all-java-files-under, src)LOCAL_PACKAGE_NAME := MyTestAppLOCAL_PROGUARD_ENABLED := disabled LOCAL_PRIVILEGED_MODULE := trueLOCAL_STATIC_JAVA_LIBRARIES := libarity android-support-v4  include $(BUILD_PACKAGE)include $(call all-makefiles-under,$(LOCAL_PATH))

save this mk file.

保存此mk文件。

Step 3 put your app name in build/target/product/ folder open core.mk file from build/target/product/ folder and add your app name(MyTestApp) inPRODUCT_PACKAGES tag at the bottom MyTestApp.Note:-for the specific vendor, you can find the path like this vendor/manufacturer/device/vendor_device.mk

步骤3将您的应用程序名称放入build / target / product /文件夹中的build / target / product /文件夹中打开core.mk文件,并在MyTestApp底部的PRODUCT_PACKAGES标签中添加您的应用程序名称(MyTestApp)。注意:-对于特定的供应商,您可以找到此供应商/制造商/设备/vendor_device.mk的路径

Now step by step procedure for .apk file Step 1 will be same like above only change is that in place of src, res folder just put your .apk file.

现在,.apk文件的分 过程 第1步将与上面相同,只是更改是在src的位置,res文件夹只是放置了.apk文件。

step 2 open Android.mk file and add folowing code Snippet

第2步打开Android.mk文件并添加以下代码段

LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optionalLOCAL_UNINSTALLABLE_MODULE := trueLOCAL_MODULE_PATH := $(TARGET_OUT_APPS)LOCAL_MODULE := MyTestAppLOCAL_SRC_FILES := $(LOCAL_MODULE).apkLOCAL_MODULE_CLASS := APPSLOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)# if Apk is signed then use it. Otherwise use platformLOCAL_CERTIFICATE := PRESIGNED include $(BUILD_PREBUILT)

Step 3 will be the same as an above mention for Android source code (a)This is all about how to make an android app as a system App.

步骤3将与上述针对Android源代码的说明相同(a)这都是关于如何将android应用制作为系统应用的信息。

If you an apk file and wants to install a system app through adb commands, in that case, we have to push the .apk to the phone to the System partition. the path of the folder is /system/app or /system/priv-app (Android 4.3) using adb

如果您是一个apk文件,并且想通过adb命令安装系统应用程序,那么在这种情况下,我们必须将.apk推送到手机的“系统”分区中。 文件夹的路径是使用adb的 / system / app/ system / priv-app (Android 4.3)

adb rootadb remountadb push <file name> .apk / system / priv-app /adb shell chmod 644 / system / priv-app / <file name> .apkadb reboot

If SD card, then place your apk file in sdcard like this:

如果是SD卡,则将您的apk文件放入sdcard中,如下所示:

adb push my-app.apk /sdcard/adb shellsucd /sdcardmv my-app.apk /system/app# or when using Android 4.3 or highermv my-app.apk /system/priv-app

Note: All System-Apps need to have the permissions rw-r — r — . So we can change them via adb with the change mode command like chmod 644 /path_to/your_file

注意:所有系统应用程序都需要具有权限rw-r — r —。 因此,我们可以使用chmod 644 / path_to / your_file等更改模式命令通过adb更改它们

In this article, I have written about the system apps. I will write some more useful articles subjected to android so to know about that please keep following and clapping if you liked it.

在本文中,我写了有关系统应用程序的文章。 我将写一些适用于android的更有用的文章,以便了解这一点,如果您喜欢它,请继续关注并鼓掌。

I hope you enjoyed this session. If you have any comments or questions, please join the forum discussion below!

我希望你喜欢这次会议。 如果您有任何意见或疑问,请加入下面的论坛讨论!

To have a look for other articles, PFA link:

要查看其他文章,PFA链接:

Thanks for the support :)

感谢您的支持 :)

Android Developers, AndroidPIT.com, Xyz Zyx, Android, The Funtasty Android Devs, Sundar Pichai, Elye, Medium Staff, Cesar Valiente, Google Developers

Android开发者 , AndroidPIT.com , 的Xyz ZYX , 安卓 , 该Funtasty Android的离散事件 , 桑德尔·皮蔡 , Elye , 中等职员 , 塞萨尔巴连特 , 谷歌开发者

翻译自: https://android.jlelse.eu/system-app-in-android-f003d418b4cc


http://www.taodudu.cc/news/show-2999558.html

相关文章:

  • Android系统应用
  • 【AI全栈三】语音质量算法、评价指标 看一篇就够系列(附算法源码+干货)
  • 用了十年竟然都不对,Java、Rust、Go主流编程语言的哈希表比较
  • 为揭秘CSDN谁有100万粉丝?我连夜研发了粉丝数排行榜插件,通过 dalao 一键即可唤醒
  • 男人英文名字大全
  • 梦幻西游两个不同服务器的名字出现在跨服华山,系统会怎么处理,梦幻西游跨服决战华山测试报告【攻略达人】...
  • 这些女强人,颠覆了整个世界
  • 分享 最全的拉丁语系名字列表,详细到了字根出处,男孩们以后别再起什么Kevin, Mike, Jack了
  • [转载]你有英文名字吗?给自己起一个吧
  • 特战旅php 视频_15个特战旅精锐大比拼,新特种部队就一定差劲?咱们用实力来说话...
  • 编写一个java类,用来表示出部队中 军 师 旅 团这种树状数据结构,使上级能检索到下级,下级也能检索到上级
  • 战队口号霸气押韵8字_枪战游戏战队名字大全
  • android gradle 版本部队,gradle中统一配置版本的小技巧。
  • 推荐电影名字列表04.18
  • 如何在Linux杀死进程的名字?
  • 计算机网络战队名称大全,电竞游戏战队名字大全
  • 新导部队营房室内人员定位系统解决方案
  • 各国特种部队名称
  • 去广告插件——火狐浏览器
  • FireFox安装广告净化器或其他三方插件
  • python 拦截windows弹窗广告_win10系统怎样拦截各种软件的广告弹窗
  • 油烟净化器如何判断质量好坏?
  • armbian linux装AdGuard Home 广告拦截反追踪
  • 真赔麻了!!一个BUG和一个回帖直接赔了20万!
  • 纳米光触媒车用空气净化器给你驾车好心情!
  • 20万台空气净化机生产线商业计划书
  • 还用户一片净土:广告自动拦截功能明年登陆Chrome
  • csdn过滤广告谷歌浏览器插件
  • 谷歌浏览器--屏蔽广告插件--净化浏览界面
  • 阅读替换净化规则_安卓小说阅读器「阅读」增加净化规则,精选104个书源+各分类书源整理归类 | 樱花庄...

android中的系统应用相关推荐

  1. Java乔晓松-android中调用系统拍照功能并显示拍照的图片

    android中调用系统拍照功能并显示拍照的图片 如果你是拍照完,利用onActivityResult获取data数据,把data数据转换成Bitmap数据,这样获取到的图片,是拍照的照片的缩略图 代 ...

  2. Android中背光系统架构

    Mg Android中背光系统架构 Email:wei7758@126.com Blog:http://blog.csdn.net/yinwei520 Author:Yww Time:2011-9-2 ...

  3. Android中获取系统内存信息以及进程信息-----ActivityManager的使用(一)

    本节内容主要是讲解ActivityManager的使用,通过ActivityManager我们可以获得系统里正在运行的activities,包括 进程(Process)等.应用程序/包.服务(Serv ...

  4. Android中使用系统相机进行拍照并获取高清照片(一)

    打开系统像机功能 方式一: /*** 打开系统像机的功能* @param view*/public void startCamera(View view){Intent intent = new In ...

  5. Android中实现系统声音录制(内置声源的录制)-音频通道及framework调用流程分析

    推荐阅读 Android Audio音频系统 Android Framework学习路线

  6. Android中读取系统图库(包含相册)中的图片,显示图片与图片的路径

    最近有一个需求,是类似于手机相机的功能,拍照,多次拍照(调用系统相机只能进行一次拍照),拍照页面显示一个拍照后的缩略图,点击缩略图后进行拍过的照片的筛选(有单选和多选的问题),以及后续操作(设计相关业 ...

  7. Android中取消系统标题栏的几种方式

    一.如果是继承来自Activity的话可以采用如下方法: 1.采用代码设置 @Overrideprotected void onCreate(Bundle savedInstanceState) {s ...

  8. Android中调用系统已安装的播放器来播放网络流媒体视频

    2019独角兽企业重金招聘Python工程师标准>>> 实现思路比较简单几行代码就可以搞定,在界面放一个Button或者带有播放图标的imageview,点击事件中调用本地播放器来播 ...

  9. 如何用ADB命令删除Android中的系统应用

    因为自己在开发中,总是需要进行对系统中的应用进行删除操作才能调试,又容易忘记,所以自己把步骤叙述记录下来,为有需要的人解决问题!!! 首先要进入系统中的cmd中进行命令行操作. 命令步骤: #adb ...

最新文章

  1. 工程路径网站图片路径的问题 绝对路径
  2. 项目中AppDelegate详解
  3. Condition_number
  4. Python解决数独
  5. Github+docsify打造在线文档网站
  6. 遇到一个把.o文件strip后出现的奇怪问题
  7. Oracle 安装报错 [INS-06101] IP address of localhost could not be determined 解决方法[转]
  8. JAVA数据库连接池的工作机制
  9. iPhone苹果手机iOS14更新升级到iOS15需要多久?
  10. Excel如何实现随机不重复抽取
  11. 微信公众号程序开发接入流程
  12. chrome刷新缓存
  13. 【时空序列】使用3D卷积网络学习时空特征
  14. 插U盘之后文件夹变成exe格式如何修复
  15. 小高考三门计算机能报大专吗,江苏小高考没过能上大学吗
  16. python现在版本强势英雄_当前版本中后期强势英雄排行榜,第一名后期无敌!
  17. 179. Largest Number
  18. 常用性能工具:工欲善其事,必先利其器
  19. cse7761电能计量芯片驱动程序
  20. java文件转二进制

热门文章

  1. 【BZOJ4864】【BJWC2017】神秘物质 - Splay
  2. C++排序——奖学金
  3. 孝经白话:广要道章第十二
  4. 都柏林大学圣三一学院计算机,2021年都柏林大学圣三一学院什么专业好?这些专业你选对了吗?...
  5. Android番外篇 华为手机APP闪退重启清空Log日志问题解决
  6. A1003 Emergency
  7. 无聊的农场 - vue小游戏
  8. Matlab 基础03 - Matlab的开源数据集- 数据集列表
  9. 基于 ESO-PLL 的永磁同步电机无位置传感器控制
  10. 作为Gatekeeper,请守好交付质量关口(Quality Gate)