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

[Idea] Rework app "log" files #71

Closed
Tiefkuehlpizze opened this issue Jul 13, 2020 · 0 comments
Closed

[Idea] Rework app "log" files #71

Tiefkuehlpizze opened this issue Jul 13, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Tiefkuehlpizze
Copy link

Tiefkuehlpizze commented Jul 13, 2020

One thing, that bothered me for a while is the structure and information in the "log" files of the backups.

Let's start with the simplest thing: The name. It's not a log in terms of logging. It's a properties file. Let's change that.

Let's talk about the structure:

    "label": "dict.cc",
    "versionName": "10.7",
    "versionCode": 100700,
    "packageName": "cc.dict.dictcc",
    "sourceDir": "",
    "dataDir": "\/data\/user\/0\/cc.dict.dictcc",
    "deviceProtectedDataDir": "\/data\/user_de\/0\/cc.dict.dictcc",
    "lastBackupMillis": 1594380999312,
    "isEncrypted": false,
    "isSystem": false,
    "backupMode": 2
}

First point out, what makes sense and why:

  • label - Display it in UI, so the user knows what app hides behind the package name
  • versionName and versionCode - good to know
  • lastBackupMillis - the age of the backup. Very useful.
  • isSystem - For the sake of simplicity, we just store it
  • isEncrypted - We could try to guess, but why take the risk?

Questionable attributes:

  • packageName - a bit redundant, it's already the directory's name
  • splitApks - We could just assume all apks in the directory must be installed, important is only to know which is the main apk, but maybe it's good to know the exact names…

Poor attributes:

  • sourceDir - it's even empty in my example
  • dataDir + devicesProtectedDataDir - package manager knows it better for sure + it not multi user compatible

Bugged Attributes:

  • backupMode - it stores what happened last time, so if I backed up an app with data and after a few days just the data, oabx would only offer to restore the data. It should be separated what the backup contains

What we are missing/ideas to add:

  • Maybe a format version. The oabx is changing a lot. Add it now or wait until we have the first change in the format, that needs to know about a change
  • Encryption Cipher - to make this more dynamic and offer stronger encryption on newer Android versions
  • Some information about the backup source (for later, to inform the user that the backup comes from another device/architecture/Android version and might not be compatible)

And just more order in the backup directory and in preparation of multiple backup versions (and users?): We should talk about the directory structure. It should be simple but with a defined structure:

  • /sdcard/OABX
    -- package.Name
    --- UserId (0 is main user, 10 may be work profile)
    ---- YYYY-MM-DD-HH-mm-ss
    ----- app
    ----- data
    ----- deviceProtectedData
    ----- externalData
    ----- obbData
    ----- backup.properties

On the UI, the user can then choose which version to restore and in case of app+data, it should calculate a matching backup combination.

2020-07-07-15-00-00: app + data
2020-07-06-15-00-00: data
2020-07-05-15-00-00: app
2020-07-04-15-00-00: data
2020-07-03-15-00-00: data
2020-07-02-15-00-00: app + data
2020-07-01-15-00-00: app + data

If I select 2020-07-06-15-00-00 for app + data restore, it should offer to restore a combination of 2020-07-06-15-00-00 (data) and 2020-07-05-15-00-00 (app).

Just an idea…

For reference: A properties file from the same app from Titanium Backup

#Sun Jul 12 23:40:42 GMT+02:00 2020
sys_ro.product.model=ONEPLUS A5010
app_is_forward_locked=0
has_prefsdata=0
app_version_name=10.7
sys_ro.build.date.utc=1593396966
has_prefsdata_jpu=0
app_apk_codec=GZIP
app_version_code=100700
app_label=dict.cc
app_gui_icon=<truncated>
sys_ro.build.version.release=10
sys_ro.serialno=xxxxxx
has_dbdata=0
app_apk_md5=6e289b5d5416865ceb68bd5ad1574fc3
app_is_system=0
generation=1
sys_ro.build.description=OnePlus5T-user 10 QKQ1.191014.012 2006012146 release-keys
app_apk_location=internal
app_gui_label=dict.cc 10.7```
@machiav3lli machiav3lli added the enhancement New feature or request label Aug 18, 2020
Tiefkuehlpizze added a commit to Tiefkuehlpizze/oandbackupx that referenced this issue Sep 27, 2020
Replaced: Creating backup tar is a pure stream now. It creates an inventory of all files to backup and then streams it using libsu IO into the tar archive. (Libsu needs a workaround to avoid receiving eof to early. This is why the inventory is very important to get the complete filesize).
Replaced: Previous meta data "log" with backup.properties and json format
Implemented: Support for Symlinks and Pipes
Implemented: New backup structure with support of multiple backup revisions as described in NeoApplications#71 (it's not show in the UI yet; instead it always refers to the latest backup)
Changed: Restore strategy uses OABX's cache directory for extracting and then moves the contents to their target location

Just for the reference: This is a very rough summary of bunch of fixed up commits. I'm sorry about that.
Tiefkuehlpizze added a commit to Tiefkuehlpizze/oandbackupx that referenced this issue Sep 28, 2020
Replaced: Creating backup tar is a pure stream now. It creates an inventory of all files to backup and then streams it using libsu IO into the tar archive. (Libsu needs a workaround to avoid receiving eof to early. This is why the inventory is very important to get the complete filesize).
Replaced: Previous meta data "log" with backup.properties and json format
Implemented: Support for Symlinks and Pipes
Implemented: New backup structure with support of multiple backup revisions as described in NeoApplications#71 (it's not show in the UI yet; instead it always refers to the latest backup)
Changed: Restore strategy uses OABX's cache directory for extracting and then moves the contents to their target location

Just for the reference: This is a very rough summary of bunch of fixed up commits. I'm sorry about that.
Tiefkuehlpizze added a commit to Tiefkuehlpizze/oandbackupx that referenced this issue Sep 29, 2020
Replaced: Creating backup tar is a pure stream now. It creates an inventory of all files to backup and then streams it using libsu IO into the tar archive. (Libsu needs a workaround to avoid receiving eof to early. This is why the inventory is very important to get the complete filesize).
Replaced: Previous meta data "log" with backup.properties and json format
Implemented: Support for Symlinks and Pipes
Implemented: New backup structure with support of multiple backup revisions as described in NeoApplications#71 (it's not show in the UI yet; instead it always refers to the latest backup)
Changed: Restore strategy uses OABX's cache directory for extracting and then moves the contents to their target location

Just for the reference: This is a very rough summary of bunch of fixed up commits. I'm sorry about that.
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

2 participants