B4A Library ProBundle

ProBundle contains all the following libraries:

- ArchiverPlusZip v1.13
Based on the Zip4j library, this library allows to add, extract, update and remove files from a zip archive.
It supports encryption and decryption (standard and AES), Zip64 format and split zip archives. It is compatible with B4J.

- ClassLoader v1.0
This library can dynamically load classes from a separate file (JAR or uninstalled APK) at runtime and verify the file signatures to make sure of its origin and integrity.
You can use the library to create plug-ins, load code encrypted in the assets or download code from a remote server, for example.

- CPUFeatures + source v1.0
This library detects the target device's CPU family and the maximum number of CPU cores.

- DataCollection v1.07
This library wraps the ArrayDeque, BitSet, PriorityQueue, SparseArray, Stack, TreeMap and TreeSet classes. These classes can replace your lists, maps or arrays for specific tasks. A TreeSet, for example, can maintain a sorted list of objects in a more efficient manner than a typical List class. A TreeMap is a map whose entries are sorted by their keys. A SparseArray is also a sorted map, but restricted to integer keys, that is lightning-fast.
This library can serialize to an array of bytes any collection, including Map, List and user defined types. A version for B4J is provided (without the SparseArray).

- F5Steg v1.2
This library implements F5, a secure steganographic algorithm, which embeds data into images. Data are encrypted with a password or, by default, with the application signature (thus any tampering of the APK will prevent from extracting valid data).

- FastIO + source v0.9
This library replaces the Read and Write functions (with their encrypted variant) of the RandomAccessFile library for arrays of bytes. These new functions are a lot faster.

- OverlayWindow + source v1.2
This library allows to create overlay windows and floating buttons. These interactive views can be displayed on top of all other applications.

- PackageUtils v2.1
This library replaces the PackageManager class of the Phone library. It gives plenty of informations on packages (activities, features, permissions, receivers, services, etc.) and can list the features available on the system (camera, gps, wifi, etc.). It allows experts to change the enabled state of components.
An application is provided with the library to show what you can get with it.

- UltimateArchiver v0.91
This library wraps P7Zip, a command line utility that can create archives with the 7z, zip, bzip2, gzip, tar or xz format. It can unpack files with extension 7z, cab, gz, img, iso, jar, rar, tar, zip and a few others.
It supports encryption/decryption and volumes. It is written in C to be as fast as possible.

- UnArchiver7z v1.0
Based on the official source code in C of 7zip, this library allows to extract files from a 7z archive compressed with the Lzma or Lzma2 method. It can unpack an archive directly from the assets.
It does not support decryption.

- UnArchiverRar v1.04
Based on the official source code in C++ of the UnRar.dll, this library allows to extract files from a Rar archive.
It supports decryption, Rar5 format, QuickOpen records and split Rar archives.

Since September 2018, ProBundle is available for free. You can still donate for it if you wish.
To send the money, just click on the Donate button below (the amount to enter is in euros):


CURRENT VERSION : ProBundle 1.22

DOWNLOAD HERE:
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
While I was working on ArchiverPlus7z (which works fine for now but is very slow), I realized that the event system of ArchiverPlusZip was completely stupid. I'm replacing it completely by a new and more simple event system. You will have only two execution modes: synchronous and asynchronous. Both use a separate thread to allow cancelling the task or displaying the progression. One waits for the end of the task, the other does not.
 

aidymp

Well-Known Member
Licensed User
Longtime User
While I was working on ArchiverPlus7z (which works fine for now but is very slow), I realized that the event system of ArchiverPlusZip was completely stupid. I'm replacing it completely by a new and more simple event system. You will have only two execution modes: synchronous and asynchronous. Both use a separate thread to allow cancelling the task or displaying the progression. One waits for the end of the task, the other does not.

Hi regarding this lib ArchiverPlusZip, it works well for me, however just a few points, The Percent done seems to round up, so 99.5% shows 100% this would be fine in most situations, however my large 1GB Zips, it shows 100% for about 2-3minutes before the actual zip is extracted. any chance you could either round down, or provide the progress as float?

Thanks

Aidy
 

Informatix

Expert
Licensed User
Longtime User
Hi regarding this lib ArchiverPlusZip, it works well for me, however just a few points, The Percent done seems to round up, so 99.5% shows 100% this would be fine in most situations, however my large 1GB Zips, it shows 100% for about 2-3minutes before the actual zip is extracted. any chance you could either round down, or provide the progress as float?

Thanks

Aidy
Yes, I noticed this problem. It is a float in the new version.
 

padvou

Active Member
Licensed User
Longtime User
Could you please show me how to do this:
To cancel an asynchronous thread, it is recommended to set a boolean variable (a flag) declared in Globals to indicate that the thread should stop running. The target thread should check this variable regularly and return properly when the flag is set.
 

Informatix

Expert
Licensed User
Longtime User
The new version of ProBundle is available for download. I modified ArchiverPlusZip.

Changelog for ArchiverPlusZip:
- I replaced the event system by a simpler and more efficient system. Only two execution modes now;
- PercentDone is now a float value;
- I renamed ZipResult to ZipResultCode;
- I added a little bit of code to the first demo.
 

Harris

Expert
Licensed User
Longtime User
- PackageUtils v2.0
It allows experts to change the enabled state of components.

Does this imply that we can pro-grammatically can the state of GPS (turn it ON for example)?
 

Informatix

Expert
Licensed User
Longtime User
My Unrar library is done but before making it available for download, I'd like to explain why there will be no 7z library before long.

It took me a few days to create the Unrar library because it is entirely in C, with no documentation and no useful code on internet. The Java implementations that you can find are either very old and poorly featured, or very slow, or very limited (e.g. in CyanogenMod, a fork of Android, they removed the interesting features and the exceptions handling :eek:), or not adapted to Android. In brief, I had to figure out myself how to use the official source code of the Unrar.dll to create my .so libraries for Android. Fortunately, the code is very well written, with enough comments to get the whole picture. After a few hundreds of lines in C++ to call the right functions with the right parameters and a few hundreds of lines in Java, I'm glad to see all this stuff working fine and fast.

At the beginning, I wanted to do the same for the 7z format, as the code is freely available on internet. But I spent too much time on the Unrar library and the code of 7z is a lot more difficult to understand. I could do like almost everybody did: instead of trying to access directly the functions to open archives, get headers, get streams, etc., I could use the command line tool 7za and pass things like "7za -x myarchive" but I find very weird to do that. It's an easy solution but the size of the library becomes so big! There's inside all the code to manage the console and the user input, with all dialogs... for a silent use. I succeed in shrinking it but it's still too big (for arm and x86 cpus, we're still above 1Mb for the .so). As I created a 7z library already in pure Java, I prefer to stop working on the C version for now. Too much work, not enough time and poor documentation.

I prefer to start writing a little guide explaining how to write yourself a .so library for Android. No Java or C knowledge will be required. The goal is to provide a model with blanks to fill. You won't do wonders with that, but you will be able to store data (primitive types) or computations in the library to hide them from prying eyes.
 

Harris

Expert
Licensed User
Longtime User
There's no relation between them. A component is an Activity, a Provider, a Service or a Receiver. You can, for example, disable some receivers in your application when you don't want to receive intents at a given time.
Thanks for clearing that up.
 

Informatix

Expert
Licensed User
Longtime User
I added the UnRar library to ProBundle and, by the way, I removed the option to get the libraries only for 20 euros as nobody used this option. It is easier for me to manage only one amount of donation.

I also revised the ProtectMyApp guide to remove an useless line in the HelloWorld example due to the new version of ArchiverPlusZip.

I added a Proguard configuration file for libGDX projects.

Note that there's a strange bug in ArchiverPlusUnRar with passwords. I tested a lot of them and I noticed that "1234" failed to decrypt the archive. That works fine with "123" or "12345" but not with "1234". I found that passwords with 4 characters do not work. Go figure. However, a password with 4 characters is too short so the problem should not be really annoying.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User

aidymp

Well-Known Member
Licensed User
Longtime User
ArchiverProZip 1.1 I think its broken! I only get progress 0%-6% Then a long delay (3-4mins!) then 25% Then another long delay (3-4mins), 49% and a very long delay (5-10mins) 79% and another long delay (5-10mins) then most of the time the app just exits with no errors!? nothing!

Reverting back to ArchiverProZip 1.0 the zip unzips in under a minute and I see progress from 0-100%

Also you say " I renamed ZipResult to ZipResultCode;" I presume you meant

B4X:
Sub Archiver_ZipResultCode(Result As Int, ErrorMsg As String)
    Select Result
        Case Arc.ZIP_RESULT_SUCCESS
            LogColor(txtTask & " OK", Colors.Blue)
        Case Arc.ZIP_RESULT_ERROR
            LogColor(txtTask & " ERROR / ErrorMsg=" & ErrorMsg, Colors.Red)
        Case Arc.ZIP_RESULT_CANCELLED
            LogColor(txtTask & " CANCELLED", Colors.Magenta)
        Case Else
            Log(txtTask & " ???")
    End Select
End Sub

But the program just exits! without any error message's!

I have tested your examples and they work, but sometime just exit without any error messages?

Thanks

Aidy
 

Informatix

Expert
Licensed User
Longtime User
ArchiverProZip 1.1 I think its broken! I only get progress 0%-6% Then a long delay (3-4mins!) then 25% Then another long delay (3-4mins), 49% and a very long delay (5-10mins) 79% and another long delay (5-10mins) then most of the time the app just exits with no errors!? nothing!

Reverting back to ArchiverProZip 1.0 the zip unzips in under a minute and I see progress from 0-100%

Could you post the code that you put in your events? The events are raised in the library thread, which is not the main UI thread, and thus you cannot do what you're allowed to do in the main thread, e.g. updating directly the views (you have to do it with another sub called by CallSubDelayed). You also have to avoid calls to DoEvents, which are only useful in the main thread and are maybe the cause of your strange slowdowns.
As you noticed, my demo runs without any issue so try to replicate how it is made in your own code and you'll probably see that nothing is broken.

Also you say " I renamed ZipResult to ZipResultCode;" I presume you meant

B4X:
Sub Archiver_ZipResultCode(Result As Int, ErrorMsg As String)

No. In the first version, the function and the event had the same name, so I renamed the function to avoid confusion. When you have a doubt like this, you have many help sources at your disposal: a "Functions and properties" document, an inline help, the space+tab menu and my demo code.
 
Last edited:
Top