FORUMS
Remove All Ads from XDA

[XPOSED][INTEL JOYING] 4 Xposed modules to tweak your Intel Sofia 3GR Joying unit

1,602 posts
Thanks Meter: 643
 
Post Reply Email Thread
Currently there are 4 Xposed modules available for the Joying Sofia 3GR Intel units.
All modules function on the Joying 6.0.1 stock ROMs (when rooted and with Xposed installed) or on the GTX custom ROMs (pre-rooted and pre-installed with Xposed)
Only the first module can *currently* be installed from my apk, as it is not my module. The other 3 my modules are avalaible on http://repo.xposed.info. The Xposed Installer on the unit can be used to install them. As the XSofiaTweaker is still Beta, you have to allow Betas in the Xposed Installer Settings.

GPSPeedFix: (stable)
This Xposed module is written by lbdroid. (lbdroids repository)
Since the Joying July 2017 ROMs, there is an error in the GPS Speed. The GPS HAL in the Joying Sofia 3GR units uses integers instead of floats to calculate the meters/second. This give speed steps of 3.6 km/hr, or actually rounded to 3 or 4 km/hr steps. This Xposed module calculates the right GPS speed and feeds it back to the "system", so that all dependent apps like navigation apps or GPS trackers can use the correct speed. (require full reboot on installation/activation)

XSofiaTweaker: (Stable).
This is a follow-up "project" on the SofiaServerCustomKeymod (See Gustdens post).
  • captures the hardware keys from the Joying unit and allows you to reprogram them. This must/can be configured from the Settings (sub)screen.
  • allows you to switch on/off the nokill.
  • allows you to unmute channel 4, which is used for Google voice feedback.
  • can act on the ACC_ON, ACC_OFF and Resume events.
  • option to prevent the Bluetooth app from staying full screen on top (thanks to @gtxaspec)
  • option to prevent the CANbus overlays popping up on heat/airco change or door(s) opening
  • Option to run system calls as root (Know what you do!)
  • Option to display the CPU temperature in the status bar next to the time
  • option to disable the yellow MCU errors overlay (in case this happens to you) (thanks to @RoNeReR)
  • supports a usb dac where volume control will be rerouted to stock android volume control (thanks to @RoNeReR)
  • eliminates feedback during the call if you have OK Google anywhere enabled (thanks to @gtxaspec)
Translated into Spanish (tOz-666), German (mitchum67), Russian (gorlexx @ 4pda), Dutch. Help translate in your own language.
Big thanks to @gustden who analyzed which functions to hook (or directly mod in his case). Note that this module is extended with the EQ and Eject key (when applicable).
Below this post are some images attached from the XSofiaTweaker.
Changelog in post #3.

SofiaServerNoKill: (Stable)
This Xposed module skips the SofiaServer "kill all apps" when going to sleep. This should replace the old nokill mod from Gustden.
Note: Some apps prevent the unit from going into deep-sleep by setting a "wakelock". The old SofiaServer simply killed these apps. This module doesn't do that. The MCU detects the apps using the wakelock to keep the CPU awake and the MCU will completely switch off the unit, resulting in a cold-boot upon switching on the contact. That is not the fault of this module. It is the fault of these bad behaving apps.
Big thanks to @gustden who analyzed which functions to hook (or directly mod in his case)

SofiaServerCustomKeyMod: (Stable)
This is a direct "functionality" copy of Gustdens CustomKeymod, but then as an Xposed module.
This Xposed module captures the hardware keys from the Joying unit and allows you to reprogram them. This should replace the custom key mod from Gustden. It mimics the same behavior and therefore also needs a launcher.sh. In contradiction to the mods of Gustden, these Xposed modules do not touch the original SofiaServer binary and are therefore firmware version independent.
Big thanks to @gustden who analyzed which functions to hook (or directly mod in his case) and how to apply them in the launcher.sh script
Attached Thumbnails
Click image for larger version

Name:	01-Settings-Main.png
Views:	1034
Size:	28.6 KB
ID:	4430365   Click image for larger version

Name:	02-Settings-Miscellaneous.png
Views:	998
Size:	24.7 KB
ID:	4430366   Click image for larger version

Name:	03-00-Settings-AppKeyMods.png
Views:	988
Size:	39.9 KB
ID:	4430367   Click image for larger version

Name:	03-01-Settings-AppKeyMods.png
Views:	1042
Size:	57.7 KB
ID:	4430368   Click image for larger version

Name:	03-02-Settings-AppKeyMods.png
Views:	1026
Size:	48.3 KB
ID:	4430369   Click image for larger version

Name:	04-Settings-AccOnOff.png
Views:	1004
Size:	39.6 KB
ID:	4430370   Click image for larger version

Name:	05-00-systemkeys.png
Views:	916
Size:	45.7 KB
ID:	4430371   Click image for larger version

Name:	05-01-systemkeys.png
Views:	896
Size:	57.0 KB
ID:	4430375   Click image for larger version

Name:	06-00-info.png
Views:	750
Size:	20.9 KB
ID:	4430376  
The Following 3 Users Say Thank You to surfer63 For This Useful Post: [ View ] Gift surfer63 Ad-Free
 
 
11th February 2018, 11:23 AM |#2  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 643
 
Donate to Me
More
XSofiaTweaker HowTo

Every button or event (acc_on/off) has a "Call method" and a "String to be used".

Currently there are 3 options to "start something" with the "Call method"
  • by package name
  • by intent (package name / intent)
  • by system call (terminal command(s) or script)
by package name: This is NOT the name of the apk but the internal package name. How do you get this "package name"? It is actually quite simple. Search in play.google.com for the app you want to start. Say you want to start the navigation app "Magic Earth" and you have selected that one in the play store (in a browser, not the android app). In the address bar you will then see "https://play.google.com/store/apps/details?id=com.generalmagic.magicearth". The bold part behind the "id=" is your package name.

by intent: Every app has a "launch" intent to start the app. Some apps can also be started with other intents to immediately start a specific function. Google Search can be started with the launch intent, but you can also start it with the Google Voice search option intent. The Google (Search) package name is "com.google.android.googlequicksearchbox", the specific intent for google voice search is "com.google.android.googlequicksearchbox.VoiceSear chActivity". The combined "String to be used" is therefore "com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity".
Another example is the Joying Bluetooth apk having intents for the dialer (default launch), the call receiver, the bluetooth streaming, the pairing and a few more.

by system call: A system call can be a direct (linux) command or a shell script or a binary (to do something).
= Commands can be a single command as in:
  1. "ls -l > /sdcard/some_file.txt" to capture a directory listing to a file
  2. "input keyevent 3" => Go to the Home screen (of the default launcher)
  3. "am start -a android.intent.action.MAIN -c android.intent.category.HOME" => Go to the Home screen (of the default launcher)
  4. "input keyevent 127" => pause active media player (any media player)
  5. "input key event 126" => (re)start last used media player.
  6. "am start com.syu.radio/com.syu.radio.Launch" => Start the radio app with the default launch intent (or better use "by package name": com.syu.radio; Or use "by intent": com.syu.radio/com.syu.radio.Launch)
As you can see from the 2nd and 3rd example, there are multiple ways to do something.
From the 6th example you can see that you can start an app (the radio) from the command line with "am start <full intent>", or by package name, or by intent directly.

= A system call can also be a number of commands separated by a ";".
Say you want to pause the media player and switch of the leds, when switching of the contact (ACC_OFF event), you can use as "String to use"
Code:
input keyevent 127; echo -n "h" > /sys/fytver/colorled
Upon switching on your car, you might want to continue your media player and switch on your leds to green
Code:
input keyevent 126; echo -n "b" > /sys/fytver/colorled
Note that you need to separate the commands with a ";" (a semi-colon without the quotes). I have currently no idea how long the entire command can be but I assume some system standard like 255, or 1024 or 2048 or 32767 or 65535, but I advise to use a script anyway when it gets that long (see next point)

