Skip to content
Snippets Groups Projects
Select Git revision
  • backup-stream
  • master default protected
  • AppManager-4.0.x
  • weblate
  • AppManager-3.1.x
  • smtshell-api
  • magisk
  • sqlite-editor
  • backup-restore-special
  • AppManager-3.0.x
  • self-backup
  • AppManager-2.6.x
  • routine-ops
  • font
  • clear-data-cache
  • scanner-APKiD
  • backup-separate-encryption
  • firewall
  • system-properties
  • v4.0.4
  • v4.0.3
  • v4.0.2
  • v4.0.1
  • v4.0.0
  • v4.0.0-beta02
  • v3.1.7
  • v3.1.6
  • v4.0.0-beta01
  • v3.1.5
  • v3.1.4
  • v3.1.3
  • v3.1.2
  • v4.0.0-alpha02
  • v4.0.0-alpha01
  • v3.1.1
  • v3.2.0-alpha01
  • v3.1.0
  • v3.1.0-rc03
  • v3.1.0-rc02
39 results

common.gradle

Blame
  • Muntashir Al-Islam's avatar
    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: default avatarMuntashir Al-Islam <muntashirakon@riseup.net>
    64140354
    History
    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}"
    }