Skip to main content
Inspiring
February 18, 2013
Question

Some iOS Native extensions that can be useful

  • February 18, 2013
  • 1 reply
  • 1087 views

Hi,

I have made some iOS Native extensions that can be useful.

You can find it at https://github.com/xperiments?tab=repositories

ANE7z

=> Adobe AIR iOS Native Extension to decompres 7z files.

ANEZipFile

=> Adobe AIR iOS Native Extension to zip/unzip files.

ANEFileSyncInterface

=> A micro http server with FileManagement capabilities Native Extension

IOSSystemUtils

=> Adobe Air IOS Native Extension to control Brightness / Torch / Badge

ANEUnRar

=> Adobe Air Native Extension to Obj-C UnRar Lib

Please give me your comments

This topic has been closed for replies.

1 reply

Known Participant
June 4, 2013

First of all, thank you for creating this extension. However, it doesn't seem to work. Below is my code for decompressing ByteArray (error handling is stripped for simplicity):

                    public function decompress(aData:ByteArray):ByteArray {

                              // Save data to file

                              var fileInput:File = File.applicationStorageDirectory.resolvePath("input.7z");

                              var stream:FileStream = new FileStream();

                              stream.open(fileInput, FileMode.WRITE);

                              stream.writeBytes(aData);

                              stream.close();

                              var folderOutput:File = File.applicationStorageDirectory.resolvePath("output");

                              ANE7z.decompress(fileInput, folderOutput);

                              var files:Array = folderOutput.getDirectoryListing();

                              for each (var fileOutput:File in files) {

                                        trace("Extracted file: " + fileOutput.nativePath);

                                        if (!fileOutput.isDirectory) {

                                                  var bytes:ByteArray = new ByteArray();

                                                  stream = new FileStream();

                                                  stream.open(fileOutput, FileMode.READ);

                                                  stream.readBytes(bytes);

                                                  stream.close();

                                                  bytes.position = 0;

                                                  return bytes;

                                        }

                              }

                              return null;

                    }

The problem is folderOutput.getDirectoryListing() always returns an empty array.