Sunday 29 January 2017

Make App as a System App in Android

Hello Guys !! Hope you all doing well.

Today I am going to discuss how to add android app as a system app. First question, What is system App.? 

You can say , The App which came as pre-installed or as a system.img (AOSP system image as a android OS), called system App. System  app can easily access some platform(app-framework) level API call. 

As for example Camera buffer.  System App is not easily uninstalled by user, so it is a type of must have app as a android OS for a specific vendor(HTC, MOTO, Samsung).

Now how we can make an app as a system App.

  1.  Have source code
  2.  Have .apk Only

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
  •  assets, 
  • build,
  •  res, 
  • src and 
  • AndroidManifest.xml etc
Step 2  open Android.mk file and add folowing code Snippet

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional 
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
LOCAL_CERTIFICATE := platform LOCAL_SRC_FILES
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := MyTestApp
LOCAL_PROGUARD_ENABLED := disabled 
LOCAL_PRIVILEGED_MODULE := true
LOCAL_STATIC_JAVA_LIBRARIES := libarity android-support-v4  
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))
save this mk file.

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) in
PRODUCT_PACKAGES  tag at the bottom MyTestApp.
Note :-
for specific vendor you can find the path like this vendor/manufacturer/device/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.

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


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)

LOCAL_MODULE := MyTestApp

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk

LOCAL_MODULE_CLASS := APPS

LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
# if Apk is signed then use it. Otherwise use platform
LOCAL_CERTIFICATE := PRESIGNED 

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

 One more question here?
  if you have an .apk and you want to install it as a system app through command line(adb) in your phone then ???

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


adb root
adb remount
now place your apk  file in sdcard like this


adb push my-app.apk /sdcard/
adb shell
su
cd /sdcard
mv my-app.apk /system/app
# or when using Android 4.3 or higher
mv my-app.apk /system/priv-app
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 

 Thanks Guys!!!

Happy Coding...


83 comments:

  1. Can we push the .apk file in any avd/emulator. Is it the case that we don't need to have the AOSP build setup and we can do this in normal emulator with AVD Manager ? Thanks !

    ReplyDelete
  2. Yaa, We can do it by using adb install command as for example
    adb -s emulator-5554 install myapp.apk
    And in that case we don't want AOSP code base.

    ReplyDelete
  3. I just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You.
    How to make an app

    ReplyDelete
  4. This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post.
    How to make an app

    ReplyDelete
  5. Truly informative and compelling guidance allocated by you. I am glad to gain such an appreciable article here. Continue sharing and keep updating. One can learn and speak English in an effective way, just by downloading English Learning App on your own smartphone, which you can use whenever and wherever you want to practice your communication skills with experts.
    English with experts | English Speaking App

    ReplyDelete
  6. Very useful information that you have shared and it is very useful to me.Thanks for sharing the information with us.

    best mobile app development company in chennai

    ReplyDelete
  7. Thank you for sharing this information.
    bigo live pc

    ReplyDelete
  8. Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post..Interesting post! Thanks for writing it. What's wrong with this kind of post exactly? It follows your previous guideline for post length as well as clarity..
    Mobile App Development Company In Chennai
    Android App Development Company In Chennai
    Android Application Development Company In Chennai
    Mobile App Development Company In India

    ReplyDelete
  9. This kind of booklet always inspiring and i select to go online mood content material, for that excuse glad to find great region to many here in the proclaim, the writing is just on your liking, thank you for the name. App Cloner

    ReplyDelete
  10. Really it is very useful for us..... the information that you have shared is really useful for everyone. Thank You so much. I Want To Play
    Li assist
    fruity gamers

    ReplyDelete
  11. If you are looking for the best Android App Developer in Brisbane then get in touch with Stellar IT Solution which is known to develop some of the best and the finest android applications.

    ReplyDelete
  12. The depth of articles can easily be felt of this blog. Very precise and straight to the mark. I understood easily the matter of fact which the author of this blog wanted to deliver through his thoughts. Looking for more.
    Android Application Development Company

    ReplyDelete
  13. Is there any solution without rooting of our device

    ReplyDelete
  14. I read your blog it's very nice and very helpful, I learn something new in every time from this website, Thanks for sharing this information with us. i am also a blogger i guide people on App and software Development. You can visit my blog Here
    mobile app development Company in San Jose

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. I rad your blog it’s very nice and very helpful, I learn something new in every time from this website, Thanks for sharing this information with us, I am also a blogger I guide people on App and software Development, You can visit my blog Here iOS App development company

    ReplyDelete
  21. I read your blog it’s very nice and very helpful, I learn something new in every time from this website, Thanks for sharing this information with us, I am also a blogger I guide people on App and software Development, You can visit my blog Here App Cost Calculator

    ReplyDelete
  22. I read your blog it’s very nice and very helpful, I learn something new in every time from this website, Thanks for sharing this information with us, I am also a blogger I guide people on App and software Development, You can visit my blog Here Android app developers

    ReplyDelete
  23. Get custom mobile apps for Android and iOS designed and developed by our talented team of developers top mobile app development companies

    ReplyDelete
  24. hello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community. mobile app development company SLC

    ReplyDelete
  25. I really impressed after read this because of some quality work and informative thoughts . I just wanna say thanks for the writer and wish you all the best for coming!. pc software download free latest

    ReplyDelete
  26. Hi,

    Thank you for the post.
    You have written is post in 2017, Is it still possible with Android 10 and 11 to convert my app as system app? Do you have any post info how to root latest Samsung devices? Such as Samsung Tab A7 SM-T500

    ReplyDelete
  27. In this article understand the most important thing, the item will give you a keyword rich link a great useful website page: pop over to these guys

    ReplyDelete
  28. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work minitab product key generator

    ReplyDelete
  29. Thank you so much for sharing this valuable information and here I just want to introduce about App Cost Calculator which can help you determine how much it will cost to build an app and how long it will take to launch. The cost varies depending on the device, functionality, UI/UX, and many other factors that will be discussed in detail.

    ReplyDelete
  30. Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! NFT

    ReplyDelete
  31. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Sharepoint employee directory

    ReplyDelete
  32. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. rust accounts

    ReplyDelete
  33. Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing. Flutter Development Company

    ReplyDelete
  34. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
    taxi app development company

    ReplyDelete
  35. During the implementation process, you must evaluate the number of users who would actually depend on the online CRM solution and also decide whether you would want your external stakeholders such as your customers and business partners to access your hosted CRM solution. www.wellextreme.com/cloud-based-crm-software/

    ReplyDelete
  36. I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best!
    taxi dispatch software

    ReplyDelete
  37. Such sites are important because they provide a large dose of useful information ... Satta king 786

    ReplyDelete
  38. Zero in on the benefit
    The principal issue you wish to focus on though partaking in the Satta King 786 games is to procure a huge benefit. You should chase after the Satta assortment that includes a high probability of winning. Maybe then your fortunate assortment. There are different Satta games possible. Anyway if you are endeavoring to play each Satta King, you would perhaps not be prepared to dominate any match. Notwithstanding, if you participate in one Satta King 786, the potential outcomes of winning are overstated.

    ReplyDelete
  39. Thanks for sharing this useful content. AT&T Software LLC comes with an incredible team of website and mobile application developers who can customize the perfect solutions to transform your business.

    hire wordpress developer
    dedicated wordpress developer

    ReplyDelete
  40. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! android App Development Company in India

    ReplyDelete
  41. Amazing write-up! I liked the flow of the blog, it was very informative. Moreover, it made me feel like i read this blog somewhere else, which i hadn't. It was such a great share that i was able to connect to it- Thanks for this great Blog - LBM Blockchain Solutions

    ReplyDelete
  42. There are very few Best Blockchain Development Company in Mohali. Being one,LBM Blockchain Solutions makes sure you are served the best. We are the Best Blockchain Development Company in Mohali. Our company has built an inevitable reputation in the industry with years of experience.

    ReplyDelete
  43. NFT Development Services is changing the way people used to think about music, art, media, games, events, etc. You can buy or sell NFTs with cryptocurrencies. So, every NFT is indivisible and unique, which means that it cannot be copied or duplicated

    ReplyDelete
  44. This comment has been removed by the author.

    ReplyDelete
  45. Get the most recent news about blockchain and web3 industry at Dconn. Latest news about nft, blockchain, defi, digital currency and more.
    Decentralized Connect

    ReplyDelete
  46. Such a excellent blog content.Thanks for sharing this informative articles.erp software development in Chennai.


















    ReplyDelete
  47. LocalBitcoins Clone Script

    ReplyDelete
  48. Third-party logistics (or 3PL) fulfillment is the practice of handing off the task of completing retail orders to a group of professionals. Order taking, picking, packing, managing inventory, shipping, and warehousing are all included in this. You can spend more time growing your business by outsourcing fulfillment to a 3PL rather than spending as much time filling orders.
    3rd party fulfillment centers

    ReplyDelete
  49. This comment has been removed by the author.

    ReplyDelete
  50. Thanks for sharing this information with us
    Dinstar Gateway
    Please keep posting such informative blogs!

    ReplyDelete
  51. Microsoft Office 2011 Crack for Mac is unmistakable from the best and most natural applications for making and overseeing records. Understudies, instructors, benefactors, finance managers, and public laborers can rehearse this timetable to satisfy their necessities related to proving the organization. Microsoft Office 2011 Product Key

    ReplyDelete
  52. Making an app a system app in Android has its advantages, such as increased privileges and access to system-level functionalities. However, it also carries potential risks and requires careful consideration and caution. Ultimately, the decision to make an app a system app should be based on the specific needs and goals of the app and its users.

    ReplyDelete
  53. "Thank you for this article because it’s really informative, I love reading your article.Tron Token Development

    ReplyDelete
  54. This is a treasure trove of insightful articles, offering valuable knowledge

    Metaverse Development Company

    ReplyDelete
  55. This comment has been removed by the author.

    ReplyDelete
  56. Create an Crypto exchange like Binance using the Binance clone script

    ReplyDelete
  57. Thanks for sharing this kind of information. This is meant to me. Check the best mobile app development agency if you want the best mobile app solutions.

    ReplyDelete
  58. Discover the perfect NBA Top Shot Clone script tailored to your preferences with iMeta Technologies. As pioneers in NFT game development, we've successfully crafted over 10 NFT games. Our clone script mirrors all the key elements of NBA Top Shot, allowing users to buy, sell, and exchange officially licensed NBA highlights as rare NFT collectibles. Enjoy features like Multi-device Compatibility, KYC/AML Verification, Admin Panel Dashboard, Digital Wallet Integration, Profile Statistics, NFT Minting, and more.

    ReplyDelete
  59. Fantastic blog! Well done!

    Thinking about your digital store, have you ever thought about building your digital store? Join Maven Technology, as we are named the Best Mobile App Development Company in Delhi.

    Come Lets Talk Us Now : contact@maventechie.com.

    Many Thanks !!

    ReplyDelete

Build a Custom Kernel Module for Android

Hi Guys!!!Hope you are doing well !!!. Today I will describe how you can write a custom kernel module(Hello world) for Android and load it a...