download the ane : APKExpansionFilesv2.3.2  

if your app exceeded 50MB, you can add one or two expansion files ("main" and "patch") on Google Play Developer Console, each file can be up to 2GB.


if you want use the jobb tool (in the Android SDK)
encrypt your folder with the cmd
C:\Android\sdk\tools\jobb -d C:\folder\yourFolder\ -o C:\folder\air.com.example.MyApp\main.1000020.air.com.example.MyApp.obb -k secret-key -pn air.com.example.MyApp -pv 1000020
X

Android Obb is an application that lets you create Obb files for Android

Windows

or use this App for Windows

in your app
import flash.display.Sprite;
import flash.filesystem.File;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;
import com.nativeExtensions.apkExpansionFiles.APKCompleteEvent;
import com.nativeExtensions.apkExpansionFiles.APKExpansionFiles;
public function Main() {
  addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(evt:Event):void {
  var apkExpansionFiles:APKExpansionFiles = new APKExpansionFiles();
  apkExpansionFiles.addEventListener(APKCompleteEvent.APK_COMPLETE, onComplete);
  var BASE64_PUBLIC_KEY:String = "your_public_key";
  var mainVersion:String="1000020"; // the version of the APK that the file was uploaded
  var mainSize:String="18772022"; // the length of the file in bytes
  var mountMain:Boolean=true; // mount the obb file
  var secretKeyMain:String="secret-key"; //the secret jobb key
  //var patchVersion:String="1000020"; // the version of the APK that the file was uploaded
  //var patchSize:String="19619894"; // the length of the file in bytes
  //var mountPatch:Boolean=true; // mount the obb file
  //var secretKeyPatch:String="secret-key"; //the secret jobb key
  apkExpansionFiles.expansionFilesDelivered(BASE64_PUBLIC_KEY, true, mainVersion, mainSize, mountMain, secretKeyMain);
  //apkExpansionFiles.expansionFilesDelivered(BASE64_PUBLIC_KEY, true, mainVersion, mainSize, mountMain, secretKeyMain, patchVersion, patchSize, mountPatch, secretKeyPatch);
}
private function onComplete(e:APKCompleteEvent):void {
  var loader:Loader = new Loader();
  //var getExternalStorageDirectory:String = e.params.getExternalStorageDirectory; // the shared storage space
  var file:File = new File(e.params.outputDirMain+"myImage.jpg"); // the outpout Main folder
  //var file:File = new File(e.params.outputDirPatch+"myImage.jpg"); // the outpout Patch folder
  var request:URLRequest = new URLRequest(file.url);
  loader.load(request);
  this.addChild(loader);
}
- BASE64_PUBLIC_KEY : available on the Google Play Developer Console, see Services and APIs, it is recommended to encrypt the public key with an actionscript obfuscator.
- it is also recommended to encrypt the secretKeyMain and the secretKeyPatch with an actionscript obfuscator.

and in the app-desciptor.xml
<android>
  <colorDepth>16bit</colorDepth>
  <manifestAdditions>
    <![CDATA[
      <manifest>
        <uses-sdk android:minSdkVersion="9" /><!-- if you use jobb tool -->
        <uses-permission android:name="android.permission.PERMISSION_NAME" />
        <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.WAKE_LOCK" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <application android:enabled="true">
          <activity>
            <intent-filter>
              <action android:name="android.intent.action.MAIN"/>
              <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
          </activity>
          <service android:name="com.apk.expansion.downloader.APKDownloaderService" />
          <receiver android:name="com.apk.expansion.downloader.APKAlarmReceiver" />
          <activity android:launchMode="singleInstance" android:name="com.apk.expansion.downloader.APKDownloaderActivity"
          android:theme="@android:style/Theme.Dialog"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
          <uses-library android:name="org.apache.http.legacy" android:required="false" />
        </application>
      </manifest>
    ]]>
  </manifestAdditions>
</android>
<extensions>
  <extensionID>com.nativeExtensions.APKExpansionFiles</extensionID>
</extensions>



if you want use a zip file
import flash.display.Sprite;
import flash.filesystem.File;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;
import com.nativeExtensions.apkExpansionFiles.APKCompleteEvent;
import com.nativeExtensions.apkExpansionFiles.APKExpansionFiles;
public function Main() {
  addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(evt:Event):void {
  var apkExpansionFiles:APKExpansionFiles = new APKExpansionFiles();
  apkExpansionFiles.addEventListener(APKCompleteEvent.APK_COMPLETE, onComplete);
  var BASE64_PUBLIC_KEY:String = "your_public_key";
  var outputDir:String="/Android/data/"; // the outpout folder
  var mainVersion:String="1000020"; // the version of the APK that the file was uploaded
  var mainSize:String="18682320"; // the length of the file in bytes
  var mainUnzip:Boolean=true; // unzip the file
  //var patchVersion:String="1000020"; // the version of the APK that the file was uploaded
  //var patchSize:String="14923834"; // the length of the file in bytes
  //var patchUnzip:Boolean=true; // unzip the file
  apkExpansionFiles.expansionFilesDelivered(BASE64_PUBLIC_KEY, false, mainVersion, mainSize, mainUnzip, outputDir); // only main obb file
  //apkExpansionFiles.expansionFilesDelivered(BASE64_PUBLIC_KEY, false, mainVersion, mainSize, mainUnzip, outputDir, patchVersion, patchSize, patchUnzip); // main and patch obb files
}
private function onComplete(e:APKCompleteEvent):void {
  var loader:Loader = new Loader();
  //var getExternalStorageDirectory:String = e.params.getExternalStorageDirectory; // the shared storage space
  var file:File = new File(e.params.outputDirMain+"myImage.jpg"); // the outpout Main folder
  //var file:File = new File(e.params.outputDirPatch+"myImage.jpg"); // the outpout Patch folder
  var request:URLRequest = new URLRequest(file.url);
  loader.load(request);
  this.addChild(loader);
}



if you don't want use jobb or zip files, if your obb is a swf for example
import flash.display.Sprite;
import flash.filesystem.File;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;
import com.nativeExtensions.apkExpansionFiles.APKCompleteEvent;
import com.nativeExtensions.apkExpansionFiles.APKExpansionFiles;
public function Main() {
  addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private var mainVersion:String="1000020"; // the version of the APK that the file was uploaded
//private var patchVersion:String="1000020"; // the version of the APK that the file was uploaded
private function onAddedToStage(evt:Event):void {
  var apkExpansionFiles:APKExpansionFiles = new APKExpansionFiles();
  apkExpansionFiles.addEventListener(APKCompleteEvent.APK_COMPLETE, onComplete);
  var BASE64_PUBLIC_KEY:String = "your_public_key";
  var mainSize:String="18682320"; // the length of the file in bytes
  var mainUnzip:Boolean=false; // unzip the file
  //var patchSize:String="14923834"; // the length of the file in bytes
  //var patchUnzip:Boolean=false; // unzip the file
  apkExpansionFiles.expansionFilesDelivered(BASE64_PUBLIC_KEY, false, mainVersion, mainSize, mainUnzip); // only main obb file
  //apkExpansionFiles.expansionFilesDelivered(BASE64_PUBLIC_KEY, false, mainVersion, mainSize, mainUnzip, null, patchVersion, patchSize, patchUnzip); // main and patch obb files
}
private function onComplete(e:APKCompleteEvent):void {
  var mainObbFile:File = new File(e.params.getExternalStorageDirectory+"/Android/obb/"+e.params.packageName+"/main."+mainVersion+"."+e.params.packageName+".obb");
  var loader:Loader = new Loader();
  var request:URLRequest = new URLRequest(mainObbFile.url);
  loader.load(request);
  this.addChild(loader);
}






Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/171/sdb/f/2/pol2095/Air_APKExpansionFiles/index.php on line 332

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/171/sdb/f/2/pol2095/Air_APKExpansionFiles/index.php on line 350
comment

Name :


Email (not published) :


Comment :

Allowed markup: [html]