= A system call can also be a call to a shell script
Say you want to pause the active media player and switch off the leds (like the example above), you can also put these commands (and 2-200? more) in a script like:
Code:
#!/system/bin/sh
input keyevent 127
echo -n "h" > /sys/fytver/colorled
You copy that script to a location where you can give it the execute bit (necessary on linux), which means not the internal or any external sdcard, but for example /data. You need adb, a rooted terminal or a rooted file manager to do that. Give it the execute rights like "chmod 755 my_great_script.sh"

Multi-tap options (preferred method)
Since version 1.22 the XSofiaTweaker directly supports double-tap and triple-tap options for hardware and steering wheel buttons, thanks to @gtxaspec.
Simply assign a call option and call entry to the double-tap and triple-tap option. The default delay is 300 ms, but this is user configurable via the "tap delay" setting.


Using NoKill and experiencing cold boots
The NoKill module/option in XSofiaTweaker is NOT the cause of the cold boots! Bad behaving apps keeping the CPU awake by setting a "wake lock", thereby preventing the unit to go into deep-sleep, are the cause. They make the MCU shutdown the unit completely after about 20 minutes.
The original sofiaServer app simply kills everything, so no problem there.
Especially some GPS, tasker and media player apps are bad behaving apps holding a "wake lock".
You can completely, safely use the NoKill option, but you should find those bad behaving apps and get rid of them, or kill them on going into deep-sleep using the ACC_OFF event and start them again using the ACC_ON event.

To kill an app on going into deep-sleep and start it when coming out of deep-sleep, AND to pause any mediaplayer on going into deep sleep, you can for example use the ACC_OFF option with a "system call".
Code:
am force-stop com.waze; input keyevent 127
And in the ACC_ON command to restart waze (in this case) and restart any media player on coming out of deep sleep:
Code:
am start com.waze/.MainActivity; input keyevent 126

Multi-tap options (deprecated method)
The customkeymod from Gustden and my sofiaservercustomkeymod xposed module both use the launcher script that enables multi-tap options.
The XSofiaTweaker does support that as well using a script approach by using a "by system call". But it is advised to use above mentioned method.

So lets say we want to capture the src/mode button and assign 3 apps to that by consecutive key-presses, and lets say we call our script "src_mode.sh"
Code:
#!/system/bin/sh

# Goto Home screen
home="input keyevent 3"
# my apps
app_no1="blah"
app_no2="blahblah"
app_no3="blahblahblah"


last=`cat /data/src_mode.cnt`
last=$((last+1))
case $last in
	1)
		echo $last > /data/src_mode.cnt
		(sleep .7 &&  [ `cat /data/src_mode.cnt` = $last ]  && echo 0 > /data/src_mode.cnt && ${app_no1} ) &
		;;
	2)
		echo $last > /data/src_mode.cnt
		(sleep .5 &&  [ `cat /data/src_mode.cnt` = $last ]  && echo 0 > /data/src_mode.cnt && ${app_no2} ) &
		;;
	3)
		echo 0 > /data/src_mode.cnt
		${app_no3}
		;;
	*)
		echo 0 > /data/src_mode.cnt
		$home
		;;

esac
;;
Save that script to /data as "src_mode.sh" (for example) and make it executable "chmod 755 src_mod.sh". Make the call method in the XSofiaTweaker "system call" and the string "/data/src_mod.sh"

Assign full launch intent calls to the ${app_no1} for your apps.
In case of google maps like
Code:
app_no1="am start com.google.android.apps.maps/com.google.android.maps.MapsActivity"
And use something more logical that "app_no1"

- Use an editor that can handle unix line ends/line feeds, so not notepad.
- Some of the "complaints" about the previous mods from gustden was the "delay". This was also caused by the multitap, as the scripts waits 0.7 seconds for the second tap, and 0.3 seconds for the 3rd tap. If you are a "fast tapper", you could reduce this to 0.5 and 0.3 (or 0.2) seconds.


(Will be further expanded)
The Following 3 Users Say Thank You to surfer63 For This Useful Post: [ View ] Gift surfer63 Ad-Free
11th February 2018, 05:21 PM |#3  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 643
 
