Modified FreeFlight 2.4.10 APK with game controller support

iOS Apps and Games for the AR.Drone. General Android discussions.

What should be the X button "secret feature"?

absolute control toggle
3
9%
return home
15
47%
map view
1
3%
flat trim
1
3%
emergency
11
34%
other (post your suggestion below)
1
3%
 
Total votes: 32

DevilsReject78
Ready for take off
Posts: 10
Joined: 24 Aug 2017, 14:54
Drone Type: Bebop 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by DevilsReject78 » 08 Sep 2017, 23:57

crackedlogic wrote:
09 Jun 2017, 12:39
Is anyone having problems downloading this? It won't let me download
Telling me corrupt any other place to get this

DevilsReject78
Ready for take off
Posts: 10
Joined: 24 Aug 2017, 14:54
Drone Type: Bebop 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by DevilsReject78 » 14 Sep 2017, 16:26

Telling me corrupt file.. anyone help

Darklo wrote:
08 Feb 2015, 19:58
TL/DR version:
FreeFlight 2.4.10 app modified with controller support and hover lock toggle, plus several fixes.


Get the APK here: viewtopic.php?f=75&t=8262&p=81189#p81188

(updated 13th April 2017)



The only reason Parrot keeps selling ARD 2.0 at this late stage in its lifecycle is because it fills the price gap between the Bebop and Rolling Spider.
It should be pretty obvious that there aren't going to be any more updates, neither firmware nor an app.
Director Mode on Android has been "coming soon" for what, 16 months now? At this point it should be rather "not coming, ever", and the FreeFlight app is now more or less in abandonware territory. But even though there are a number of excellent alternatives, if it could be improved, it could offer a lot of value.

So I thought it would be a good idea for the community to take over the development of the FreeFlight app and fix some of the longstanding bugs and introduce a couple of new features. Thanks to the amazing tools — smali and apktool — we're now able to freely modify the app and do (almost) anything. Editing smali code is very different from normal Java programming, and is a lot like assembly — you deal with registers instead of variables and control flow is affected by goto's and if-zero or if-not-zero jumps. But you can learn a lot about internal workings of Dalvik VM, and I actually had a lot of fun breaking the app apart and modifying it to my liking.
  • One feature that is an absolute must is hardware controller support (see controller mapping below). As it turns out, FreeFlight fully supports game controllers, as long as it runs on Nvidia Shield. There is literally a function isNvidiaShield() that is called every time a joystick or button event is processed:

    Code: Select all

        private boolean isNvidiaShield() {
            return Build.MODEL.equals("SHIELD") ? true : false;
        }
    As you probably guessed, if your device doesn't happen to be Shield, joystick movements and button presses are simply ignored. Well, that is simply ridiculous and our device choices should not be limited by Parrot's exclusive partnerships.
    Fortunately, it's also ridiculously easy to patch. The easy way, of course, would be to write "return true", but that wouldn't be very interesting. Better solution is to detect whether controller is plugged in when app is launched. Even better is to watch for hardware changes at runtime and modify the return value when controller is connected.
    As two added bonuses, you get a different splash screen if you start the app with controller; the touch screen controls react to controller presence and disappear as necessary (it's only a transparency change, so it's still possible to fly using touchscreen with controller connected).
  • Even if you have a Shield, you've probably noticed that joystick deadzone is very large (0.3 out of 1). If you push the stick slightly, nothing happens. If you push more, the drone suddenly lurches forward. As a result, controlling the drone becomes more difficult than it should be.
    Again, this is easy to patch. In this version hardcoded deadzone is removed, and the code relies on the value provided by Android. In addition, joystick response curves are now non-linear, improving precision at low speeds.
  • Another issue that also affects Shield owners is that the left stick is disabled in accelerometer mode (when you press and hold the shoulder button). This is correct if pitch/roll stick is on the left, but in left-handed mode this prevents you from controlling yaw and altitude, so this artificial limitation is also patched out.
  • Unlike touchscreen controls, where you can keep the finger on the roll/pitch button as the drone flies level, there is no equivalent for hardware controller. Well, here is a first: FreeFlight app with hover lock toggle! Click the pitch/roll thumbstick (left or right, depending on your settings) and the drone will no longer overcorrect as you release the stick, instead it will continue to glide smoothly. Click the stick again to turn hover lock back on. You'll see a brief message "Hover ON" (or "OFF"), so it's easy to tell which mode is active.

Here is a complete list of changes:
  1. increased max zoom in map downloader from 16x to 19x
  2. reduced joystick dead zone from 0.3 to 0.075
  3. increased param:video:codec_fps from 25 to 30 and param:video:max_bitrate from 1500 to 4000
  4. keep gas/yaw stick active in accelerometer mode (when shoulder button is pressed, in left-handed mode)
  5. added listener to detect controller presence and toggle controller mode (isNvidiaShield()) at runtime
  6. restored data collection opt-out setting
  7. added hover toggle to pitch/roll thumb stick
New in 20150312 version:
  1. fixed blurry photos in the photo/video viewer
  2. improvements to no hover mode
  3. fixed controller not working after being disconnected and reconnected again
  4. better handling of left-handed mode
  5. despaghettification of joystick code
  6. nonlinear joystick response curves
  7. removed hardcoded joystick deadzone, now the code uses only the value provided by Android
  8. added combined yaw toggle to gas/yaw thumb stick
  9. fixed restarting of com.parrot.freeflight.academy.services.restoremedia.RestoreFlightMediaService when exiting the app using back button

Controller mapping:
Since the Shield controller uses standard gamepad layout, every compatible controller should work. I tested with a Wikipad.
nvidia-shield-mapping copy.jpg

Please note that if you use "left-handed mode" (equivalent to RC Mode 2), both sticks and shoulder buttons are swapped. In that case, L1 (left shoulder) switches cameras and R1 (right shoulder) enables accelerometer. The easier way to think is that whatever stick you use to pitch/roll your drone, the shoulder button on the same side switches accelerometer control.
Triggers are unaffected, LT is video and RT is photo.

You may notice in the above image that Parrot labeled the X button as a "secret feature" in their original blog post. Well, the Shield owners have discovered that the button does in fact nothing. And now after decompiling the code, I can conclusively say that there is indeed no secret feature.
Although it's a small thing, Parrot lied to the customers. The good thing is that we can implement whatever we like, so I invite everyone to vote what the secret feature should be!


Patch notes:
As I don't have access to Parrot's private key, the APK is signed with the key from official SDK. As a result, instead of replacing the official app with patched version, you'll have to uninstall the official app first.

If you want to patch the APK yourself and make sure that I didn't bundle any malware, you can. The attached zip contains the shell script that does decompilation, patching, rebuilding and signing the APK. You should place the original named com.parrot.freeflight.apk in the same folder.

Requirements:
  • Linux or OS X (Windows users will need to get patch.exe from diffutils and translate the shell script to a .bat file)
  • Oracle JDK (JRE won't work)
  • apktool 2.0.0rc4
  • zipalign tool from Android SDK (not strictly necessary, but recommended by Google)

DevilsReject78
Ready for take off
Posts: 10
Joined: 24 Aug 2017, 14:54
Drone Type: Bebop 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by DevilsReject78 » 14 Sep 2017, 16:28

Saying file corrput cant instakl

AR.Tommy wrote:
13 Apr 2017, 08:42
Someone from the german board sent me the patched file. I'm attaching it to this post. Hope it helps.

KyokushinPL
Newcomer
Posts: 1
Joined: 21 Oct 2017, 21:04
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by KyokushinPL » 21 Oct 2017, 21:06

Is that version supports GPS flight controller?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests