Select Git revision
common.gradle
Muntashir Al-Islam authored
Background: App Manager utilises ADB to execute a command that starts a server under the user 2000 AKA Shell (or root, but it is currently disabled). The port number for the server is 6001. The purpose of the server is to maintain a connection with App Manager that is *somewhat* independent of ADB over TCP or Wireless Debugging (e.g. it is possible to disable Wireless Debugging after a connection has been made). Through the server, App Manager could call framework services as well as execute arbitrary commands. But App Manager only executes a single script that registers a service under the same user. (The same script is executed directly via the root/su shell if root mode is enabled.) Then, App Manager connects to the service via Binder which proxies framework calls that might require elevated permissions that the app does not have. (App Manager utilises the dangerous and the development permissions when it can. The relevant permissions are granted automatically when possible.) This scheme is an amalgamation of the techniques used by AppOpsX <https://github.com/8enet/AppOpsX> and libsu <https://github.com/topjohnwu/libsu >, and reused without any review. This patch addresses and fixes several issues in the server code: 1. Send status of the server to the designated app only. As a result, only the designated app may know the status of the server as well as the token used by the server for authentication. Earlier, it was possible for a third-party app to hijack the server by acquiring the authentication token by listening to the broadcast messages sent by the server. 2. Replace custom stop methods with close() by implementing the Closeable interface. This helps to identify the potential leaks during debugging. 3. Ensure that the proper code conventions are followed. Signed-off-by:Muntashir Al-Islam <muntashirakon@riseup.net>
common.gradle 564 B
// SPDX-License-Identifier: GPL-3.0-or-later
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.compileSdk
buildToolsVersion rootProject.ext.buildTools
defaultConfig {
minSdkVersion rootProject.ext.minSdk
targetSdkVersion rootProject.ext.targetSdk
}
compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation "androidx.annotation:annotation:${annotation_version}"
}