Giter Site home page Giter Site logo

muntashirakon / appmanager Goto Github PK

View Code? Open in Web Editor NEW
4.5K 92.0 263.0 73.84 MB

A full-featured package manager and viewer for Android

Home Page: https://muntashirakon.github.io/AppManager/

License: Other

Java 98.97% HTML 0.01% Shell 0.10% PHP 0.62% AIDL 0.10% CMake 0.02% C++ 0.19%
material-design package-manager android apks adb

appmanager's Introduction

App Manager Logo

App Manager

Docs · Releases · Telegram Channel


Features

General features

  • Fully reproducible, copylefted libre software (GPLv3+)
  • Material 3 with dynamic colours
  • Displays as much information as possible in the main page
  • Lists activities, broadcast receivers, services, providers, app ops, permissions, signatures, shared libraries, etc. of an application
  • Launch activities and services
  • Create shortcuts of activities
  • Intercept activities
  • Scan for trackers and libraries in apps and list (all or only) tracking classes (and their code dump)
  • View/save the manifest of an app
  • Display app usage, data usage (mobile and Wi-Fi), and app storage info (requires “Usage Access” permission)
  • Install/uninstall APK files (including APKS, APKM and XAPK with OBB files)
  • Share APK files
  • Back up/restore APK files
  • Batch operations
  • Single-click operations
  • Logcat viewer, manager and exporter
  • Profiles (including presets for quick debloating)
  • Open an app in Aurora Store or in your favourite F-Droid client directly from App Manager
  • Sign APK files with custom signatures before installing
  • Backup encryption: OpenPGP via OpenKeychain, RSA, ECC (hybrid encryption with AES) and AES.
  • Track foreground UI components

Root/ADB-only features

  • Revoke runtime (AKA dangerous) and development permissions
  • Change the mode of an app op
  • Display/kill/force-stop running apps or processes
  • Clear app data or app cache
  • View/change net policy
  • Control battery optimization

Root-only features

  • Block any activities, broadcast receivers, services, or providers of an app with native import/export as well as Watt and Blocker import support
  • View/edit/delete shared preferences of any app
  • Back up/restore apps with data, rules and extras (such as permissions, battery optimization, SSAID, etc.)
  • View system configurations including blacklisted or whitelisted apps, permissions, etc.
  • View/change SSAID

…and many more! This single app combines the features of 5 or 6 apps any tech-savvy person needs!

Upcoming features

  • APK editing
  • Code editor
  • Routine operations
  • Finder: Find app components, permissions etc. in all apps
  • Enable/disable app actions such as launch on boot
  • Panic responder for Ripple
  • Crash monitor
  • Systemless disabling/uninstalling of the system apps
  • Import app list exported by App Manager
  • More advance terminal emulator
  • File manager
  • Database viewer and editor, etc.

Get it on F-Droid

Translations

Help translate the app strings and the docs at Hosted Weblate.

Translation status

Mirrors

GitLab · Riseup · Codeberg

Screenshots

Build Instructions

See BUILDING.rst

Contributing

See CONTRIBUTING.rst

Donation and Funding

As of September 2024, App Manager is not accepting any financial support until further notice. But you may still be able to send gifts (e.g., gift cards, subscriptions, food and drink, flowers, or even cash). Please contact the maintainer at muntashirakon [at] riseup [dot] net for further assistance.

Credits and Libraries

A list of credits and libraries are available in the About section of the app.

appmanager's People

Contributors

andarwinux avatar artemmolotov avatar atrate avatar chr56 avatar comradekingu avatar gnuhead-chieb avatar heartpulsation avatar ioty avatar jason5545 avatar kovalevartem avatar laralem avatar lisapple avatar majeurandroid avatar mapi68 avatar mathu-lmn avatar muntashirakon avatar nathanbnm avatar ngocanhtve avatar oersen avatar omoma avatar pringless avatar rehork avatar rex07 avatar rickym7 avatar sam-oak avatar santossi avatar sr093906 avatar tommynok avatar unbiaseduser-github avatar weblate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appmanager's Issues