Donate to Me
More
Changelogs
Changelog GPSSpeedFix:
  • 1.12 Fix int/float bug in GPSSpeedFix (thanks to IG_Vasilich)
  • 1.11
    • Switch from 5 moving average samples to 3 moving average samples to improve responsiveness on speed changes. (note: 2 samples and 1 sample simply work worse)
    • Remove appcompat layer library. Size reduction from 1.3MB to 98KB.
  • 1.1 fix bearing error (user jvdv): prevents the "jump all over the place and point into wrong direction" cursor when navigating.
  • 1.0 first version

Changelog XSofiaTweaker:
  • Version 1.26, 19 May 2018
    • Improved mute function for USB DAC mode (RoNeReR)
    • Improved and correct hook for the EQ button (RoNeReR)
    • Re-enable EQ button in the preferences
    • Add double-tap and triple-tap also to EQ button
  • Version 1.24, 11 May 2018
    • Really fix mode_src button configuration this time
  • Version 1.23, 08 May 2018
    • Correct typos in mode_src button settingsFragment
    • re-enable debugging messages
  • Version 1.22, 05 May 2018
    • next/previous/playpause functions work (gtxaspec)
    • Make double-tap, triple-tap functionality for keys internal instead of via a script (gtxaspec)
    • Updated German translation (mitchum67)
  • Version 1.21, 14 April 2018
    • improved USB DAC functioning (thanks to RoNeReR)
  • Version 1.20, 7 April 2018
    • Added Russian translation (thanks to gorlexx @ 4pda)
  • Version 1.19, 3 April 2018
    • eliminates feedback during the call if you have OK Google anywhere enabled (gtxaspec)
  • Version 1.18, 2 April 2018
    • Now supports a usb dac where volume control will be rerouted to stock android volume control (thanks to RoNeReR)
    • Create separate (sub) settings screen for CAN bus settings as it might expand (and users without CAN bus can skip it)
  • Version 1.17, 29 March 2018
    • option to disable the yellow MCU errors overlay (in case this happens to you) (thanks to RoNeReR)
  • Version 1.16, 28 March 2018
    • Option to display the CPU temperature in the status bar next to the time (It reads all 4 cores and displays the highest core temperature)
    • Dialog box to immediately do a soft reboot for the options that need it (not yet for HOME/MUTE as they are combined options. I have to think about those)
  • Version 1.15, 25 March 2018
    • Updated Spanish translation (thanks to tOz-666)
    • Made separate Settings screen for hardware buttons and for Steering wheel buttons
    • Added option to execute "system calls" under normal or root access. root access is necessary if you want to kill an app (for example upon ACC_OFF)
  • Version 1.14, 18 March 2018
    • Added German translation (thanks to mitchum67)
  • Version 1.13, 14 March 2018
    • Added option to prevent Bluetooth phone app from staying "full screen on top" during a call (thanks to gtxaspec)
    • Options to prevent Canbus overlays from being displayed on changes in heating/airco, door(s) opening (slightly improved to v1.1).
    • Remove appcompat layer library. Size reduction from 1.4MB to 195KB.
  • Version 1.11
    • bugfix: bt_phone button function used wrong key to call action to be executed
    • functionally identical to 1.1
  • Version 1.1
    • Added Spanish translation (tOz666) and Dutch translation.
    • Added options to disable CANbus overlay on heating/airconditioning change or door opened (untested; no canbus)
    • Modified BT/phone button hook (gtxaspec)
  • 1.0: First release
The Following 6 Users Say Thank You to surfer63 For This Useful Post: [ View ] Gift surfer63 Ad-Free
12th February 2018, 12:34 AM |#4  
Senior Member
Flag Chicago
Thanks Meter: 320
 
More
Looks like there has been great progress on these units with xposed, custom roms & twrp. I hope to get a chance to try it all out this week. Finally back home with access to my car

Great work guys!
The Following 4 Users Say Thank You to gustden For This Useful Post: [ View ] Gift gustden Ad-Free
12th February 2018, 07:00 AM |#5  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 643
 
Donate to Me
More
Quote:
Originally Posted by gustden

Looks like there has been great progress on these units with xposed, custom roms & twrp. I hope to get a chance to try it all out this week. Finally back home with access to my car

Great work guys!

Great to see you back!
When you say "finally back home" I hope your health is OK and that it's not your health that kept you away from home (and here) so long.

And yes, I finally picked up java.
12th February 2018, 08:58 AM |#6  
Senior Member
Flag Seattle, WA
Thanks Meter: 130
 
Donate to Me
More
Hey @surfer63, great work on this! Quick question, if I want to initiate the Google voice search, that intent do I use for com.google.android.search?
12th February 2018, 09:10 AM |#7  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 643
 
Donate to Me
More
Quote:
Originally Posted by bogdi1988

Hey @surfer63, great work on this! Quick question, if I want to initiate the Google voice search, that intent do I use for com.google.android.search?

For the customkeymod with launcher.sh "am start com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity"

For the XSofiaTweaker:
Use the "by intent (package name / intent)" with string "com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity"

Alternative 1, but some milliseconds slower: "by broadcast" with string "com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity"
Alternative 2, but some more miliseconds slower: "system call" with "am start com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity".

Somehow the "update on change" in the XSofiaTweaker does not work correctly (yet). It requires a soft boot from the Xposed installer (main page, "triple dot menu", soft boot")
12th February 2018, 09:15 AM |#8  
Senior Member
Flag Seattle, WA
Thanks Meter: 130
 
Donate to Me
More
Quote:
Originally Posted by surfer63

For the customkeymod with launcher.sh "am start com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity"

For the XSofiaTweaker:
Use the "by intent (package name / intent)" with string "com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity"

Alternative 1, but some milliseconds slower: "by broadcast" with string "com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity"
Alternative 2, but some more miliseconds slower: "system call" with "am start com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearc hActivity".


Somehow the "update on change" does not work correctly (yet). It requires a soft boot from the Xposed installer (main page, "triple dot menu", soft boot")

Thanks! I will give this a try in the morning! Last question, does the V5 rom include the Sofia no kill fix? Figured you'd know the answer to that :P
12th February 2018, 09:26 AM |#9  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 643
 
Donate to Me
More
Quote:
Originally Posted by bogdi1988

Thanks! I will give this a try in the morning! Last question, does the V5 rom include the Sofia no kill fix? Figured you'd know the answer to that :P

No, it does not. You can currently install it from my apk, or use the Xposed Installer on the ROM (preferred) as the NoKill and Customkeymod are already there.

Note: you mention the "Sofia no kill fix". The GPSSpeedFix is fixed, not the NoKill.
That fixed GPSSpeedFix is not in the V5, and due to the fact that it is installed as a system app, you currently need to install it via adb or a rooted file manager.
You can temporarily download the "fixed" GPSSpeedFix from here.
It contains the fix and uses 3 samples instead of 5. This should reduce the lag somewhat.

Edit: My new apk will support the system/app install from the gpsspeedfix.
12th February 2018, 09:34 AM |#10  
Senior Member
Flag Seattle, WA
Thanks Meter: 130
 
Donate to Me
More
Quote:
Originally Posted by surfer63

No, it does not. You can currently install it from my apk, or use the Xposed Installer on the ROM (preferred) as the NoKill and Customkeymod are already there.

Note: you mention the "Sofia no kill fix". The GPSSpeedFix is fixed, not the NoKill.
That one is not in the V5, and due to the fact that it is installed as a system app, you currently need to install it via adb or a rooted file manager.
You can temporarily download the "fixed" GPSSpeedFix from here.
It contains the fix and uses 3 samples instead of 5. This should reduce the lag somewhat.

Edit: My new apk will support the system/app install from the gpsspeedfix.

Awesome! And yes, the server no kill fix. The other I updated manually - Total Commander to the rescue! I tear with nostalgia each time I use it! 😂😂😂
12th February 2018, 10:01 AM |#11  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 643
 
Donate to Me
More
Quote:
Originally Posted by surfer63

Somehow the "update on change" in the XSofiaTweaker does not work correctly (yet). It requires a soft boot from the Xposed installer (main page, "triple dot menu", soft boot")

I found why it does not get updated. I use a broadcast to update (from the example), but I do not have a broadcast receiver. So now find a new example to implement that broadcast receiver
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes