User Tools

Site Tools


howto:app.asar

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:app.asar [2017/08/06 23:06]
czokie
howto:app.asar [2019/04/14 20:04] (current)
digdat0 formatting, done
Line 1: Line 1:
 ====== Exploring app.asar ====== ====== Exploring app.asar ======
-  * install "DJI Assistant 2" 
-  * get "app.asar" file from its install dir to a linux env 
-  * prepare linux env for the node scripts 
  
-  sudo apt install npm nodejs-legacy+===== MacOS =====
  
-  * install and use asar+This document describes how to unpack the contents of app.asar, which is one of the components of Dji Assistant. The instructions below assume you are running on OSX. Most of these instructions will readily translate to most Linux variants.
  
-  npm install asar +==== 1. Toolchain ==== 
-  ./node_modules/asar/bin/asar.js e app.asar ./app.asar.extr+Install your toolchain as per the instructions [[.:toolchain|here]]You only need to do this once... but check the instructions to see if there are any new tools that you may need.
  
-  * install and use js standard formatter+==== 2. Install DJI assistant ==== 
 +Install [[https://www.dji.com/mavic/info#downloads|DJI assistant from here]] if it is not already installed.
  
-  npm install standard --save-dev +==== 3. Extract the ASAR file ==== 
-  ./node_modules/standard/bin/cmd.js --fix "./app.asar.extr/**/*.js"+  cd ~/Documents/nodejs 
 +  ./node_modules/asar/bin/asar.js e /Applications/Assistant.app/AppFiles/app.asar ./app.asar.extr
  
-The output is some interesting files which can help in understanding communication to DJI equipment.+==== 4Format the results ====
  
-fixme Add some brew equivalent commands+  ./node_modules/standard/bin/cmd.js --fix "./app.asar.extr/**/*.js"
  
-===== Credits =====+The output is some interesting files which can help in understanding how DJI assistant works. 
 + 
 +==== Credits ====
   * https://github.com/mefistotelis/phantom-firmware-tools/issues/25   * https://github.com/mefistotelis/phantom-firmware-tools/issues/25
 +
 +====== Windows ======
 +
 +On Windows, you can still use the Node.js method shown above (with varying steps); or you can go an easier route and use 7-Zip with a plugin called Asar7z. This allows you to easily open the app.asar file similar to a compressed file (.zip, .rar, tar, etc) and save changes without needing a complex process.
 +
 +==== 1.  Download and Install 7zip and plugin ====
 +
 +  * 7zip: https://www.7-zip.org/download.html
 +  * Asar7z: http://www.tc4shell.com/en/7zip/asar/
 +
 +Open and run the 7zip installer. Follow the prompts.
 +
 +==== 2.  Extract the plugin ====
 +
 +Follow these steps to install the plugin file. Close 7-zip and then:
 +
 +  * Navigate to C:\Program Files\7-Zip
 +  * Create a new folder named, "Formats"
 +  * Open the Asar7z file you downloaded earlier
 +  * Extract the contents of the Asar7z file to the newly created formats folder above, this will be C:\Program Files\7-Zip\Formats\
 +
 +Now, each time you launch 7-Zip, it will automatically find Asar7z and use it when opening .asar files.
 +
 +==== 3.  Open the app.asar file ====
 +
 +Now that you have installed the app plugin, open 7zip. Within 7zip, navigate to C:\Program Files (x86)\DJI Product\DJI Assistant 2\AppFiles and you will find app.asar. You can open this file with 7zip. 
 +
 +You can either extract the contents to a destination, or find files and edit within 7zip. If you extract the files, you will need to re-compile the archive (which I'm not going into detail here). If you edit from within 7zip, files will be saved to the current app.asar, no need to recompress.
 +
 +Screenshot showing app.asar open in 7zip
 +
 +
 +{{:howto:appsasar4.png?400|}}
howto/app.asar.1502060812.txt.gz · Last modified: 2017/08/06 23:06 by czokie