[UI Bug] Refreshing app details causes toolbar to replicate

Description:
Going into an app's info screen and pulling down to refresh causes the toolbar (with options like "uninstall" or "manifest") to duplicate (and further replicate) itself.

Steps to reproduce:

  • Open AppManager
  • Go into an app's info
  • Pull down to refresh
  • The toolbar now multiplicated and can be scrolled

App version:
v2.4.3

Data Usage Not Showing Any Data

Phone Huawei Honor 8S
Android OS EMUI 9.1.0
Rooted - no
Usage Information Access permission given to Application Manager
Application version used 2.5.1 from Izzys Fdroid repo.
Booted phone up and used data on Google Play Store, Fdroid and Star Trek Fleet Commander.

If I check any app for data usage they all show 0mb data used since boot.

Logcat viewer

A properly formatted logcat viewer is very helpful in debugging applications and a must have feature of an app manager.

Add Disabler like features

Whilst i find it easy enough to just scan an app, find its trackers and go block them myself, all using App Manager...
I suppose its a nice feature to have, whilst I use 99% opensource apps (only a few components to disable) some people do not and may have lots.
Even for me, some apps I cannot avoid, I use Discord & Instagram for gaming, both have no open source Android clients, so I block using App Manager, then I have them disabled when not in use (automatically by 'Disabler' from F-Droid).
As this is about batch "component" disabling, could the app possibly do batch "app" disabling too? (just like 'Disabler' can), obviously we can already disable, but the ability to make a list to quickly freeze/ unfreeze would be great (and the ONLY reason I use Disabler still) also Disabler allows to add tabs (that act as different lists) so I have one tab with all Google apps in, they are ALL disabled at all times and I only unfreeze if I need to buy something from them (which is rare), I have a second tab for social media (Discord, Insta, Facebook, Twitter) always disabled unless I am using them (have them open) and that keeps all the bloat on my phone handled properly (1. Block components in App Manager. 2. Disable anything that doesnt need to be running in Disabler.)
I never made a new issue as this issue could be possibly labled something like "batch disabling" (apps & components). Thank you!
(P.S yes, what you have prosed this far sounds great!)

Originally posted by @5c0tt-b0t in #35 (comment)

Rules are not applied?

Im trying to patch an app but it tells me rules are not applied. It doesnt apply after clicking the update button.
Thanks

Application Manager Showing Incorrect Data for Usage Times

Phone Huawei Honor 8S
Android OS EMUI 9.1.0
Rooted - no
Usage Information Access permission given to Application Manager
Application version used 2.5.1 from Izzys Fdroid repo.

Please see screenshot for what Application Manager states is my usage time for applications over 1 day, a week and 1 month. The monthly one is showing - 11 days usage!

Screenshot_20200621_181057_io github muntashirakon AppManager
Screenshot_20200621_181104_io github muntashirakon AppManager
Screenshot_20200621_181049_io github muntashirakon AppManager

Uninstalled apps config remover

Could you add a button that cleans the remaining configs of uninstalled apps in the root/data/data/this.app.trash directory?
This is great for storage saving, e.g after uninstalling firefox with 50 extentions.

Support External Apk

View information about compressed apk files that are not installed.

  • AppInfo
  • Manifest viewer
  • Exodus

One click Ads and tracker Removal

Id love to see a feature that allows you to disable all ad and tracking pms with the click of a button. This could work together with Exodus and Ad Away.
Thanks!

Ability to use any file explorer to explore files

Phone Huawei Honor 8S
Android OS EMUI 9.1.0
Rooted - no
Usage Information Access permission given to Application Manager
Application version used 2.5.1 from Izzys Fdroid repo.

I can only use MiXplorer and Solid Explorer to access folders and files from this app. I would like the opportunity to use the one I use the most - File Explorer.

Screenshot_20200621_182709_com huawei android internal app

Also what does the Large Heap mean when I check your app?

Rebuild APKs

