Community
cancel
Showing results for 
Search instead for 
Did you mean: 
lucas_b_
Beginner
37 Views

is it possible ?

Hello there,

 

i have an old app,which i lost all of it's xdk files,but i have it's apk and i think it's on the servers because i built it once,so is it possible to get my xdk files from the servers or opening that apk with xdk directly ? and how to do both if possible .

Tags (2)
0 Kudos
1 Reply
PaulF_IntelCorp
Employee
37 Views

We do not store your projects on our servers for any long period of time, just long enough to perform the build or send to App Preview. Your source code is located inside of the APK and IPA files you built. You'll have to recreate the project settings, but you have all of the source if you have the APK. Just rename the APK to ZIP, for example from "my-app.apk" to "my-app.apk.zip" and then unzip the file using your favorite archive tool. For example, the contents of an APK based on the "hello-cordova" sample:

Screen Shot 2017-03-29 at 16.16.16 .png

NOTE: the "cordova-js-src" folder was added by Cordova, it is not part of the original source for this sample project. Likewise, the cordova.js and the cordova_plugins.js files were added by Cordova. The remaining files and folders within the "www" folder were directly copied from the original project's "www" folder.

You can start a new project using the blank template and copy the source code from inside the APK's www folder into that project's www folder. You can also see which plugins were included in the APK by inspecting the plugins folder or inspecting the cordova_plugins.js file that was added to the APK. At the very end of the cordova_plugins.js file is a list of plugins that were added and the specific versions of those plugins. For example, from the APK above, that is based on the "hello-cordova" sample, the last lines from the cordova_plugins.js file:

module.exports.metadata = 
// TOP OF METADATA
{
    "cordova-plugin-crosswalk-webview": "1.5.0",
    "cordova-plugin-device-orientation": "1.0.3",
    "cordova-plugin-device": "1.1.2",
    "cordova-plugin-compat": "1.1.0",
    "cordova-plugin-geolocation": "2.2.0",
    "cordova-plugin-inappbrowser": "1.4.0",
    "cordova-plugin-splashscreen": "3.2.2",
    "cordova-plugin-dialogs": "1.2.1",
    "cordova-plugin-statusbar": "2.1.3",
    "cordova-plugin-file": "4.2.0",
    "cordova-plugin-media": "2.3.0",
    "cordova-plugin-device-motion": "1.2.1",
    "cordova-plugin-vibration": "2.1.1",
    "cordova-plugin-whitelist": "1.2.2"
};

NOTE: in the list above, the "cordova-plugin-whitelist" and "cordova-plugin-crosswalk-webview" plugins were added automatically by the Intel XDK and, likewise, will be added automatically by the Intel XDK Cordova export tool, so you do not need to add these two plugins to your rebuilt project.

If you were using Crosswalk, you may see a "xwalk-command-line" file in the APK, the contents of that file are the Crosswalk initialization commands that were provided, for example, from this same sample app:

xwalk --ignore-gpu-blacklist --disable-pull-to-refresh-effect 

Beyond that, you can inspect the AndroidManifest.xml file to find a few other things, like the version numbers. For example, if you have Android Studio installed on your system, you can use the "aapt" command to inspect the contents of your APK. The most useful being the version codes and the package name, as shown below:

$ aapt list -a my-app.apk | fgrep -i version
    ...lines deleted for clarity...
    A: android:versionCode(0x0101021b)=(type 0x10)0x1c
    A: android:versionName(0x0101021c)="16.5.16" (Raw: "16.5.16")
    A: platformBuildVersionCode=(type 0x10)0x17 (Raw: "23")
    A: platformBuildVersionName="6.0-2704002" (Raw: "6.0-2704002")
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0xe
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x15

$ aapt list -a my-app.apk | fgrep package
Package Group 0 id=0x7f packageCount=1 name=xdk.intel.hellocordova
    A: package="xdk.intel.hellocordova" (Raw: "xdk.intel.hellocordova")

 

Reply