Welcome Mavic Pilot!
Jump in and join our free DJI Mavic community today!
Sign up

[Mavic Mini] Re enable developer tools in DJI Assistant 2

Joined
Feb 11, 2018
Messages
15
Reaction score
9
Age
37
I've been playing around with the DJI Assistant 2 with the Mini and figured out how to enable the developer tools back. I wasn't able to do much with them but maybe someone can figure out how to write the config params like in the other Mavics?

Assistant still is an Electron based application but now everything is "compiled" into an asar file. So first you need to decompile it with:

npx asar extract app.asar app

Then you'll have to edit two lines in main.js

var debug = false

Change it to true.
And uncomment the developer tools line:

mainWindow.webContents.openDevTools()

If you compile this folder into an asar, replace the original asar file and run Assistant , you'll see a new button onthe top left corner that says "Developer tools":



If you click it and open electron's dev tools (CTRL SHIFT I if im not mistaken) you'll see it's trying to find the file "tools.html". It's is not packaged anymore with Assistant. But you can import it from Assistant 1.1.2! Google it, unpack the asar and import the following files:


Code:
./build/base.css
./build/a3.css
./build/tools.css
./build/locale.js
./build/utils.js
./build/ws.js
./build/dass.js
./build/tools.js
Some files might already exist in your newer asar file, don't replace them. Once you added those files, repackage the folder with

asar pack ./app app-tools-hack.asar

Replace the original asar folder, start assistant, plug your mini and click developer tools.

You'll see somehting like this:




Click on open connection and send this payload:

{“SEQ”:“123456”,“CMD”:“}

You'll get back a base64 string that seems to be encrypted.

Things to think about:

1) How to decrypt what assistant sends back
2) Can we send parameters and write to the mini?
3) Can we enable/disable cool things?

Hopefully someone smarter than me can figure this out. Let me know if something is not clear to you.
 
Joined
Feb 11, 2018
Messages
15
Reaction score
9
Age
37
Nope, nothing happens when you plug the mini while running 1.1.2.

I tried to import all the wm160 files to the 1.1.2 asar and still nothing
 

msinger

DJI Drone Expert
Approved Vendor
Premium Pilot
Joined
Oct 12, 2016
Messages
21,160
Reaction score
11,535
Location
Harrisburg, PA (US)
Joined
Feb 11, 2018
Messages
15
Reaction score
9
Age
37
Found the decryption key, its right there inside ws-v2.js. Search for secret_key_dec. Mini returns a huge list of functions, some of them start with "preHash". No references to nfz or airport. Wonder if we can do something interesting with that.
 
Joined
Feb 11, 2018
Messages
15
Reaction score
9
Age
37
secret_key_enc can be used to send commands to the mini. So far when trying to read anything ({"SEQ":"123456","CMD":"read","INDEX":"g_config_go_home_fixed_go_home_altitude"}) I'm getting "ERROR_STEP_CODE":1,"ERROR_SUB_CODE":10,"ERROR_TYPE_CODE":4
 
  • Like
Reactions: Sali

Evmoius

New Member
Joined
Dec 3, 2019
Messages
2
Reaction score
5
Age
39
Location
CA
Hoping this leads somewhere. I just got my Mini today and I'm already interested in hacking it...waypoints anyone? Maybe higher bitrates and use of the full 4k sensor?

Brand new to DJI so I'm not sure how they handle these things yet.
 

Blade slap

Active Member
Joined
Dec 5, 2016
Messages
37
Reaction score
27
Age
65
Me too I try to modify the assistant 2.08 or 2.010 unpacking asar and write mod , but better another way:
With Python command : a) install python on your pc , b) install dji-firmware-tools o-gs/dji-firmware-tools , inside you found the latest comm_og_service_tool.py updated with mavic 2 and mini mavic (wm160) then sending command from window , using python you can read parameter and change .
in order to read : C:\........\dji-firmware-tools-master\comm_og_service_tool.py -vvv com5 WM160 FlycParam getvert_vel_down_adding_max --alt
In order to write : C:\.........\dji-firmware-tools-master\comm_og_service_tool.py -vvv com5 WM160 FlycParam setvert_vel_down_adding_max -7 --alt as example to write -7 at the vel_down parameter ......same for other parameter including battery_type
Default Value Min Max Parameter index
battery_type 1 0 3 960
 

bebbe

Active Member
Joined
Nov 21, 2019
Messages
43
Reaction score
33
Age
43
Location
Sweden
This is interesting! I got a feeling that the MM has alot more to give. Like signal strength and so on. Sometimes it is so rocksolid on the signal and sometimes it is not. And this is in the same place?

