惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
量子位
S
SegmentFault 最新的问题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
Recent Announcements
Recent Announcements
腾讯CDC
I
InfoQ
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
爱范儿
爱范儿

Homepage on Aditya Telange

One Year with evil-winrm-py - A Retrospective Bypassing LinkedIn's Connection Privacy with a Simple Search Filter Making Dynamic Instrumentation Accessible with Frida UI Breaking Payload Encryption in Web Applications HackTheBox (HTB) - Escape HackTheBox (HTB) - Resolute HackTheBox (HTB) - Certified State of VMWare Workstation (Pro?) on Linux Android App Security Testing Lab with MobSleuth Android phone as a Webcam on Linux Breaking down Reverse shell commands HackTheBox (HTB) - Photobomb Merging AOSP Security Patches into Custom ROMs Primer on HTTP Security Headers Image Zoom-In effect with HUGO HackTheBox (HTB) - Legacy HackTheBox (HTB) - Lame Cryptohack - Keyed Permutations [5 pts] Cryptohack - Resisting Bruteforce [10 pts] Cryptohack - RSA Starter 1 [10 pts] Cryptohack - Base64 [10 pts] Cryptohack - Bytes and Big Integers [10 pts] Cryptohack - Hex [5 pts] Cryptohack- XOR Starter [10 pts] HackTheBox (HTB) - Horizontall HackTheBox (HTB) - Forge HackTheBox (HTB) - Previse HackTheBox (HTB) - BountyHunter HackTheBox (HTB) - Explore HackTheBox (HTB) - Cap
Addition of prebuilt APK - AOSP Rom Development
[Aditya Telange](https://x.com/adityatelange) · 2020-06-14 · via Homepage on Aditya Telange

Intro

Sometimes we need to add some pre-built apk in our build because the source isn’t available or it is more easy to just pull the binaries from, and add it to our build. This post says how to do it.

Implementation

Suppose that we have our vendor as CUSTOM_VENDOR

  1. In vendor/CUSTOM_VENDOR/prebuilt/app, create a folder named MyCoolApp.

  2. In MyCoolApp folder, add the apk MyCoolApp.apk and a Android.mk

vendor/
 ├─ CUSTOM_VENDOR/
 ├─config/
 │  └─common.mk
 └─prebuilt/
    └─app/
       └─MyCoolApp/
          ├─MyCoolApp.apk
          └─Android.mk
  1. Android.mk file which contains the following instructions

Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := Testapk
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED

# LOCAL_PRIVILEGED_MODULE = true
# LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)
# LOCAL_OVERRIDES_PACKAGES := Home Launcher2  Launcher3

LOCAL_MODULE_SUFFIX :=  $(COMMON_ANDROID_PACKAGE_SUFFIX)

include $(BUILD_PREBUILT)
  1. That’s it ! Add following instruction with respected device/vendor.
PRODUCT_PACKAGES +=\
    MyCoolApp

Notes:

  1. If your APK is already not signed, use the u wat to use for signing as value for LOCAL_CERTIFICATE

    LOCAL_CERTIFICATE can have following values

    • PLATFORM or
    • PRESIGNED or
    • <KEY>
  2. If you want it as system app use LOCAL_PRIVILEGED_MODULE = true

  3. If you want your APK to end up in the /data/app/ directory, add the line

    LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)
    
  4. If you want to Override some packages, use

    LOCAL_OVERRIDES_PACKAGES := Home Launcher3 <package name>
    

References