While I believe that #2, #3 and #4 are in line with this project's direction, this issue might not be.

An interesting (and hard and time consuming to implement) feature I couldn't find in any FOSS app so far is APK rebuilding.

By that I mean disassembling the application, modifying the manifest file and some classes, then recompiling and signing with a new key, similar to what apps like Lucky Patcher or Jasi Patcher do.

This would allow for a very deeply-rooted removal of advertising receivers and services or unneeded permissions, instead of simply disabling them.

This would also allow for the removal of permissions that can't be disabled, e.g. android.permission.INTERNET.

Curiously, this does not require root access at all.

[Feature] Freeze user and system apps

(Dependent on #2)

Yet another feature that could be considered useful would be the ability to freeze (disable) user and system apps from the app's interface.

Rationale: not all system apps can be frozen (disabled) from the Android app info and no user apps can.

Language Switching

So the German translation is quite broken since 2/3 of the words arent translated - please add a language switcher that I can use the English one.
;)

LTE Cleaner like features

It can clean app data folder and many junk files. Don't want to install too many app in my phone. 😉

UI Design Issue: Merging App Info with App Details

I am currently thinking of merging App Info and App Details into a single window where app info will be the first tab along with the already existing tabs (components, permissions, app ops, etc.). This will free the long click option on the main window which can be fully utilised for multiple selection aka batch operation.

App Ops tab is empty on some devices

Hi, thank you once again for this amazing app! truly appreciated!
What happened:
Just tried to setup app ops, but I cannot see any values.
What I tried:
Although I have root, and given root to app manager, I tried manually granting perms: pm grant io.github.muntashirakon.AppManager android.permission.GET_APP_OPS_STATS.
Result:

Security exception: Package io.github.muntashirakon.AppManager has not requested permission android.permission.GET_APP_OPS_STATS

java.lang.SecurityException: Package io.github.muntashirakon.AppManager has not requested permission android.permission.GET_APP_OPS_STATS
        at com.android.server.pm.permission.BasePermission.enforceDeclaredUsedAndRuntimeOrDevelopment(BasePermission.java:379)
        at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1448)
        at com.android.server.pm.permission.PermissionManagerService.access$900(PermissionManagerService.java:91)
        at com.android.server.pm.permission.PermissionManagerService$PermissionManagerInternalImpl.grantRuntimePermission(PermissionManagerService.java:2145)
        at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:6000)
        at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1735)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:222)
        at android.os.ShellCommand.exec(ShellCommand.java:103)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22574)
        at android.os.Binder.shellCommand(Binder.java:655)
        at android.os.Binder.onTransact(Binder.java:553)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2836)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4303)
        at android.os.Binder.execTransact(Binder.java:752)

Device:
OnePlus 5T, Oxygen OS (Android 9/Pie), rooted (Magisk), selinux permissive.

Thank you.

Include A Terminal Emulator

Including a Terminal Emulator would be very useful even if you haven't got root.

My Huawei phone will not even allow me to check the build.prop from within the system folder as they have encrypted it but I can view it by running the script for it.

This also give you the possibility for logcat viewing, netstat etc.

Add Support for Split Apk

App Manager currently allows installing apk files. It should also allow installing split apk. Common non-proprietary extensions for bundled apk include .apks and .xapk (as opposed to .apkm). Both are zip files but with different meta data. Fortunately, SAI supports all of them. The users should be able to choose which parts of the bundle they want to install like SAI or ApkMirror Installer. Users should also be able to export these apk (via apk sharing or backup apk options) as .apks or .xapk (exclusive).

Milestones:

  • v2.5.11: .apks export/sharing support
  • v2.5.13: .apks install support
  • v2.5.14: Additional features: choosing which components to install

[FEATURE REQUEST] Keep the search active

Some trackers are well known and are in almost all applications such as Google (Analytics, Firebase). So this is a basic search that I think almost everyone who uses this application does.

My suggestion to make it easier is to keep the search as you navigate between Activities, Services, Receivers and Providers. Currently, it is reset when we change tabs.

There is already a button to clear the search bar (the "X"), so my suggestion won't be something that will hinder the application's usability or something similar.

Screenshot_20200622-111810__01

Batch Operations in Main Window

Although it is an App Manager not Apps Manager, certain batch operations are very handy. This issue will list all batch operations that App Manager should include. Users are welcome to discuss and request their own ideas. (Operations that doesn't require root will be tagged as no-root)

  • (v2.5.6) Revoke RUN_IN_BACKGROUND permission (operation) (similar to ADBungFu)
  • (v2.5.6) Clear data
  • (v2.5.6) Disable
  • (v2.5.6) Kill
  • (v2.5.6) Uninstall
  • (v2.5.8) Export configurations (related to #24)
  • (v2.5.9) Disable tracker components
  • (v2.5.11) App backup (no-root)
  • App data backup/restore (Moved to #30)

Apps filtering: (v2.5.10)

  • Disabled apps
  • User apps
  • Apps with blocked components

Exodus report link

After AppManager searches the Exodus report, the screen with the results is displayed but it does not show the direct link to their site. This could be added.
For me it is useful because I can share this link with other people (which is better than taking a screenshot)

App Usage Features

Feature check list:

  • (v2.5.4) Add data usage (mobile+wifi) for each app (API 23 or later)
  • (v2.5.4) Add app open count (aka times opened) for each app
  • (v2.5.4) Sorting applications in terms of screen time, data usage, times opened, app label, last foreground time, notifications received
  • (v2.5.5) Display app usage details for each app on click (open in new dialog or activity)
  • (Abandoned) Investigate the probability of adding a bar/pie chart displaying usage frequency/higest used apps: It appears that other than a fancy display (which is beyond the scope of this project), these charts do not appear to provide any useful information whatsoever
  • (Abandoned) Add notification count for each app: It's inefficient for an user app to keep track of notifications as a service have to be constantly running in the background in order to count nofications which can take its toll on battery

Following features may not be best for this app, but was still considered:

  • App timer
  • App lock
  • Invoke Do Not Disturb (DND) mode for a certain interval

Add an app-launch button

Its a bit annoying that I have to switch between app_manager and my launcher all time after patching, could you add a launch button next to the disable button or sth?

[Feature] Root actions

It would be nice if the application allowed performing actions requiring root, such as uninstalling system apps.

Crashes when selecting App Usage in menu

Hello,

When clicking on the three dots menu on the top right and selecting "App Usage", Appmanager immediately closes. It happens with or without the permission needed.

Here is a log I found just before force-crash :

06-10 00:25:00.924 I/am_crash(1345): [15612,0,io.github.muntashirakon.AppManager,815283780,java.lang.NoSuchMethodError,No virtual method unsafeCheckOpNoThrow(Ljava/lang/String;ILjava/lang/String;)I in class Landroid/app/AppOpsManager; or its super classes (declaration of 'android.app.AppOpsManager' appears in /system/framework/framework.jar),AppUsageActivity.java,184]

I'm on LineageOS without GApps, using fresh installed fdroid version.

Thank you for your work, it's cool to have everything in one place with a cool design!

Import/Export blocking rules with compatibility

Blocking application trackers is not easy at all and losing that work when you change your ROM or cell phone makes all that work lost. An option to export the rules of each application or all at once would solve that.

For those who are using other applications to do this blocking, like Watt or Blocker, an option to import the list of rules that these applications generate would be something very nice too. It would also make it easier to migrate to your application that seems to be much better than the others.

This is a list of rules exported from Blocker

{
  "author": "Blocker",
  "components": [
    {
      "method": "IFW",
      "name": "com.google.android.gms.analytics.AnalyticsReceiver",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.GcmBroadcastReceiver",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.NotificationOpenedReceiver",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.UpgradeReceiver",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    },
    {
      "method": "IFW",
      "name": "com.yandex.metrica.MetricaEventHandler",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    },
    {
      "method": "PM",
      "name": "androidx.work.impl.background.systemalarm.RescheduleReceiver",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    },
    {
      "method": "IFW",
      "name": "com.facebook.CurrentAccessTokenExpirationBroadcastReceiver",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    },
    {
      "method": "IFW",
      "name": "com.google.android.gms.analytics.AnalyticsService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.google.android.gms.analytics.AnalyticsJobService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.GcmIntentService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.GcmIntentJobService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.RestoreJobService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.RestoreKickoffJobService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.SyncService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.SyncJobService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.NotificationRestoreService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.yandex.metrica.MetricaService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.yandex.metrica.ConfigurationService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.yandex.metrica.ConfigurationJobService",
      "packageName": "me.mustapp.android",
      "type": "SERVICE"
    },
    {
      "method": "IFW",
      "name": "com.facebook.FacebookActivity",
      "packageName": "me.mustapp.android",
      "type": "ACTIVITY"
    },
    {
      "method": "IFW",
      "name": "com.onesignal.PermissionsActivity",
      "packageName": "me.mustapp.android",
      "type": "ACTIVITY"
    },
    {
      "method": "IFW",
      "name": "com.twitter.sdk.android.core.identity.OAuthActivity",
      "packageName": "me.mustapp.android",
      "type": "ACTIVITY"
    },
    {
      "method": "IFW",
      "name": "com.google.android.gms.auth.api.signin.internal.SignInHubActivity",
      "packageName": "me.mustapp.android",
      "type": "ACTIVITY"
    },
    {
      "method": "IFW",
      "name": "com.google.android.gms.common.api.GoogleApiActivity",
      "packageName": "me.mustapp.android",
      "type": "ACTIVITY"
    },
    {
      "method": "PM",
      "name": "com.crashlytics.android.CrashlyticsInitProvider",
      "packageName": "me.mustapp.android",
      "type": "RECEIVER"
    }
  ],
  "description": "Generated by Blocker",
  "packageName": "me.mustapp.android",
  "versionCode": 10723,
  "versionName": "1.7"
}

Topic: AppOps

This article will move to wiki once I implement this (provided I can).

It seems there are alternative methods other than using hidden (now restricted) API to disable Op (unfortunately, there's no documentation in English whatsoever). This article is probably the only article I've found that addressed this. However, the image from this article (displayed below) nicely describes how AppOps works:

How AppOps Works

An interpretation of the above image is available in the section 2.4.5 of this article. This article also talked indepth about overall permissions in Android and how it's going to merge with AppOps.

Anyway, instead of using the hidden API most of whose functionality are restricted now and is going to be more restricted in future, /data/system/appops.xml can be utilized (this, of course, requires root). This xml file is used as a persistent storage for AppOps and the interface is given by com.android.server.appop.AppOpsService. Looking at the source code, I found that there are two ways an Op can be blocked/unblocked:

  1. Using appops command line tool: This is probably the easiest method but may have some compatibility issues with older API (need to investigate to make sure). Runing this tool without any argument displays a manual on how to use the tool. Alternatively, the help is also available in the source code linked above (in com.android.server.appop.AppOpsService#dumpCommandHelp(PrintWriter)).
  2. Creating a appops.xml parser and writer: This is a bit complicated method since this xml file is very sensitive (any wrong value/corruption may result in bootloop) and is best avoided. However, proper testing and following best practises might solve the above issue (also copying the parser from the Android source might solve this issue as well). This method is best in the sense that parsing the output of a shell command is not always a viable approach.

Add option to disable kill feature for system apps

Hi,
Im scared to enter the app kill window cause I dont wanna accidently kill system apps, I need the root features though... Please add a setting for this!
Thanks
(Also Thanks for the great app! <3)

App Data Backup/Restore

App data backup and restore itself is not a difficult task but it is difficult to do it in a proper way. In this issue, I shall describe how App Manager is going to handle app backups.

Backup Format

All data is backed up using the standard linux shell commands and is stored as tarball individually based on their directory types. Then the tarball will be compressed with one of the compression methods (gzip for greater compatibility, bz2 might be considered in future). The advantage of this method is that the size of the compressed file will be little to largely less than the size of a zip file and more importantly, the permissions will be kept as is.

Metadata

It is important to preserve some metadata in order to display user information about the package as well as for signature verification and to decide which folder goes to where during the restore process. Every metadata is a key-value pair and is stored as a single json file.

Metadata Keys

  1. label: (String) App Label
  2. package_name: (String) Name of the package
  3. version_name: (String) Version name of the package being stored
  4. version_code: (long) Version code of the package being stored
  5. source_dir: (String) Source directory
  6. data_dirs: (String[]) Data directories
  7. is_system: (boolean) Whether the app is a system app
  8. is_split_apk: (boolean) Whether the app consists of multiple apks
  9. split_names: (String[]) Name of each split
  10. split_sources: (String[]) Source of each split (same order as above)
  11. has_rules: (boolean) Whether there is a rules file for this app to apply after restoring the backup
  12. backup_time: (long) Backup time of the package being stored
  13. cert_sha256_checksum: (String[]) SHA-256 checksum of the signing certificate
  14. source_dir_sha256_checksum: (String) SHA-256 checksum of the compressed source file
  15. data_dirs_sha256_checksum: (String[]) SHA-256 checksum of the compressed data file (same order as data_dirs)
  16. mode: (int) Backup mode
    • 0 - Unencrypted backup
    • 1 - PGP encrypted backup
  17. version: (int) Metadata version (preserved for future, current value is 1)
  18. apk_name: (String) Name of the apk (usually base.apk)
  19. instruction_set: (String) Name of the instruction set (architecture) where the backup is made (e.g. arm64, x86_64, etc.)
  20. flags: (Integer) Backup flags
    • 0 - Do nothing (nothing is backed up/nothing to be restored)
    • 1 << 0 - Backup up source files
    • 1 << 1 - Backup data directories (/data/user and /data/user_de)
    • 1 << 2 - Backup external data directories (e.g., /sdcard/Android/data)
    • 1 << 3 - Exclude cache (from all data directories)
    • 1 << 4 - Backup rules (blocking rules)
    • 1 << 5 - Skip signature verifications (applicable only for restore operation)
    • 1 << 6 - Backup only apk files (instead of the whole source). See #64
    • 1 << 7 - Backup obb and media files (e.g., /sdcard/Android/obb, /sdcard/Android/media). See #65
    • 1 << 8 - Enable multiple backups (the backup will result in a new backup separate from the base backup)
    • 1 << 9 - Enable backups for all users
  21. user_handle: (Integer) The user (internally known as user handle) to whom the backup belong to. Additional options are only available in the App Info tab
  22. tar_type: (String) Compression method: z for GZip and j for BZip2
  23. key_store: (boolean) Whether the app uses Android KeyStore

Storage

Backup data is stored at the user's preferred location (in future) or at /sdcard/AppManager. Each package has its own dedicated folder named after its package name. The folder structure for each package is given below:

.
|-- package.name
|   |-- 0
|   |   |-- data0.tar.gz  (data dir at zeroth index)
|   |   |-- source0.tar.gz (source dir at zeroth index)
|   |   |-- keystore.tar.gz (optional KeyStore files)
|   |   |-- rules.am.tsv (optional rules file to be applied after restoring the app)
|   |   |-- perms.am.tsv (permissions)
|   |   `-- meta.am.v1
|   `-- 10
|       |-- data0.tar.bz2
|       |-- source0.tar.bz2
|       |-- rules.am.tsv
|       |-- perms.am.tsv
|       `- meta.am.v1
|-- another.package

Backup Process

Backup Process involves creation of the metadata based on user's preferences (described in the design section below). This metadata is then used to backup files. It is probably important to distinguish between system applications as the sources directory for these apps can be /system/app or /system/priv-app in which case typical restoring process may not work as expected. For sources directories, the whole source directory is backed up instead of just apk files. This is helpful for people who use patched odex file, for example. Split apks have a bunch of apk files which requires special attentions (and possibly, workarounds).

Restoring

Restoring is performed only after the verification of the file contents as well as signature verification (if the app is currently installed). In future, the sensitive information such as checksums will be encrypted using the encryption key. Restore process is a bit complicated than the backup process due to several factors mostly involving source files. First of all, it is essential to install/update or even reinstall an app based on the current state of the application: 1) If the app in not installed, it has to be installed first, 2) If it is already installed and the installed version is less than or equal to the app version to be restored, it can be simply updated, 3) Otherwise, the app has to be uninstalled (without deleting data if only apk restore is requested) and then installed again. After applying any one of these operations (the app should be forced closed), the source file has to be directly restored to source directory and data files to data directories. At the same time, pm or cmd package install can easily be utilised for split apks.

UI Design

Backup/restore feature is part of batch ops as well as available individually in the App Info tab. Apps with existing backups have a backup sign at the bottom of their app icon in the Main window as well as the version info. In case of batch ops, a menu item called backup/restore data is added which if clicked opens a new alert dialog consisting of a multichoice list consisting of apk, data, external data, exclude cache and blocking rules (all but external data is enabled by default), and three actions: backup (positive), restore (negative), delete backup (neutral). In case of App Info tab, a single backup/restore option is added in the menu which opens an alert dialog similar to the former. A tag is also displayed in this tab describing the backup app version.

Multiple user support (#70)

App Manager currently doesn't support multiple user. If devices have multiple users, it will simply fail to restore (#69). Support for multiple user will be added in future.

How multiple user support works (out of order)

Currently, only user 0 is supported (it is also hard coded, unfortunately), and the backups are stored at /AppManager/package.name/ as explained above. The idea is that data from other users will be saved in the same way as described but in another directory whose name is the user id. An optional boolean parameter user_handle will be added in the meta file to identify it. At the same time, a flag Multiple users will be added (disabled by default) in the backup/restore dialog (if multiple users are available) so that user can choose to backup/restore data for multiple users.

Limitations & workarounds

In case, the user id doesn't match, the restore process will fail. To solve this issue, an option could be added in settings so that user can choose the replacement for the user. But this is only for Android phones with more than 2 profiles. If there are only two profiles and backup data are also available for two profiles, then the unmatched profile will be automatically marked as matched and data will be restored for that particular user. This is useful for devices with work profile, for example.

Multiple backup support (#87)

This implementation is similar to above except that the folders will begin with non-digit letter/symbols to distinguish between the two. If user chooses to do multiple backup via batch operation, they will be offered to pick a name for the backups (all packages have the same name inside their respective directory). If the name begins with a digit (despite the warning), an underscore will be added as a prefix and/or if the name already exists, a number will be added at the end. Unlike the current behaviour (which is still experimental), each package have folders inside them where the backups will be kept. The 0 folder will be used to keep the backups of the user 0 (this is decided from the current user handle), for example. However, when restoring backups via batch operations, only backups from the user 0 will be restored. In routine operation, user can choose which backups to restore by specifying a name in the backup profile (if the named backup doesn't exist, the restoring will be ignored for that package). Other backups can only be restored from the respective App Info tab.

Misc

Handling large backup files (#60)

FAT32 partition has 4GB file size limit which is a problem for apps with large chunks of data. Although it is highly unlikely for a single app to have such an huge amount of storage, it cannot be ignored. Besides, having a max archive size limit increases portability as a user might be interested in transferring files to computer, cloud or even to different device as part of upgrading or migrating. To achieve that, each archive can be at most 1GB in size. Since we're using tarball, it can be done liek this:

tar -czf - directory/to/backup | split -b 1G - directory/with/backup/prefix.

Extracting this tar is easy:

cat /directory/with/backup/prefix* | tar -xzf - -C /

Since we're already using .tar.gz, during restore, the * will fall back to nothing.

Checksum will be the combination of all of these files.

Platform dependency

Since the whole source directory is being backed up, the app restoration process is largely platform dependent if not handled properly. As stated in #58, oat, lib and lib-32 are largely platform dependant (doesn't matter if the app is bundled or not). Hence, if the platform of the backup doesn't match the current platform, only the app will be restored instead of the entire source directory. To circumvent this problem, two more keys (namely instruction_set and apk_name) are added (see Metadata keys section above for description).

Encryption

Encryption support will be added shortly. Since the backup data are stored in the external directory, it's not secure to store sensitive files without encryption. Therefore, once support for encryption is added, unencrypted backup option will be removed (unencrypted backups can still be restored). Support for encryption may include OpenKeychain (the most secure option), RSA-4096) and AES-256. Passwords have to be set for the latter encryption methods and will not be remembered by App Manager (but will be remembered for a single session ie. as long as the app isn't destroyed if the user chooses to do so).

Data Integrity (fixed)

It is essential to preserve data integrity. When an app backup is requested, the existing backup is deleted before the new backup takes place which is directly written to the same directory. If the new backup fails, there is no way to recover the old backups. The alternative way would be to write backups to a separate directory first and after the new backup is complete, replace the old backup with the new one. This could be done in many ways but an efficient way would be to write the new backups inside the backup directory (for an app package.name the new backup directory is /sdcard/AppManager/package.name~) and upon completion delete the old backup and rename the new directory (ie. mv /sdcard/AppManager/package.name{~,}). This way old backup will not be lost if the new backup fails. Another similar but quite fatal issue occurs when restoring fails as there's no way to recover the original data if this happens. Sadly, there's no easy way to solve it (I can take backup of the current app and its data but it might result in an infinite loop is it fails continuously).

Scheduling (part of #61)

Backup scheduling is considered an important option by many and will be added in a future release.

Split apk support (related to #49)

Support for split apk is added in 5f190a4.

App crashing after restore

Due to several reasons, an app may crash such as:

  • If the app is newly installed, uid and guid have to be set properly (fixed in eea79a8 and 38b3747)
  • For older platforms, permissions may need to restore despite the fact that permissions are preserved within a tar file (fixed in 3faff88)
  • If the app uses Android KeyStore, special care is needed (see #82)

Compression methods

gzip and bz2 (xz isn't supported by toybox and therefore won't be added).

Android Lollipop (API < 23) support

Since toybox is introduced in API 23, tar command is not available before API 23 and needs additional support. A possible solution is to ask users to install busybox tools at preferable location. App Manager is going to supply toybox within App Manager (see #84).

App crashes in details page of any app.

App crahses when opening other tabs like Activities, services, recievers in details page of any app.

Device : Mi A3 (Android one)
Android version: 10

Same behaviour on Nokia 6.1 plus (Android one)

Expected behaviour:
Details about activities, services, recievers when tab is switched in app details page.

Actual behaviour:
App crashes as soon as tab is switched.

Awesome app!

Hightlight trackers

AppManager highlights some permissions according to your flag (dangerous, normal, signature, etc.) this is useful and serves as an alert. Due to its usefulness, I think this highlight could also be added in other tabs.

Since trackers are identified by their names (com.facebook.share, com.google.firebase.analytics, ...) then it would be possible to do this. Those that are on the exodus list would be highlighted so that the user can turn it off more easily without having to search for each tracker individually.

what do you think?

[Feature] Enable/disable application components

This is dependent on issue #2

A useful and sensible feature to be added would be to allow the user to disable specific app components (services, broadcast receivers, activities and content providers).

This could be used to e.g. disable Google Analytics or Measurement services.

This would be similar to what MyAndroidTools has:
https://www.myandroidtools.com/

MAT has a very nice UI/UX for that: it allows the user to see a list of the receivers of all installed apps, filter them by name and batch disable.

Ability to link up with APK Updater or have it integrated in Application Manager

You've managed to include all my favourite applications into one so very much appreciate that. Well done.

What are the chances of integrating APK Updater into your app or link to it? Being able to update apks from within your app would make this app perfect. Even just seeing that there is an update available via APK Updater would be ideal.

App icon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.