Skip to content

Commit 345a30c

Browse files
Uldiniadhussainmohd-a
authored andcommitted
create system app build variants
1 parent a6d39d5 commit 345a30c

7 files changed

+59
-2
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,12 @@
1717
.cxx
1818
local.properties
1919
app/src/headless/assets
20+
/.knownPackages
21+
/*.patch
22+
/build-tools
23+
/emulator
24+
/licenses
25+
/patcher
26+
/platform-tools
27+
/platforms
28+
/tools

Android.bp

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
prebuilt_etc {
2+
name: "privapp_whitelist_com.celzero.bravedns",
3+
product_specific: true,
4+
sub_dir: "permissions",
5+
src: "com.celzero.bravedns.xml",
6+
filename_from_src: true,
7+
}
8+
9+
prebuilt_etc {
10+
name: "com.celzero.bravedns_whitelist",
11+
product_specific: true,
12+
sub_dir: "sysconfig",
13+
src: "com.celzero.bravedns_whitelist.xml",
14+
filename_from_src: true,
15+
}

Android.mk

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
LOCAL_PATH := $(call my-dir)
2+
3+
include $(CLEAR_VARS)
4+
5+
LOCAL_MODULE := Rethink
6+
7+
ifeq ($(TARGET_BUILD_VARIANT), userdebug)
8+
LOCAL_SRC_FILES := app/build/outputs/apk/fdroidHeadless/debug/app-fdroid-headless-debug.apk
9+
else
10+
LOCAL_SRC_FILES := app/build/outputs/apk/fdroidHeadless/release/app-fdroid-headless-release.apk
11+
endif
12+
LOCAL_CERTIFICATE := testkey
13+
LOCAL_PRODUCT_MODULE := true
14+
LOCAL_PRIVILEGED_MODULE := true
15+
LOCAL_MODULE_CLASS := APPS
16+
LOCAL_DEX_PREOPT := false
17+
LOCAL_REQUIRED_MODULES := privapp_whitelist_com.celzero.bravedns com.celzero.bravedns_whitelist
18+
include $(BUILD_PREBUILT)

app/src/main/AndroidManifest.xml

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<!-- Allows applications to change network connectivity state -->
1313
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
1414
<uses-permission android:name="android.permission.INTERNET" />
15-
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
1615
<!-- Android 11 introduces changes related to package visibility. These changes affect
1716
apps only if they target Android 11.
1817
https://developer.android.com/training/package-visibility -->
@@ -22,7 +21,6 @@
2221
<!-- Allows the app to perform actions across different users on the device. -->
2322
<uses-permission
2423
android:name="android.permission.INTERACT_ACROSS_USERS"
25-
android:protectionLevel="signature"
2624
tools:ignore="ProtectedPermissions" />
2725

2826
<!-- https://github.com/celzero/rethink-app/issues/786 set memtagMode to off -->

com.celzero.bravedns.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<permissions>
3+
<privapp-permissions package="com.celzero.bravedns">
4+
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
5+
</privapp-permissions>
6+
</permissions>

com.celzero.bravedns_whitelist.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<config>
3+
<allow-in-power-save package="com.celzero.bravedns" />
4+
<install-in-user-type package="com.celzero.bravedns">
5+
<install-in user-type="SYSTEM" />
6+
</install-in-user-type>
7+
</config>

vendorsetup.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
2+
yes | prebuilts/cmdline-tools/tools/bin/sdkmanager --licenses --sdk_root="$SCRIPT_DIR"
3+
TASK="assembleFdroidHeadless"
4+
ANDROID_HOME="$SCRIPT_DIR" JAVA_HOME=prebuilts/jdk/jdk17/linux-x86 "$SCRIPT_DIR"/gradlew -p "$SCRIPT_DIR" "$TASK"

0 commit comments

Comments
 (0)