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

Add support for Android Backups #419

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add support for Android Backups #419

wants to merge 6 commits into from

Conversation

Schamper
Copy link
Member

@Schamper Schamper commented Oct 16, 2023

Also some miscellaneous cleanup.

Depends on fox-it/dissect.util#33.

Unit tests will follow later.

@Schamper Schamper marked this pull request as draft October 16, 2023 18:41
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Attention: 150 lines in your changes are missing coverage. Please review.

Comparison is base (fe16e92) 74.04% compared to head (27c1c1d) 74.13%.

❗ Current head 27c1c1d differs from pull request most recent head c60bee0. Consider uploading reports for the commit c60bee0 to get more accurate results

Files Patch % Lines
dissect/target/tools/query.py 55.05% 40 Missing ⚠️
dissect/target/loaders/ab.py 84.40% 39 Missing ⚠️
dissect/target/tools/reg.py 0.00% 20 Missing ⚠️
dissect/target/tools/info.py 5.00% 19 Missing ⚠️
dissect/target/plugins/browsers/firefox.py 69.56% 7 Missing ⚠️
dissect/target/tools/dd.py 0.00% 7 Missing ⚠️
dissect/target/tools/fs.py 14.28% 6 Missing ⚠️
dissect/target/tools/shell.py 0.00% 5 Missing ⚠️
dissect/target/tools/mount.py 42.85% 4 Missing ⚠️
dissect/target/target.py 66.66% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   74.04%   74.13%   +0.08%     
==========================================
  Files         272      259      -13     
  Lines       22529    20932    -1597     
==========================================
- Hits        16681    15517    -1164     
+ Misses       5848     5415     -433     
Flag Coverage Δ
unittests 74.13% <67.53%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Schamper Schamper marked this pull request as ready for review October 21, 2023 20:45
dissect/target/loaders/ab.py Outdated Show resolved Hide resolved
dissect/target/loaders/ab.py Show resolved Hide resolved
Copy link
Contributor

@Miauwkeru Miauwkeru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed something with a k when using the followin adb flags:

adb backup -all -system -keyvalue -shared

Tho I do not know what it is for... I assume the key value information

@@ -112,8 +124,13 @@ def history(self) -> Iterator[BrowserHistoryRecord]:
else:
from_visit, from_place = None, None

if self.target.os == OperatingSystem.ANDROID:
visit_date = from_unix_ms(row.visit_date)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An idea to just move the check itself somewhere in the init?
something as:

class FirefoxPlugin(...):
    def __init__(self, ...):
          ...
          if self.target.os == OperatingSystem.ANDROID:
             self.from_timestamp = from_unix_ms
          else:
             self.from_timestamp = from_unix_us

@@ -34,45 +34,57 @@ class FirefoxPlugin(BrowserPlugin):
# macOS
"Library/Application Support/Firefox",
]

SYSTEM_DIRS = [
"/data/data/org.mozilla.vrbrowser/files/mozilla",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to test this part. I wasn't able to get the information using adb.

@Miauwkeru
Copy link
Contributor

Miauwkeru commented Apr 11, 2024

I was able to verify it now, I did notice there is an issue in firefox.downloads(). Where the moz_anno_attributes does not exist in the table. So rows() is called on a None object.

Additionally, could you add a test for the android stuff in the firefox plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants