Closed paulo-raca closed 5 years ago
I don't quite recall what the issue was, but I originally wanted to implement it the same way. Sometthing (I don't remember what) didn't work out, forcing me to put the size calculation into setCompress().
Any clue on what it might be? I tested it with a handful packages and had no issues
I'm also annoyed by the fact that only the main APK supports encryption. Is that correct?
Any clue on what it might be? I tested it with a handful packages and had no issues
Unfortunately not. I just seem to recall that for some reason, I had to refactor it the way it is now. Best to leave it the way it is. I have plans for a major rewrite (getting rid of the entire com.akdeniz package), so it's not worth the time to fix something just because it is ugly.
I'm also annoyed by the fact that only the main APK supports encryption. Is that correct?
That is correct. The encryption is more or less a legal "cover your ass" thing, than technically meaningful.
I have plans for a major rewrite (getting rid of the entire com.akdeniz package)
This is good to know.
I'm working on an automated toolchain that downloads apps and runs a bunch of analysis on them (used APIs, compatibility tests, etc).
I was planning on using the classes on com.akdeniz as a low-level API for downloading apps and completely ignore the de.onyxbits
package, since the UI doesn't make sense for me.
After the rewrite, do you plan to preserve a low-level API I can use?
so it's not worth the time to fix something just because it is ugly While not necessary, the changes are for my own convenience, and makes my code simpler ;)
What if I reverted only the change in size calculations?
I was planning on using the classes on com.akdeniz as a low-level API for downloading apps and completely ignore the
de.onyxbits
package, since the UI doesn't make sense for me.
That's probably not a recipe for happyness. There's a lot of ugly code in Raccoon dealing with various shortcomings in the akdeniz part. It's fine if you want to use it as a low level API, but don't integrate it tightly into your code.
After the rewrite, do you plan to preserve a low-level API I can use?
Very much so. In fact, that is a major reason for doing the rewrite in the first place.
so it's not worth the time to fix something just because it is ugly While not necessary, the changes are for my own convenience, and makes my code simpler ;)
What if I reverted only the change in size calculations?
What else is in there again? I didn't have time to check thouroughly. Considering how busy I am ATM, I'd prefer not to fix stuff that isn't broken.
What else is in there again? I didn't have time to check thouroughly.
Just a uniform API for downloading the various file types.
Let's just leave it the way it is for now. I know the current implementation is crap, but changing this might open a can of worms, I am not currently prepared to deal with.
I completely understand :rofl:
As I looked into DownloadData, I found it to be very redundant: There are distinct but similar methods to open, getSize, etc, all 3 types of files (apk, expansion and split).
This is exactly where a class makes sense, so I've created
AppFile
class, with getSize() and openStream().It's subclasses add useful methods if necessary, like
SplitApkFile.getId()
andAdditionalFile.getVersionCode()
.DownloadData can now be resumed to
getMainApk()
,getAdditionalFiles()
andgetSplitApkFiles()
, all of which return similar objects :)This new structure makes the code for
AppDownloadWorker
andcli.Play.downloadApp
considerably simpler.I also modified the logic to work with compressed files: Instead of all-or-nothing, it will use compression wherever possible and fallback to uncompressed on the files where it isn't available.
The compressed size is no longer computed -- It isn't used for anything, since compression is handled internally and the stream received by the caller has the full file size.