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

A few questions regarding the development of this repo #7

Open
Reiszecke opened this issue Jun 26, 2022 · 2 comments
Open

A few questions regarding the development of this repo #7

Reiszecke opened this issue Jun 26, 2022 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@Reiszecke
Copy link

Hey first of all tysm for making this!

I have a few questions regarding your project. I want to extend its functionality to be able delete or compress some junk data of apps like WhatsApp. At least on Android you can safely remove some files that are otherwise not easily deletable via the app natively but on iOS (since there is no file access) this is not possible which is why I want to attempt doing just that via backups.

  • During development, did you use any kind of profiler? I'm asking because as soon as I open some folders in the WhatsApp container it will start to freeze with the CPU usage going close to 400% for half an hour until I close the process. I'd be happy to investigate but I'd like to know whether that's something you've already done before

  • Commit 985906e that adds the possibility to replace files also comes with the reEncryptDatabase() function call. Does that work in a way that I can straight up "edit" any file in a backup, then play back that backup (that then contains the edited file) onto the device, essentially editing the otherwise closed-down iOS file system?

  • As I have previously mentioned, I'd like to be able to manage some common storage-hungry data. That would be something along the lines of "we don't need full resolution images in there, let's compress them" for example - would you be willing to merge such additions or should I run it as an independent project, only merging your upstream changes each time? I'd be fine with both ways, I'd just like to know your preference on that.

@MaxiHuHe04
Copy link
Owner

Hey @Reiszecke!
I'm sorry that it took so long. I don't know why the GH mobile app doesn't send notifications.

That functionality is a great idea. A while ago, I actually had a problem where iMessage used up a large amount of storage on an iPad and there was no way to find or delete anything on the device. The backup explorer totally makes it possible. For a specific use case like that manual deletion is enough, but for WhatsApp and freeing space up in general an automatic tool would be awesome.

  • Regarding your first question: I think the algorithm that reassembles the tree folder structure in the Files tab is quite inefficient. I profiled it once, but I haven't focused much on performance yet. Especially because I haven't had problems anywhere near what you described. Could you share your system specs and about how much space WhatsApp takes up on your phone? Does it only happen in the WhatsApp container or is it slow everywhere?
  • Yes, exactly. I have to admit that I haven't gotten around to testing restoring the backup to the phone yet. I'm pretty sure it works though. I have an older iPhone lying around and will try this out soon.
  • Yeah, definitely. There is still plenty of room left for additional tabs in the program. :)

@MaxiHuHe04 MaxiHuHe04 self-assigned this Jul 30, 2022
@MaxiHuHe04 MaxiHuHe04 added the question Further information is requested label Jul 30, 2022
@Reiszecke
Copy link
Author

Hey man don't worry about it :)

Yeah actually I had the issue on iMessage first until I moved everything to WhatsApp which then showed the same bloaty behavior hahahaha

Does it only happen in the WhatsApp container or is it slow everywhere

I've only noticed it in the WhatsApp directory, but I haven't tried out many others since they probably are all smaller than this stupid WA folder hahaha

system specs

Early 2015 MBA (2.2 Dual Core i7), Big Sur 11.5

Backup is from an iPhone 7 32GB

I have an older iPhone lying around and will try this out soon

I may also soon have an extra iPhone but none that I can risk bricking yet, so looking forward to your info 😅

There is still plenty of room left for additional tabs in the program

That sounds great, happy to hear you are open for additions. Currently a lot more busy again than I was a few weeks ago but let's see :)

To the performance: The backup (32GB phone) is 11 GB in size

As soon as I hit the "Files" tab, after entering the password in the prompt it takes about 15 seconds to load the browser's list on the left tab.

Performance in the java files browser in the right tab:

Hitting Application Groups > AppDomainGroup...WhatsApp.private (almost no data in there) opens somewhat immediately
Hitting Application Groups > AppDomainGroup...WhatsApp.shared at first looks like it's the same contents but if you switch back and forth you notice that it's actually loading something up, the fans start reving.

how much space WhatsApp takes up on your phone

I have closed the jar, opened it again but this time let it load on first tap (so only 100% CPU usage then), and it took exactly 1:40 min to open the Application Groups > AppDomainGroup...WhatsApp.shared folder. To figure out its size I have exported it which took 7 minutes for the WhatsApp folder that is 4.8gb in size.

What's interesting is that with my WhatsApp Business installation, the .shared folder opens almost immediately. The folder structure is fairly similar so it's not necessarily the amount of files and folders in the root dir of the WhatsApp Application Group but rather about the literal size (or the amount of files that come along with that). Is there a chance that it recursively iterates to each subdir too? For example because instead of processing each sub-dir's contents on-demand, it may build the tree for the selected folder upfront? That would explain why a similar folder with less contents nested in subfolders is so much faster.

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

No branches or pull requests

2 participants