Skip to main content
Inspiring
Feb 18, 2013 5:13 PM UTC
Question

Some iOS Native extensions that can be useful

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 is closed to new replies. Start a new post to keep the conversation going.

1 reply

Known Participant
Jun 4, 2013 8:11 PM UTC

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.

Translate