My other drones that I built myself act like this if I change the watt on the signal. Wondering if Dji have a SW that regulate this?
 

Blade slap

Active Member
Joined
Dec 5, 2016
Messages
37
Reaction score
27
Age
65
In any case me too I try to found the way1575370004597.png to enter in debug mode ....but until now I arrived only here
 
Joined
Feb 11, 2018
Messages
15
Reaction score
9
Age
37
Me too I try to modify the assistant 2.08 or 2.010 unpacking asar and write mod , but better another way:
With Python command : a) install python on your pc , b) install dji-firmware-tools o-gs/dji-firmware-tools , inside you found the latest comm_og_service_tool.py updated with mavic 2 and mini mavic (wm160) then sending command from window , using python you can read parameter and change .
in order to read : C:\........\dji-firmware-tools-master\comm_og_service_tool.py -vvv com5 WM160 FlycParam getvert_vel_down_adding_max --alt
In order to write : C:\.........\dji-firmware-tools-master\comm_og_service_tool.py -vvv com5 WM160 FlycParam setvert_vel_down_adding_max -7 --alt as example to write -7 at the vel_down parameter ......same for other parameter including battery_type
Default Value Min Max Parameter index
battery_type 1 0 3 960

Smart! Have you tried this on linux? For some reason I cannot connect to the websocket in linux.
I'll try it out today. Thanks!
 
Joined
Feb 11, 2018
Messages
15
Reaction score
9
Age
37
In any case me too I try to found the wayView attachment 87175 to enter in debug mode ....but until now I arrived only here
Thats all you can enable! You can send commands in the window weith the "socket url" box. Theres a box next to it that allows you to send stuff to the drone. Bear in mind that i has to be necrypted first with the secret_key_enc key
 

Blade slap

Active Member
Joined
Dec 5, 2016
Messages
37
Reaction score
27
Age
65
Do you kn
I've been playing around with the DJI Assistant 2 with the Mini and figured out how to enable the developer tools back. I wasn't able to do much with them but maybe someone can figure out how to write the config params like in the other Mavics?

Assistant still is an Electron based application but now everything is "compiled" into an asar file. So first you need to decompile it with:

npx asar extract app.asar app

Then you'll have to edit two lines in main.js

var debug = false

Change it to true.
And uncomment the developer tools line:

mainWindow.webContents.openDevTools()

If you compile this folder into an asar, replace the original asar file and run Assistant , you'll see a new button onthe top left corner that says "Developer tools":



If you click it and open electron's dev tools (CTRL SHIFT I if im not mistaken) you'll see it's trying to find the file "tools.html". It's is not packaged anymore with Assistant. But you can import it from Assistant 1.1.2! Google it, unpack the asar and import the following files:


Code:
./build/base.css
./build/a3.css
./build/tools.css
./build/locale.js
./build/utils.js
./build/ws.js
./build/dass.js
./build/tools.js
Some files might already exist in your newer asar file, don't replace them. Once you added those files, repackage the folder with

asar pack ./app app-tools-hack.asar

Replace the original asar folder, start assistant, plug your mini and click developer tools.

You'll see somehting like this:




Click on open connection and send this payload:

{“SEQ”:“123456”,“CMD”:“}

You'll get back a base64 string that seems to be encrypted.

Things to think about:

1) How to decrypt what assistant sends back
2) Can we send parameters and write to the mini?
3) Can we enable/disable cool things?

Hopefully someone smarter than me can figure this out. Let me know if something is not clear to you.
Do you know that you don't need to repack asar file is enought to replace one string in tha package.json

{
"name": "DJIAssistant2",
"version": "0.0.1",
"main": "main.js",
"scripts": {
"start": "electron ."
}
}

in this case you adress to direct to main and not to asar , so will be enough to put all asar file in DJIApp folder see image
but be carful you need to add the mini file wm160
1575370641722.png
 

Blade slap

Active Member
Joined
Dec 5, 2016
Messages
37
Reaction score
27
Age
65
I hope to found the way with assistant , because i recognize that python for many people is not easy ....but with python is possible to modify all visible mini parameter i can assure you
 
Joined
Feb 11, 2018
Messages
15
Reaction score
9
Age
37
Indeed it's way easier with the script you shared. Of course going above the range of values gets ignored by the drone (I've sent 501 to "g_config.flying_limit.max_height_0" and 500 gets written into that property)
 

Blade slap

Active Member
Joined
Dec 5, 2016
Messages
37
Reaction score
27
Age
65
Unfortunately ...clear not possible to change max height or nfz ...is like air
 

New Threads

Forum statistics

Threads
73,595
Messages
852,508
Members
100,771
Latest member
loki_jr_