yashsingh1/xdaforums huggingface dataset:
[FYT Android Head Units] surfer63:
Stupid error. I on purposely made the preference key slightly different for ACC_ON/OFF and RESume, as they are events not keys.

But I called them like I called the buttons. That didn't work of course.

And as the SofiaServerCustomKeyMod works the "old fashioned" way via the script, it did not occur there.

Need to do some testing, but it is again so cold and it will even get colder. :(

(and both my usb wires are at full length behind my dash. No simple extract/replace of the unit.)
[FYT Android Head Units] gtxaspec:
Did you get the root working with the added method?

Also I checked, the MCU doesn't touch the LEDs, they are SoM controlled (from the bootloader to the kernel) so the sys files method works fine.
[FYT Android Head Units] gtxaspec:
My fault, had to reboot one more time. Works well with no log errors.
[FYT Android Head Units] gtxaspec:
my xposed wish/todo list (this will carry over to px5):

*prevent sofia server from shutting off video controller so rear view camera can be viewed at any time instead of just in reverse gear

*seperate SWI keys from on-unit keys (like vol up/down-mute-mode/src) [any progress on this???

*prevent sofia server from controlling media volume during navigation speech (sometimes gets stuck on low volume and doesn't return)

*find hook for brightness key
[FYT Android Head Units] surfer63:
1. Is this Sofia? If you start the unit with the gear in reverse, before android has even been loaded, you get the rear view camera. I'm afraid this is directly controlled by the MCU and not by SofiaServer at all.

2. They are separated, aren't they? They are not completely mapped yet (Vol +/- etc.), but they are separated? Or not?

3. yeah. That's an ugly one.

4. Maybe by replacing the sofiaserver with the gustden debug or lbdroid debug version, we can detect which key is pressed and find the hook (although as mentioned earlier: It is the only key I personally didn't look at before as I like the 3-step brightness reduction. My PX5 doesn't have such a button and I really miss it. So now I want to know to build it into "some" button for the PX5).

3a: I also wanted to look in "speed based" volume correction, like decreasing/increasing the volume in 5-6 steps or so. The XMTC module does this as well.
[FYT Android Head Units] surfer63:
Both debug versions didn't give me a lot. Simply erasing the logcat, pressing the button 4 times, and saving the logcat did it. That showed lines like:

06-02 14:30:06.169 987 987 E demo : onRefresh brightness = 90
06-02 14:30:06.869 987 987 E demo : onRefresh brightness = 65
06-02 14:30:07.639 987 987 E demo : onRefresh brightness = 40
06-02 14:30:08.828 987 987 E demo : onRefresh brightness = 90

It is not in the SofiaServer. It is in the SystemUI. It is in the com.syu.util.JBrightnessController:

public class JBrightnessController implements Listener, OnRefreshLisenter {
private ArrayList<BrightnessStateChangeCallback> mChangeCallbacks = new ArrayList();
private final Context mContext;
private final ToggleSlider mControl;
private boolean mExternalChange;
private final Handler mHandler;
private final ImageView mIcon;
private boolean mListening;
RemoteTools remote;

public JBrightnessController(Context context, ImageView icon, ToggleSlider control) {
this.mContext = context;
this.mIcon = icon;
this.mControl = control;
this.mHandler = new Handler();
this.remote = CarService.getmService(context).getTools();
this.remote.addRefreshLisenter(0, this, 31);
}

public void onRefresh(int updateCode, int[] ints, float[] flts, String[] strs) {
if (updateCode == 31 && ints != null && ints.length > 0) {
int value = ints[0];
Log.e("demo", "onRefresh brightness = " + value);
if (!this.mExternalChange) {
this.mControl.setValue(value);
}
}
}

I guess it is in the "public void onRefresh".

We already have a section where we control the systemUI: for displaying the CPU temp in the notification bar. We could simply add another hook there.

I will give it a try today/tomorrow.
[FYT Android Head Units] gtxaspec:
1. Yes, there is a 2 step mechanism to this. Before Android fully boots, and before surfaceflinger initializes the display buffer for Android, there is a Linux service called camcap. This monitors the /sys entry for the gpio corresponding to the reverse gear, and once it flips to 1, it displays the backup signal. Using this service doesn't work once Android is loaded though.

2. Not separate. For example, on my friends VW wheel, the microphone button on his wheel is mute, so if I remap mute in xsofiatweaker, the panel mute button is no longer mute. Wasn't ig_vasilich looking into this?

3a. This is gonna be more difficult...one more thing to add to my wishlist. We need to do a hook to where the unit volume changes using the Android volume controls, not the SYU UI or mechanism. This will allow us to change the volume from Tasker and other apps and stuff...and will make it so you can use any volume changing app from the play store...I think theres already some that do this based on your speed
[FYT Android Head Units] gtxaspec:
This has to be called somewhere is the Sofia server...I don't think system UI would read the MCU directly... Or would it...
[FYT Android Head Units] surfer63:
why not? It is a FYT hardware customized Android version. And for me it is also logical that the apk controlling the UI, also controls brightness.

And mayby the sofiaserver "detects" the first press and then broadcasts the command to the systemUI.

I give it a try today and then we will see soon enough if it is the correct method to hook or not.
[FYT Android Head Units] IG_Vasilich:
can't comment as i failed to install XPosed on latest available stock JY ROM for FYT6021 from January 2018. After Trying to install XPosed via JET and reboot the unit didn't boot, and after resetting it once (with reset button) the unit booted to the point with "optimizing apps x from 94" and crashed on 31. after second reset it showed only "optimizing apps 1 of 4" and then finally booted, but without any data (like fresh android install) and with messagebox "Unfortunately, Xposed_Install has crashed" or smth like that. After several experiments / reboots i had to flash stock FW again.

It is pretty impossible to develop smth on this unit without having the possibility to debug/test it (i can do only static analysis of decompiled FYT apps, and check the XPosed modules code ) :(

Do you, gyus, have some tip for me to get XPosed installed on my unit? what i have done wrong in my attempt to install it? i have followed to description to root it from JET page https://hvdwolf.github.io/Joying-RootAssistant/rooting.html and then pressed button INSTALL XPosed in JET (v50)
[FYT Android Head Units] gtxaspec:
Why don't you use my ROM?
[FYT Android Head Units] IG_Vasilich:
that would be the next attempt in order to get Xposed installed.

BTW, what do you use for backing up and restoring of all apps and settings? i am tired of reinstalling all the apps and settings, and do all this in inconvenient position as my garage place is too far from home to get wifi signal, so i had to park on place blocking my neighbour's car in the hope that he don't use it at the time i am trying to reinstall everything.

Titanium backup? anything else you can advise? As i got from the GTX ROM description, data partition will be deleted when flashing it?
[FYT Android Head Units] gtxaspec:
Titanium, but with my ROM, I make an image using twrp which restores everything in one shot.
[FYT Android Head Units] IG_Vasilich:
does installing TWRP deletes data partition? Or is it possible to install TWRP, make a backup of everything currently installed to be able to

1. get same apps and settings after installing GTX ROM

2. recover all apps and settings for stock ROM in case anything went wrong with GTX ROM

?
[FYT Android Head Units] gtxaspec:
Twrp is included in custom ROM. Allows restore of all apps and settings.
[FYT Android Head Units] IG_Vasilich:
but not BFEORE i install GTX?
[FYT Android Head Units] gtxaspec:
You can do before, sure.
[FYT Android Head Units] surfer63:
After a week of stand-still and not having logged on, I tried to map the "Brightness" key like mentioned in topic 384.

That didn't work so I will search further.
[FYT Android Head Units] gtxaspec:
ok...had some time today to do debugging...

I'm working on seperating the "Steering wheel" buttons from the physical panel buttons so we can map them to do different things...

example: MODE/SRC button on the STEERING WHEEL can do something different from the MODE/SRC button on the Head Unit's front panel...

using MCUD, these are the packets for the following:

06-18 17:17:32.567 11179 11182 D MCUD : READ Unhandled Packet: 0xe3060f0001140000 vol up
raw packets from /dev/ttyS0: 88 55 00 08 e3 06 0f 00 01 e4 00 00 07
06-18 17:18:33.084 11179 11182 D MCUD : READ Unhandled Packet: 0xe3060f0002140000 vol down
06-18 17:18:54.493 11179 11182 D MCUD : READ Unhandled Packet: 0xe3060f0003140000 bt phone
06-18 17:19:12.464 11179 11182 D MCUD : READ Unhandled Packet: 0xe3060f0007140000 mode

I'm assuming that the function "dev.ReceiverMcu" gets the raw packets from the MCU and process them to point to the correct actions...

edit:

adding this code to XSofiaTweaker:

XposedBridge.log(TAG + " MCUKEY" + " B=" + (b & 255) + " B2=" + (data[start + 1] & 255) + " B2=" + (data[start + 2] & 255) + " B2=" + (data[start + 3] & 255) );

Duplicates the old gusten key mod key debug logs, though it looks like dev.ReceiverMcu might not be the place to look ( or as is, we don't parse it correctly into the method ), as when I try the above, the volume up on the panel and my SWI is the same code...yet the debug output of MCUD shows that there are different bytes being sent...hmmm...

[MENTION=2550900]surfer63[/MENTION], how did you figure out to use the statement

if ((b & 255) == 1 && (data[start + 1] & 255) == 0 && (data[start + 2] & 255) == 16 && (data[start + 3] & 255) == 80) {

to filter the key codes into the method?
[FYT Android Head Units] surfer63:
I used jadx to save the java code of the original and the gustden sofiaserver. Then I did a diff on the code and found that Gustden had added an extra function/method: this method. So I simply copied that into sofiatweaker and after some trial & error it worked.
[FYT Android Head Units] Astur_Torque:
is there any way to launch an app in the background? I want this to not overlap the current app
[FYT Android Head Units] surfer63:
Android is linux. You might try with a system call like

am start com.syu.radio/com.syu.radio.Launch &

to start the radio in the background.

(I did not try it myself yet. My son has my car now for the rest of the day.)
[FYT Android Head Units] ruriruri:
I installed JET 51. Downloaded gpsspeedfix from JET app and installed. Full reboot from JET. Always reboot ONLY when connect to wifi. No GPS signal now. Uninstalled gpsspeedfix and still get reboot when connect to wifi and no GPS signal.

How do I install gpspeedfix properly? Do I need xposed framework?

I am on stock firmware Jan 2018. Rooted.

Thanks
[FYT Android Head Units] IG_Vasilich:
gpsspeedfix is a Xposed module, so - yes, you need to have Xposed installed to use GPSSPeedFix. read the topic name thoroughly :)

For Xposed on our units try to use gtx ROM https://xdaforums.com/android-auto/android-head-units/rom-gtx-joying-stock-rom-2018-01-29-t3742482 - it is pre-rooted and has Xposed embedded.
[FYT Android Head Units] merdok:
I am looking to have the mute button turn off / on the amp. I get feedback when AC is on and no music playing or in mute. I have given up searching for hardware fixes / ground issues.

Can you help with what I would need to use in SofiaTweaker to accomplish this?
[FYT Android Head Units] lotte67890:
[MENTION=2550900]surfer63[/MENTION] and [MENTION=520205]gtxaspec[/MENTION]

Thank you so much for your effort. I have been reading all day long and finally got much smarter ;)

Ok, as I mentioned before in other threads I want my Joying unit to use with an USB DAC and I want the GPS signal fixed. And as I read here, my thoughts of using the https://xdaforums.com/android-auto/android-head-units/rom-gtx-joying-stock-rom-2018-01-29-t3742482 was absolutely correct. Besides that I had reboots cause of my unit is running to hot... Since there seems to be no way to get Xposed running with the stock ROM (as I also read here) I either need to wait till [MENTION=520205]gtxaspec[/MENTION] (not to blame you! I really appreciate your work!!!) releases a new Version which solves the heating up problem or assemble a heat sink and a fan to my unit... which I´m still undecided what´s the best solution...

Thank you both and all the other contributors for your effort!!

Lotte
[FYT Android Head Units] surfer63:
Installing Xposed on a (rooted) stock ROM can work for you if you want to risk to having the flash the Joying stock ROM again (which you already did a couple of time I think).

On my unit I installed it at least 5-6 times and I never had a soft-brick or boot-loop. Other users always get boot loops. I really have no idea. So you could try it. Maybe that boot-loop also has to do with overheating as after the Xposed install, also apks need to be regenerated that heavily use the app_process binary.

gtxaspec can't probably solve your overheating problem as it has to do with generating new apks, which makesthe unit run hot. gtxaspecs ROM is even optimized for generating less apks. The question now could also be whether the unzip/untar process generates more heat than a mass-optimization.

The only solution I can think think of is that CPU-frequency is kept low during optimizing, and that the unit only runs fullspeed after flashing/optimizing. I have no idea whether gtxaspec can do that.
[FYT Android Head Units] IG_Vasilich:
I had bootlops after installing Xposed on 01.2018 stock ROM, and it was after i have installed cooling mod (never had CPU temp over 62 C in my tests with cooling mod), so - the overheating could'n be a reason for bootloops in my case.
[FYT Android Head Units] surfer63:
So my "maybe" is actually "it is unlikely that" ;)
[FYT Android Head Units] lotte67890:
I see, so which version of Xposed should I try? I suggest there are several versions out there..

---------- Post added at 08:57 PM ---------- Previous post was at 08:51 PM ----------

Ah, here you mention it... What I could try is install TWRP, do a backup of system, data and I think there is one more partition backed up by default, then try to install Xposed. Question is, if Xposed causes bootloops, how can I enter recovery to restore, and if that should fail how would I restore stock FW when having TWRP installed?
[FYT Android Head Units] surfer63:
You can't install stock FW when having TWRP installed. It all has to do with signed software, signed zips and signing when flashing on the Sofias. You can only restore your Joying to stock FW with the stock recovery. Read the custom rom thread by gtxaspec.

Like I mentioned in the other thread: You could use Jet 50, but you mentioned you already have the gtx custom rom. In that case Xposed is already installed.

(or was that ruriruri, using a hair dryer on cold mode to cool his unit. I can't find that post back)
[FYT Android Head Units] surfer63:
I installed Xposed v90 successfully on my Joying PX5 Android 8.0.0 unit from my current development JET apk (the ToBe version 52).

Unfortunately the XSofiaTweaker can't be opened in "config" mode. It does its job in the background, but it comes with all keys configured to the Joying standards, so in practice it does nothing.

When I open the app to configure the key actions and ACC_ON/ACC_OFF actions, it crashes.

When analyzing the logcat it comes down to this error:

07-22 16:37:29.943 4477 4477 E AndroidRuntime: FATAL EXCEPTION: main
07-22 16:37:29.943 4477 4477 E AndroidRuntime: Process: org.hvdw.xsofiatweaker, PID: 4477
07-22 16:37:29.943 4477 4477 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.hvdw.xsofiatweaker/org.hvdw.xsofiatweaker.SettingsActivity}: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported

Followed by a long list of (sometimes completely incomprehensible) lines with "explanations".

I'm "still" on the 5 June ROM on my PX5. I will flash to the 6 July ROM. Test the install again and maybe release the JET 52 afterwards.

The xsofiatweaker obviously needs some rework (and possibly another name if it is to be used on both the sofia and px5. After all: the FYT apps are identical and so is the hardware key definition).
[FYT Android Head Units] IG_Vasilich:
have you tried to use MODE_PRIVATE instead of MODE_WORLD_READABLE ?

https://stackoverflow.com/questions...ption-mode-world-readable-no-longer-supported

or use own context with file

https://xdaforums.com/xposed/development/modeworldreadable-android-n-t3407123
[FYT Android Head Units] surfer63:
I found the exact same links (and a few others).

The first one seems the best, but somehow I get errors.

And I'm not sure yet whether the new preferences file can be used by Xpreferences (in the main xsofiatweaker.java)

There is also the https://github.com/apsun/RemotePreferences. This one is already used by several other Xposed modules.
[FYT Android Head Units] surfer63:
Stupid. I did not read it correctly. There is no new preferences file. It is the same file where the file rights are changed using default file code.
[FYT Android Head Units] surfer63:
Status update:

The GUI part of XSofiaTweaker works on Android 8. That is fixed.

However, the "background" module requires a major rewrite as the authorization model changed a lot on android 7, continuing in android 8. It took rovo89 (the xposed framework developer) as many xposed module developers a lot of headaches. I'm trying to copy their work, but I'm already strugling the entire weekend and some time before that. It took already many hours.
[FYT Android Head Units] surfer63:
And finally the XSofiaTweaker works on Android 8.0.0.

Only the two CANbus options don't work, but one of them, the display of the airconditioning bar, is no longer necessary anyway on Android 8.0.0 as it can be switched off from the settings.

I will do some further tests and of course reverse test on Sofia.

And I'm thinking to rename it from "XSofiaTweaker" to "JoyingFYTTweaker" or something like that.

Both names are not very catchy anyway. I'll try to think of another. Suggestions are welcome as well (although I make the final decision ;))
[FYT Android Head Units] derschnelle:
Tweaky McTweakface maybe?
[FYT Android Head Units] surfer63:
Can you explain?

And is it derived from "something"?
[FYT Android Head Units] derschnelle:
https://en.m.wikipedia.org/wiki/Boaty_McBoatface

;)
[FYT Android Head Units] surfer63:
11 August, XFytTweaker Version 1.2.0 (successor of XSofiaTweaker)

Hi,

After many hours of trial&error, I can now release the XFytTweaker (github repo or xposed repo). The XFytTweaker is the successor of the XSofiaTweaker which's development is now discontinued.

This is the first version of the XFytTweaker after renaming it from the XSofiaTweaker module, but I switched from version 1.26 to version 1.2.0. That might seem strange but I introduced the subversion (2) next to the patch version (26). Android version change and major software change made me change it from 1.0.26 (1.26) to 1.2.0

Functionally unchanged when compared with XSofiaTweaker 1.26

internal renaming

Major rewrite to make it work on Android 8.0.0.

You can't run the XSofiaTweaker next to the XFytTweaker. Either use the XSofiaTweaker (only on Android 6.0.1) or the XFytTweaker (Android 6.0.1 and Android 8.0.0).

I have been thinking (and asking) about a new name, but in the end I kept it simple: XFytTweaker. It tweaks FYT based head units.

It is not only for the Intel Sofia models but actually for any FYT model running FYT/SYU software.
[FYT Android Head Units] Astur_Torque:
[MENTION=2550900]surfer63[/MENTION]

if you don't have any hardware buttons, I mean, just touch buttons, you can't capture the key, right?
[FYT Android Head Units] surfer63:
What kind of touch buttons? If they emulate hardware buttons, like the NAVI, BAND, MEDIA, etc keys, it might still work.

touch buttons in any program can not be mapped.

The buttons in the systemui bar at the top (home, back, task manager) can theoretically be mapped, but there are already xposed modules that.
[FYT Android Head Units] Astur_Torque:
Hi, my model is this one

As you can see it doesn't have any physical button, All of them are "touchable"

The same with CANBUS keys, they are slef-programmed and I can't change them
[FYT Android Head Units] surfer63:
I assume the top-right "NAVI" button can be mapped. Do you need to assign a navi app to that key in the settings? If so, it can be mapped from the XFytTweaker.

I assume the Vol-Up and Vol-Down buttons can be mapped as well. We already do that in "USB-Dac mode". We test whether the switch USB-Dac is set. If it is the Vol-Up and Vol-Down buttons are captured. We can do exactly the same if USB-Dac is switched off. It means of course that if you have a USB-Dac you can't remap the buttons.

The Back and Home keys can be mapped as well. Currently I disabled the Back key as it also takes over the Back option in ALL android apps. I think that is too risky to capture.
[FYT Android Head Units] Astur_Torque:
oh blas de lezo boat xd

---------- Post added at 20:03 ---------- Previous post was at 19:55 ----------

And about canbus steering wheel buttons? I tried few months ago to set other functions to these buttons without success... Do you know someone who was able to do this?
[FYT Android Head Units] surfer63:
There is a difference between key1/key2 steering wheel buttons and CANbus controlled steering wheel buttons. These require different hooks.

I know [MENTION=520205]gtxaspec[/MENTION] has looked at it.

I have no steering wheel buttons at all. So, I'm less interested to put a lot of time in it.
[FYT Android Head Units] surfer63:
12 August, XFytTweaker Version 1.3.0 (successor of XSofiaTweaker)

Changelog:

Option to display all installed apps with their package name. This makes it easier to assign an app by its package name to a button.

major code clean up of all unused and/or incorrect, rubbish code.

This version has also been added to the JET apk repository, which means it can be downloaded from the current JET apk V54.

It has also been added to the xposed repo so you can also download from the Xposed Installer.

Some images attached from the main setting screen with the new entry, and the overview screen.
[FYT Android Head Units] IG_Vasilich:
You have finally managed it? great!
[FYT Android Head Units] surfer63:
Yeah. Not entirely as how I wanted it in the first place, as I wanted to have an option to select an app (by a dropdown list or so) when you need to provide the package name, but that simply can't be integrated in the "SettingsFragment". That SettingsFragment functionality is an entirely automatic Android "process" to make it programmers as simply as possible. You define the settings in an xml and Android does the rest.

If you want to do it like what I wanted with an integrated dropdown list, you need to abandon that completely automatic process and write your own settings update/modify process completely by hand. I do not have the skills (at all) to do that.

But I can start another app or activity from a Settings entry. So I created another screen/Activity and call that one from the settings page. I just found out by accident on Sunday morning (I knew how to start a web page which is done in the Info subscreen). Then it took me about an hour to create it and another 30 minutes to alter the layout to my liking, as the "example" was based on a portrait layout.

Now it is a "reference screen" where you can see (and copy) the package name from an app and then paste it into the package name field for the button.

(An option could be to do now the same (create screen/Activity) for the DPI setting. It is in my JET apk, but I could now also add it to the XFytTweaker)
[FYT Android Head Units] looxonline:
Beautiful work and many kudos!

I was searching for the option to enable the CPU temp in the status bar with the FYTtweaker...could not find it. Is it there for everyone else?