-
Notifications
You must be signed in to change notification settings - Fork 25
/
install_mod.bat
166 lines (161 loc) · 7.27 KB
/
install_mod.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@echo off
IF EXIST check_1860_state.sh DEL /F check_1860_state.sh
echo(
echo You can continue if your DJI device connected and ADB enabled
echo(
echo Please read "How to install" http://github.com/jkson5/jkson_fcc_mod
echo(
Pause
echo(
echo 1 - Mavic PRO/Platinum (1.04.0300 and lower)
echo 2 - Phantom 4PROv2 (1.00.22.00 and lower)
echo 3 - Other
echo(
choice /C 123 /D 1 /T 99 /M "Please select connected device"
If Errorlevel 3 Goto Sorry
If Errorlevel 2 Goto P4PV2
If Errorlevel 1 Goto MP
:MP
echo #!/system/bin/sh > check_1860_state.sh
echo /system/bin/check_1860_state.sh^& >> check_1860_state.sh
echo busybox ping -c 1 -w 1800 192.168.41.2 >> check_1860_state.sh
echo sleep 5 >> check_1860_state.sh
echo(
echo 1 - Auto frequency (Default)
echo 2 - Force frequency to 2.3G (not compatible with DJI Goggles)
echo 3 - Force frequency to 2.5G (not compatible with DJI Goggles)
echo 4 - DELETE this mod from DJI device
echo(
choice /C 1234 /D 1 /T 99 /M "Please select frequency"
If Errorlevel 4 Goto AdbRemove
If Errorlevel 3 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00014600FFFF92040000 >> check_1860_state.sh
If Errorlevel 3 Goto EndFreq
If Errorlevel 2 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00014600FFFFA2030000 >> check_1860_state.sh
:EndFreq
echo(
echo 1 - Default power
echo 2 - Default^>FCC^>Boost^>Reset loop selector by Remote controller
echo 3 - Fixed FCC
echo 4 - Fixed FCC + Boost
echo 5 - Fixed FCC with True FPV gimbal selector
echo 6 - Fixed FCC + Boost with True FPV gimbal selector
echo(
choice /C 123456 /D 1 /T 99 /M "Please select mod"
If Errorlevel 6 echo sdr_loop() >> check_1860_state.sh
If Errorlevel 6 echo ^{ >> check_1860_state.sh
If Errorlevel 6 echo while : >> check_1860_state.sh
If Errorlevel 6 echo do >> check_1860_state.sh
If Errorlevel 6 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00024800FFFF0200000000 >> check_1860_state.sh
If Errorlevel 6 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 3c >> check_1860_state.sh
If Errorlevel 6 echo sleep 10 >> check_1860_state.sh
If Errorlevel 6 echo done >> check_1860_state.sh
If Errorlevel 6 echo ^} >> check_1860_state.sh
If Errorlevel 6 echo sdr_loop^& >> check_1860_state.sh
If Errorlevel 6 echo logcat ^| grep -FEm 1 ', 0, 0, 1, 1, 0, 0, ., ., 0, 0, ., 0, 0, 0, ..' >> check_1860_state.sh
If Errorlevel 6 echo while : >> check_1860_state.sh
If Errorlevel 6 echo do >> check_1860_state.sh
If Errorlevel 6 echo dji_mb_ctrl -R diag -g 4 -s 4 -c 3d 0232 >> check_1860_state.sh
If Errorlevel 6 echo sleep 10 >> check_1860_state.sh
If Errorlevel 6 echo done >> check_1860_state.sh
If Errorlevel 6 Goto EndMod
If Errorlevel 5 echo sdr_loop() >> check_1860_state.sh
If Errorlevel 5 echo ^{ >> check_1860_state.sh
If Errorlevel 5 echo while : >> check_1860_state.sh
If Errorlevel 5 echo do >> check_1860_state.sh
If Errorlevel 5 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00024800FFFF0200000000 >> check_1860_state.sh
If Errorlevel 5 echo sleep 10 >> check_1860_state.sh
If Errorlevel 5 echo done >> check_1860_state.sh
If Errorlevel 5 echo ^} >> check_1860_state.sh
If Errorlevel 5 echo sdr_loop^& >> check_1860_state.sh
If Errorlevel 5 echo logcat ^| grep -FEm 1 ', 0, 0, 1, 1, 0, 0, ., ., 0, 0, ., 0, 0, 0, ..' >> check_1860_state.sh
If Errorlevel 5 echo while : >> check_1860_state.sh
If Errorlevel 5 echo do >> check_1860_state.sh
If Errorlevel 5 echo dji_mb_ctrl -R diag -g 4 -s 4 -c 3d 0232 >> check_1860_state.sh
If Errorlevel 5 echo sleep 10 >> check_1860_state.sh
If Errorlevel 5 echo done >> check_1860_state.sh
If Errorlevel 5 Goto EndMod
If Errorlevel 4 echo while : >> check_1860_state.sh
If Errorlevel 4 echo do >> check_1860_state.sh
If Errorlevel 4 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00024800FFFF0200000000 >> check_1860_state.sh
If Errorlevel 4 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 3c >> check_1860_state.sh
If Errorlevel 4 echo sleep 10 >> check_1860_state.sh
If Errorlevel 4 echo done >> check_1860_state.sh
If Errorlevel 4 Goto EndMod
If Errorlevel 3 echo while : >> check_1860_state.sh
If Errorlevel 3 echo do >> check_1860_state.sh
If Errorlevel 3 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00024800FFFF0200000000 >> check_1860_state.sh
If Errorlevel 3 echo sleep 10 >> check_1860_state.sh
If Errorlevel 3 echo done >> check_1860_state.sh
If Errorlevel 3 Goto EndMod
If Errorlevel 2 echo while : >> check_1860_state.sh
If Errorlevel 2 echo do >> check_1860_state.sh
If Errorlevel 2 echo logcat ^| grep -FEm 1 ', 0, 0, 1, 1, 0, 0, ., ., 0, 0, ., 0, 0, 0, ..' >> check_1860_state.sh
If Errorlevel 2 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00024800FFFF0200000000 >> check_1860_state.sh
If Errorlevel 2 echo sleep 5 >> check_1860_state.sh
If Errorlevel 2 echo logcat ^| grep -FEm 1 ', 0, 0, 1, 1, 0, 0, ., ., 0, 0, ., 0, 0, 0, ..' >> check_1860_state.sh
If Errorlevel 2 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 3c >> check_1860_state.sh
If Errorlevel 2 echo sleep 5 >> check_1860_state.sh
If Errorlevel 2 echo logcat ^| grep -FEm 1 ', 0, 0, 1, 1, 0, 0, ., ., 0, 0, ., 0, 0, 0, ..' >> check_1860_state.sh
If Errorlevel 2 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 >> check_1860_state.sh
If Errorlevel 2 echo sleep 10 >> check_1860_state.sh
If Errorlevel 2 echo done >> check_1860_state.sh
If Errorlevel 2 Goto EndMod
If Errorlevel 1 Goto EndMod
:EndMod
Goto AdbSet
:P4PV2
echo #!/system/bin/sh > check_1860_state.sh
echo /system/bin/check_1860_state.sh^& >> check_1860_state.sh
echo busybox ping -c 1 -w 1800 192.168.41.2 >> check_1860_state.sh
echo sleep 5 >> check_1860_state.sh
echo(
echo 1 - Auto frequency (Default)
echo 2 - Force frequency to 2.3G
echo 3 - Force frequency to 2.5G
echo 4 - DELETE this mod from DJI device
echo(
choice /C 1234 /D 1 /T 99 /M "Please select frequency"
If Errorlevel 4 Goto AdbRemove
If Errorlevel 3 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00014600FFFF92040000 >> check_1860_state.sh
If Errorlevel 3 Goto P4PV2EndFreq
If Errorlevel 2 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00014600FFFFA2030000 >> check_1860_state.sh
:P4PV2EndFreq
echo(
echo 1 - Default power
echo 2 - Fixed FCC
echo 3 - Fixed FCC and Boost
echo(
choice /C 123 /D 1 /T 99 /M "Please select mod"
If Errorlevel 3 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00024800FFFF0200000000 >> check_1860_state.sh
If Errorlevel 3 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 3c >> check_1860_state.sh
If Errorlevel 3 Goto P4PV2EndMod
If Errorlevel 2 echo dji_mb_ctrl -S test -R local -g 9 -s 9 -c 27 00024800FFFF0200000000 >> check_1860_state.sh
:P4PV2EndMod
Goto AdbSet
:AdbSet
dos2unix.exe check_1860_state.sh
@echo on
adb shell busybox mount -o remount,rw /vendor
adb shell mkdir /vendor/bin
adb shell chmod 755 /vendor/bin
adb push check_1860_state.sh /vendor/bin/check_1860_state.sh
adb shell chmod 755 /vendor/bin/check_1860_state.sh
@echo off
echo(
echo Jkson Mod with selected parameters has been sent! Please restart your device.
echo(
Goto End
:AdbRemove
@echo on
adb shell busybox mount -o remount,rw /vendor
adb shell rm /vendor/bin/check_1860_state.sh
@echo off
echo(
echo Jkson Mod has been removed! Please restart your device.
echo(
Goto End
:Sorry
echo Sorry, but this mod compatible only with listed devices...
echo(
:End
Pause