Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Android.mk for building the app together with the rest of the system #190

Open
SigmaBonder opened this issue Dec 8, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@SigmaBonder
Copy link

If it's maintained in the repo, it won't have to be kept up to date manually (obviously) or - what's worse - the app wouldn't have to be compiled separately.

@chenxiaolong chenxiaolong self-assigned this Dec 8, 2022
@chenxiaolong chenxiaolong added the enhancement New feature or request label Dec 8, 2022
@MuhammadZohair
Copy link

I will be working on putting this app while building my custom ROM. I will initially place the apk with permissions xml file, if it works I will change the apk to codebase and create the android.mk file.

@Gibbio
Copy link

Gibbio commented Jan 10, 2023

I just integrated BCR in my custom grapheneOS13 ROM. Starting from the release zip file you can quickly integrate the app in this way: (where ~/myandroid is the Android source folder, ~/BCR-release the unzipped BCR release file)
mkdir -p ~/myandroid/platform/external/BCR/prebuilt
cp ~/BCR-release/system/etc/permissions/privapp-permissions-com.chiller3.bcr.xml ~/myandroid/platform/external/BCR/com.chiller3.bcr_permission.xml
cp ~/BCR-release/system/priv-app/com.chiller3.bcr/app-release.apk ~/myandroid/platform/external/BCR/prebuilt/BCR.apk
create ~/myandroid/platform/external/BCR/Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := com.chiller3.bcr_permission.xml
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_TAGS := optional
LOCAL_PRODUCT_MODULE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_ETC)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := BCR
LOCAL_MODULE_CLASS := APPS
LOCAL_PRIVILEGED_MODULE := true
LOCAL_PRODUCT_MODULE := true
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := prebuilt/BCR.apk
LOCAL_OPTIONAL_USES_LIBRARIES := androidx.window.extensions androidx.window.sidecar
LOCAL_REQUIRED_MODULES := com.chiller3.bcr_permission.xml
include $(BUILD_PREBUILT)

then add BCR to the build target, for example in Android 13 you can add it in ~/myandroid/build/target/product/handheld_product.mk under PRODUCT_PACKAGES

@MuhammadZohair
Copy link

I did almost the same for my OS but the OS is now in bootloop maybe there is a permission which I am missing

@SigmaBonder
Copy link
Author

This issue is not about adding BCR's prebuilt APK to a custom AOSP build, which is simple. It's about building it with the rest of the OS. If you have troubles integrating it with your builds in prebuilt form, I would suggest to ask for help somewhere else, in order to not water down this particular issue. Thanks!

@Xeboc
Copy link

Xeboc commented Jul 9, 2023

@SigmaBonder Would you mind sharing your Android.mk file and instructions for including BCR in the build process?

@SigmaBonder
Copy link
Author

I haven't tried to do this, yet, actually. I'm not sure that building it together brings that many benefits anymore. But if you want to do this, I believe that you should look into Soong build system instead (Android.bp files). I've seen that it got better over time and it might actually be possible to do it, even though it won't be as easy as Gradle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants