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:

wonder

Expert
Licensed User
Longtime User
Informatix said:
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.
Thank you!
I'm looking forward into it! :)
 

Luis Felipe

Member
Licensed User
Longtime User
A new version of ProBundle is available for download.

- I fixed the password bug in ArchiverPlusUnRar.
- I added the ReadArrayFromAssets function to FastIO.

Hello Informatix. Where is it downloadable ? Are you going to send a new email with a link to the people who bought it ?
Thanx and great job !
 

Informatix

Expert
Licensed User
Longtime User
I'm really proud of my new solution to secure your data. I can't wait to share with you my SecureVault generator. The code works fine. I have to write the guide now...
I tried to hack an APK secured by this new solution and didn't succeed. I embedded everything in the C code of the generated library (data and cryptography functions) so it's extremely opaque. The protection won't last long on a subverted system (where the security libraries have been cracked) but it's the common fate of all protections and that does not mean that the app can easily be cracked (forcing an APK to reveal its secrets on a modified system and modifying an APK to allow its use on all systems are two different things).
 

Informatix

Expert
Licensed User
Longtime User
There's a new version of ProBundle and ProtectMyApp available for download. I had interesting readings these past days about cracking an Android app. It seems that a .so library is a frontier beyond which only go experienced hackers, so I added a native library to F5Steg.
My guide to create a Secure Vault library and its C+Java generator are also in the new release.

Changelog:
- I edited or added paragraphs in the ProtectMyApp guide between p.13 and p.20 (nothing was removed, just rewritten or extended);
- I moved some functions of the F5Steg library into a native library to increase the opacity of the code and the difficulty to change it;
- The F5Steg library uses now a more complex algorithm to encrypt data, with a random salt;
- I added a guide explaining how to create your own library in C and Java to store sensitive data, with all the necessary code to generate the library.
 

aidymp

Well-Known Member
Licensed User
Longtime User
I am still experiencing problems with ArchiverPlusZip 1.1, In version 1.0 my app works great! using 1.1 my progress fails to update using the same method?

however in 1.0 im trying to zip a folder! the folder is in the Android folder (is that the root of my problem?) The most popular error I see is

Error occurred on line: 1421 (Main)
Message longer than Log limit (4000). Message was truncated.
a.a.a.c.a: zip headers not found. probably not a zip file
at a.a.a.a.a.a(SourceFile:122)
at a.a.a.a.c.a(SourceFile:6078)
at a.a.a.a.c.e(SourceFile:935)
at a.a.a.a.c.a(SourceFile:343)
at b4a.flm.archiverplus.ArchiverPlusZip.AddFolderToZip(SourceFile:28330)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:712)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:244)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:198)
at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:167)
at anywheresoftware.b4a.keywords.Common.DoEvents(Common.java:386)
at com.aidymp.aidymatic.main._wait(main.java:1442)
at com.aidymp.aidymatic.main._myweb(main.java:2390)

This is a result of this command:
B4X:
Arc.AddFolderToZip(MyPath , ArchiveFolder & "pack.zip" , "pack")

I have stripped your demos down to the minimum and I also get random crashes and exits. I can see my paths are correct as I get the first few filenames.

If I try 1.1 its the same, but my unzip routine does not work. I have played with this on and off for the past 4 days. I really want to use this lib!

Any clues?

I am going to try moving the folder and zipping from a different location.

Points I have noted, the demos originally your example took under 1 minute to run - last attempt un modified took about 10 mins!

Im not saying the lib is broke! its may be a problem at my side, as I said im sure the demos run pretty fast when I first tried it!

Im on Windows 10, using 2 real Android devices. I cannot upload my project, as its a) an embarrassment to programmers! lol and b) Im hoping once it works (IF it ever does) it will make a bit of revenue!

So any tips please? This may have no bearing at all but Im going to format the PC, And Android devices as All seem to be acting strange, B4A gives little or no logging info, and I get errors on compiling, saying files are missing or unable to be written too.

Thanks

Aidy
 

Informatix

Expert
Licensed User
Longtime User
I am still experiencing problems with ArchiverPlusZip 1.1, In version 1.0 my app works great! using 1.1 my progress fails to update using the same method?

however in 1.0 im trying to zip a folder! the folder is in the Android folder (is that the root of my problem?) The most popular error I see is



This is a result of this command:
B4X:
Arc.AddFolderToZip(MyPath , ArchiveFolder & "pack.zip" , "pack")

I have stripped your demos down to the minimum and I also get random crashes and exits. I can see my paths are correct as I get the first few filenames.

If I try 1.1 its the same, but my unzip routine does not work. I have played with this on and off for the past 4 days. I really want to use this lib!

Any clues?

I am going to try moving the folder and zipping from a different location.

Points I have noted, the demos originally your example took under 1 minute to run - last attempt un modified took about 10 mins!

Im not saying the lib is broke! its may be a problem at my side, as I said im sure the demos run pretty fast when I first tried it!

Im on Windows 10, using 2 real Android devices. I cannot upload my project, as its a) an embarrassment to programmers! lol and b) Im hoping once it works (IF it ever does) it will make a bit of revenue!

So any tips please? This may have no bearing at all but Im going to format the PC, And Android devices as All seem to be acting strange, B4A gives little or no logging info, and I get errors on compiling, saying files are missing or unable to be written too.

Thanks

Aidy
Without code, I cannot help.

I probably zipped or unzipped hundreds of files during my tests, on different devices, so I'm quite sure that the library works fine. The problem is probably due to your code or the lack of free space on your device.
 

aidymp

Well-Known Member
Licensed User
Longtime User
Without code, I cannot help.

I probably zipped or unzipped hundreds of files during my tests, on different devices, so I'm quite sure that the library works fine. The problem is probably due to your code or the lack of free space on your device.

Yes I understand, I will format my devices, and look again If I cannot solve can I email my project to you?

Thanks

Aidy
 

aidymp

Well-Known Member
Licensed User
Longtime User
I feel like a broken record now lol! Right 48 hours of formatting and trying to get everything back in place, I have managed to get my code back to a working state, after downgrading to windows 7, using api 23, I had to change a lot of stuff and implement the okhttp lib as well as 3 hours trying to work out why my 9 patch images came up with an error (only to find they had been deleted due to the OS reinstall removing the read only flags!

So I run my project, using 1.1 of the ArchiverPlusZip lib! and it fails it starts well (if a little slow) extracting the zip the file names and percent are displayed in the log in real time this is the code I am using.

B4X:
Sub Unzipper
    apm1.BottomText= "Extracting..."
    apm1.Progress=0
    ImageView4.Visible=False
    apm1.Visible =True
    Label4.text = "Extracting Setup!"
    wv1.Visible=False
    ProgressBar1.Progress=0
    Arc.UnZip(File.DirDefaultExternal & "/Download/Settings.zip", File.DirRootExternal & "/Android/data/somelocation/files/.somehiddenfolder/","prog")
End Sub

Sub zipprog
    apm1.Progress = ProgressBar1.Progress
    'DoEvents
End Sub

Sub prog_ZipProgression(Operation As Int, FileName As String, PercentDone As Float)
    Log(FileName & " (" & PercentDone & "%)")
    ProgressBar1.Progress=PercentDone
    Log("Progressbar reads "&ProgressBar1.Progress)
    'apm1.Progress = ProgressBar1.Progress
    'DoEvents
        CallSubDelayed(Me, "zipprog")
End Sub

Using version 1.0 The above code works fine (the progress meter (apm1) updates evenly and extraction is VERY FAST!!!. however in 1.1 the progress meter does not update at all. and the zip extraction just quits at a random percent I have had it quit at 0% 1% 8% 34% 87% etc but I have also had it extract completely after a very long time!

As I said in my earlier post, I have formatted my PC, formatted both my android tablet, and TV-box and the result is the same. I was going to use version 1.0 of the lib and move along with the the other features, but the next feature was a backup routine, and I was hoping to use the lib to zip a folder, however that behaves in the same way in both 1 and 1.1 i.e. it wont zip a folder it starts, and then at a random % just closes my app?

I have now spent far too long on this problem, is there any obvious reason as to why the above code would not work? my device has 5gb free and my tablet has 12gb free.the zip file works fine and has no errors.

Here is the code I use to zip a folder

B4X:
Sub BldImg1_Click
    wv1.Visible=False
    apm1.BottomText="Backing Up."
    apm1.Visible=True
    clv1.Text=""
    ButtonsOFF
    DoEvents
    Dim ArchiveFolder As String = File.DirRootExternal & "/Download/"
    Arc.ZipCompression = True
    Arc.ZipCompressionLevel = 1
    Arc.AddFolderToZip(XBMCPath , ArchiveFolder & "pack.zip" , "pack")
End Sub

Sub pack_ZipProgression(Operation As Int, FileName As String, PercentDone As Float)
    Log(FileName & " (" & PercentDone & "%)")
    ProgressBar1.Progress=PercentDone
    CallSubDelayed(Me, "zipprog")
End Sub
Sub zipprog
     apm1.Progress = ProgressBar1.Progress
    'DoEvents
End Sub

Again this starts to zip, i get no progress update only in the log, then the app quits with no error messages at a random %

Thanks

Aidy
 

Informatix

Expert
Licensed User
Longtime User
I feel like a broken record now lol! Right 48 hours of formatting and trying to get everything back in place, I have managed to get my code back to a working state, after downgrading to windows 7, using api 23, I had to change a lot of stuff and implement the okhttp lib as well as 3 hours trying to work out why my 9 patch images came up with an error (only to find they had been deleted due to the OS reinstall removing the read only flags!

So I run my project, using 1.1 of the ArchiverPlusZip lib! and it fails it starts well (if a little slow) extracting the zip the file names and percent are displayed in the log in real time this is the code I am using.

B4X:
Sub Unzipper
    apm1.BottomText= "Extracting..."
    apm1.Progress=0
    ImageView4.Visible=False
    apm1.Visible =True
    Label4.text = "Extracting Setup!"
    wv1.Visible=False
    ProgressBar1.Progress=0
    Arc.UnZip(File.DirDefaultExternal & "/Download/Settings.zip", File.DirRootExternal & "/Android/data/somelocation/files/.somehiddenfolder/","prog")
End Sub

Sub zipprog
    apm1.Progress = ProgressBar1.Progress
    'DoEvents
End Sub

Sub prog_ZipProgression(Operation As Int, FileName As String, PercentDone As Float)
    Log(FileName & " (" & PercentDone & "%)")
    ProgressBar1.Progress=PercentDone
    Log("Progressbar reads "&ProgressBar1.Progress)
    'apm1.Progress = ProgressBar1.Progress
    'DoEvents
        CallSubDelayed(Me, "zipprog")
End Sub

Using version 1.0 The above code works fine (the progress meter (apm1) updates evenly and extraction is VERY FAST!!!. however in 1.1 the progress meter does not update at all. and the zip extraction just quits at a random percent I have had it quit at 0% 1% 8% 34% 87% etc but I have also had it extract completely after a very long time!

As I said in my earlier post, I have formatted my PC, formatted both my android tablet, and TV-box and the result is the same. I was going to use version 1.0 of the lib and move along with the the other features, but the next feature was a backup routine, and I was hoping to use the lib to zip a folder, however that behaves in the same way in both 1 and 1.1 i.e. it wont zip a folder it starts, and then at a random % just closes my app?

I have now spent far too long on this problem, is there any obvious reason as to why the above code would not work? my device has 5gb free and my tablet has 12gb free.the zip file works fine and has no errors.

Here is the code I use to zip a folder

B4X:
Sub BldImg1_Click
    wv1.Visible=False
    apm1.BottomText="Backing Up."
    apm1.Visible=True
    clv1.Text=""
    ButtonsOFF
    DoEvents
    Dim ArchiveFolder As String = File.DirRootExternal & "/Download/"
    Arc.ZipCompression = True
    Arc.ZipCompressionLevel = 1
    Arc.AddFolderToZip(XBMCPath , ArchiveFolder & "pack.zip" , "pack")
End Sub

Sub pack_ZipProgression(Operation As Int, FileName As String, PercentDone As Float)
    Log(FileName & " (" & PercentDone & "%)")
    ProgressBar1.Progress=PercentDone
    CallSubDelayed(Me, "zipprog")
End Sub
Sub zipprog
     apm1.Progress = ProgressBar1.Progress
    'DoEvents
End Sub

Again this starts to zip, i get no progress update only in the log, then the app quits with no error messages at a random %

Thanks

Aidy
To investigate your case, could you send me a sample project by email? I need to be able to run the same code, with the same archive.
 

aidymp

Well-Known Member
Licensed User
Longtime User
To investigate your case, could you send me a sample project by email? I need to be able to run the same code, with the same archive.

Thank you I will zip it and email it later

Thanks Again

Aidy
 

Informatix

Expert
Licensed User
Longtime User
In my Archiver libraries, I decided to raise all events in the same thread as the library, so your code in the event subs is run without delay after the event is raised. The drawback is that any code run outside the main thread of the application has to respect the following rules:
- no call to DoEvents
- no call to MessageBox
- no call to StartActivity
- no direct update of views (e.g. MyLabel.Text = ... is to avoid)
If you want to do the above, place your code in a different sub and call it from the event handler with CallSubDelayed. CallSubDelayed, unlike CallSub, does not run the sub at the time of the call. It places a message in a queue and the code is run only when the message is processed. That happens usually after the event code is run when a DoEvents is called in the main thread.
If you have a doubt on how to proceed, copy what's done in the demo of the libraries.
 

aidymp

Well-Known Member
Licensed User
Longtime User
Hi, I would like to add 3 folders to a zip! Using the ArchiverPlusZip lib

the structure is like so

MAINFOLDER
SUB1
SUB2
SUB3

I would like the zip once opened to only contain the 3 folders SUB1, SUB2, SUB3 I know I can zip the MAINFOLDER and it will include the 3 sub folders! but i dont want the zip to contain that folder, I just want the 3 subfolders, I also know I can add each folder 1 at a time (but havent tested that yet) Is there a simple way to add all 3 in one go?

Thanks

Aidy
 

Informatix

Expert
Licensed User
Longtime User
In the version 1.05 of ProBundle, I added a class to detect blocking of the main thread before the OS throws an ApplicationNotResponding error and I improved the serialization class of DataCollection (I removed the limitations for Maps and SparseArrays, I added functions to compress the byte array, I added the support of user defined types and of a few other objects, I reduced the size of arrays and I improved the conversion speed).

WARNING: byte arrays produced with the former version of the dcCollectionSerializer class are not compatible with this new version. I had to make important changes and it was not possible to keep the previous format.

As the number of donors for this bundle is still low (< 30), I think that's the last update before a while.

Changelog:
- I added the ANRWatchDog class to ErrorDetection to detect ApplicationNotResponding errors before they are thrown by the OS;
- I added a demo project to ErrorDetection;
- I improved the serialization class of DataCollection and added new functions to compress the resulting array of bytes;
- I made an internal change to ArchiverPlusZip (you should not notice any change).
 

Informatix

Expert
Licensed User
Longtime User
Hi, I would like to add 3 folders to a zip! Using the ArchiverPlusZip lib

the structure is like so

MAINFOLDER
SUB1
SUB2
SUB3

I would like the zip once opened to only contain the 3 folders SUB1, SUB2, SUB3 I know I can zip the MAINFOLDER and it will include the 3 sub folders! but i dont want the zip to contain that folder, I just want the 3 subfolders, I also know I can add each folder 1 at a time (but havent tested that yet) Is there a simple way to add all 3 in one go?

Thanks

Aidy
Arc.AddFolderToZip(Folder1, Archive, "")
Arc.AddFolderToZip(Folder2, Archive, "")
Arc.AddFolderToZip(Folder3, Archive, "")
 

Informatix

Expert
Licensed User
Longtime User
With the new version of dcCollectionSerializer, it is now possible to compress the byte arrays, so you could save a few kilobytes when generating a C library with SecVaultGenerator. If you want to, replace the two ...ToBytes functions in codGenerator.bas by ...ToCompressedBytes. And, of course, use the corresponding deserialization functions that uncompress the arrays (CompressedBytesTo...) in your code.
 

aidymp

Well-Known Member
Licensed User
Longtime User
Arc.AddFolderToZip(Folder1, Archive, "")
Arc.AddFolderToZip(Folder2, Archive, "")
Arc.AddFolderToZip(Folder3, Archive, "")

All at the same time? I was thinking it may need to be run consecutive. But will give it a go.

Thanks

Aidy
 
Top