Whether you are building a ROM with or without a 'kitchen' there are lots of .DSM files. Some of these are 0Bytes, others are tiny (2-3Bytes). What are they? I understand the .RGU files (registry entries), but the .DSM files I don't yet understand. I thought they were referenced by the 'option.xml' file in the \SYS folder (in most kitchens anyway?), however some are, others aren't.
Anyone have any details on this?
Thanks
Andy
ADB100 said:
Whether you are building a ROM with or without a 'kitchen' there are lots of .DSM files. Some of these are 0Bytes, others are tiny (2-3Bytes). What are they? I understand the .RGU files (registry entries), but the .DSM files I don't yet understand. I thought they were referenced by the 'option.xml' file in the \SYS folder (in most kitchens anyway?), however some are, others aren't.
Anyone have any details on this?
Thanks
Andy
Click to expand...
Click to collapse
I dont know what they are, but i do know 100%, that you delete these and you will kill your rom! These holder data that is needed in some case but in other not!!
funman said:
I dont know what they are, but i do know 100%, that you delete these and you will kill your rom! These holder data that is needed in some case but in other not!!
Click to expand...
Click to collapse
I don't want to delete them, however I am trying to resolve my L2TP/IPSec issue and I am now grasping at straws......
Andy
Good morning class, today we will be learning about dsm files...
Q:What are dsm files?
A:dsm files are thought to contain important encrypted information about file association.
eg What files are associated with the bluetooth function of your device? Well there's btdrt.dll, bthlink.dll, bthutil.dll, configmanager.dll, configmanager2.dll and so forth. We know this because we've researched the functioning of bluetooth with much detail, using such high tech methods as "What happens if i remove this file...**** my bluetooth doesnt work anymore...."
But how does your device know what files are associated with bluetooth functioning? Well in addition to the info contained in the .exe files it looks inside associated dsm files and decrypts the info thats in there.
Q: This seems confusing, is there some organised way of knowing what dsm files i have? or are they all just randomly put in my rom?
A:.dsm files are referenced by packages.sof. All of them are inside packages.sof
Q: packages.sof looks like a mess, how on earth do i read that?
A:the dsm filenames are just rearranged,
eg
9a6a05e1-cfde-4d32-9a82-85052c4d9de7.dsm appears as
E1 05 6A 9A DE CF 32 4D 9A 82 85 05 2C 4D 9D E7
So basically starting from the left side of the file name you split the first section of the dsm file name into pairs then swap the outside pair, then swap the inside pair.
eg 9a6a05e1 = 9a 6a 05 e1 = E1 05 6A 9A
Then you take the next section and swap the order of the pairs.
eg cfde = cf de = DE CF
Leave the next section alone
eg 9a82 = 9A 82
The last section isnt rearranged either. Its just split into pairs.
eg 85052c4d9de7 = 85 05 2C 4D 9D E7
So adding up all our sections we see that 9a6a05e1-cfde-4d32-9a82-85052c4d9de7.dsm is represented by E1 05 6A 9A DE CF 32 4D 9A 82 85 05 2C 4D 9D E7 inside packages.sof
Q: But how do i know what files are associated with my .dsm files?
A: A mysterious and clever man known only as bepe, gave us some tools. Some say that bepe fell from heaven, others say he was raised by a pack of wild german ladies with boobs as big as car tyres. Ask your history teacher about bepe.
Homework
Write a two-page report detailing why some dsm files (eg b50d833e-7d3f-44ac-615f-2da2c715cd93.dsm) appear in packages.sof but apparently dont reference any files....
Class dismissed, if anybody wants to ask me any questions, i'll be at the bar drinking beer.
Disclaimer: I wrote this with my best intentions, just a bit of fun. This is what i know about dsm files, it is immensely far from being 100% proven theory yet. I know the theory is flawed but it is a work in progress. If you think im wrong then feel free to correct me.
peter petrelli said:
Good morning class, today we will be learning about dsm files...
Q:What are dsm files?
A:dsm files are thought to contain important encrypted information about file association.
eg What files are associated with the bluetooth function of your device? Well there's btdrt.dll, bthlink.dll, bthutil.dll, configmanager.dll, configmanager2.dll and so forth. We know this because we've researched the functioning of bluetooth with much detail, using such high tech methods as "What happens if i remove this file...**** my bluetooth doesnt work anymore...."
But how does your device know what files are associated with bluetooth functioning? Well in addition to the info contained in the .exe files it looks inside associated dsm files and decrypts the info thats in there.
Q: This seems confusing, is there some organised way of knowing what dsm files i have? or are they all just randomly put in my rom?
A:.dsm files are referenced by packages.sof. All of them are inside packages.sof
Q: packages.sof looks like a mess, how on earth do i read that?
A:the dsm filenames are just rearranged,
eg
9a6a05e1-cfde-4d32-9a82-85052c4d9de7.dsm appears as
E1 05 6A 9A DE CF 32 4D 9A 82 85 05 2C 4D 9D E7
So basically starting from the left side of the file name you split the first section of the dsm file name into pairs then swap the outside pair, then swap the inside pair.
eg 9a6a05e1 = 9a 6a 05 e1 = E1 05 6A 9A
Then you take the next section and swap the order of the pairs.
eg cfde = cf de = DE CF
Leave the next section alone
eg 9a82 = 9A 82
The last section isnt rearranged either. Its just split into pairs.
eg 85052c4d9de7 = 85 05 2C 4D 9D E7
So adding up all our sections we see that 9a6a05e1-cfde-4d32-9a82-85052c4d9de7.dsm is represented by E1 05 6A 9A DE CF 32 4D 9A 82 85 05 2C 4D 9D E7 inside packages.sof
Q: But how do i know what files are associated with my .dsm files?
A: A mysterious and clever man known only as bepe, gave us some tools. Some say that bepe fell from heaven, others say he was raised by a pack of wild german ladies with boobs as big as car tyres. Ask your history teacher about bepe.
Homework
Write a two-page report detailing why some dsm files (eg b50d833e-7d3f-44ac-615f-2da2c715cd93.dsm) appear in packages.sof but apparently dont reference any files....
Class dismissed, if anybody wants to ask me any questions, i'll be at the bar drinking beer.
Disclaimer: I wrote this with my best intentions, just a bit of fun. This is what i know about dsm files, it is immensely far from being 100% proven theory yet. I know the theory is flawed but it is a work in progress. If you think im wrong then feel free to correct me.
Click to expand...
Click to collapse
OK, thanks for that. That is the first time I have seen that........
Another couple of questions then if you will oblige me?
1. In the various Kitchens that are out there, there is usually an 'option.xml' file in the \SYS directory that describes the various system packages that can be included in the ROM so they can be selected or excluded. The file is broken up into sections - transcriber, Enterprise, Games, Office etc. Listed in each of these sections are GUID's with a type and a GUID. Type is either 'p' or 'i'; 'p' references the .RGU file containing the registry settings. However the entries with the type 'i' don't seem to reference any GUID-named files I can see? I have applied the conversion logic you detail and the .DSM files don't tie-up with the GUID references, these may be unrelated though? For example the Autoupdate section:
Code:
<Item name="Autoupdate" group="System" checked="true">
<Guid type="p">8be73c02-3437-4c06-88c9-0a2e25bfaf2c</Guid>
<Guid type="i">c05687f7-7d0a-4738-9ecd-e043658f40cd</Guid>
</Item>
I can see the .RGU file (8be73c02-3437-4c06-88c9-0a2e25bfaf2c.rgu), however the second .DSM file is '89fc53c1-ec65-4648-9972-24afb3dcad3c.dsm', if the conversion logic you list is correct it should begin with c153fc89? Unless of course these are unrelated, however the number of GUID's listed always ties-up with the number of .DSM/.RGU files in each package (in different folders - e.g. Autoupdate, Autoupdate_Lang_0409).
2. How do you read the packages.sof? It just appears as few lines of unreadable characters in either Notepad or Wordpad?
3. Can .DSM files be transferred between ROM sources? In my quest to get L2TP/IPSec VPN working in the 5.2.1413 ROM I have been transferring the Enterprise files (ipsec.dll, ipsecsvc.dll, scard.dll & winscard.dll) from earlier ROMs (and other device ROMs) but have not had any (much?) success. Is there some logic to transferring files between ROMs?
Thanks
Andy
1. At this point in time I have no explanation as to why there are absent dsm's. I cant locate the dsm file you describe in any rom, i can only locate references to it. I can only speculate about why this is so.
2. Use a hex editor.
3. Yes you can trasfer dsm files but with mixed results. I have swapped some dsm files but when i did i moved the files associated with them as well. I had mixed success doing this.
I have exams on at the moment so I will look into this matter further towards the end of the month. Sorry my answers to your questions are so short. Good luck with your L2TP/IPSec VPN.
Hello I'm trying to use xmlprovisioning to customize some features of S2U2.
An example of one key I'm having problem with is the following:
<parm name="ShowOwnerInfo" datatype="binary" value="01"/>
I just cannot get the value of 01 to stick. When I go back into S2U2 registry setting it is still showing as value not being set (according to CeRegistryEditor).
I don't have any problems changing other datatypes, such as: integer and string.
Am I don't something wrong?
Thank you in advance for all you guy's help.
Okay, I think I found out the reason:
"Binary values are a PITA since they're encoded Base 64 (see my entry for Owner Information above). If you want to set owner information as I did in the example, then you need to convert Unicode to Base64."
from: http://forum.xda-developers.com/showthread.php?t=366337&highlight=user+customization+binary
Can someone walk me through how to do this?
Is this any good?
Unicode to Base64 Convertor
Thank you for the suggestion.
I have already tried the tool, but what it gives me does not generate the effect that I'm looking for
Maybe I need to manipulate the value some how and then put it into the encoder??
Hi,
just an idea:
Binary data are hex ... so i attached a little txt ... just rename it and import to your registry.
It show how Binary-Values work (as far as i understood them )
In HKLM you'll find a Key (Folderlike) called "fwt"
Therein are three values
1. Capital
2. SmallLetter
3. Test
1. => FWT as binary data => 46,57,54
2. => fwt as binary data => 66,77,74
3. => all signs (letters, numbers, symbols) from 00 to FF
Space is 20
CapitalLetter start with 41
SmallLetters start with 61
Just use CeRegistryEditor and you can see them clearly .
I hope this helps!
Dear devs,
I have MTCD PX5 MX (Witson).
I would like to make some small utility apps to enhance HU functionality based on vehicle data.
I would like for example to read the vehicle speed in my app (without using GPS or OBD). I know it's available somewhere in the OS because you can see it in the factory "Vehicle Info" app which seems to be the same for all MTCD units.
Is it some /proc file to be read? Some broadcasts? Some android API additions or some native library calls?
Thanks!
rumburake said:
Dear devs,
I have MTCD PX5 MX (Witson).
I would like to make some small utility apps to enhance HU functionality based on vehicle data.
I would like for example to read the vehicle speed in my app (without using GPS or OBD). I know it's available somewhere in the OS because you can see it in the factory "Vehicle Info" app which seems to be the same for all MTCD units.
Is it some /proc file to be read? Some broadcasts? Some android API additions or some native library calls?
Thanks!
Click to expand...
Click to collapse
The only way is decompilation of an app (you have to find one which deals with CANBUS) and analysis of decompiled source code. There is no API for such things in these devices.
rumburake said:
Dear devs,
I have MTCD PX5 MX (Witson).
I would like to make some small utility apps to enhance HU functionality based on vehicle data.
I would like for example to read the vehicle speed in my app (without using GPS or OBD). I know it's available somewhere in the OS because you can see it in the factory "Vehicle Info" app which seems to be the same for all MTCD units.
Is it some /proc file to be read? Some broadcasts? Some android API additions or some native library calls?
Thanks!
Click to expand...
Click to collapse
You need a canbus decoder. If you buy a canbus decoder for VW golf/Jetta mk5/mk6 I can tell you which messages you need to send to the canbus decoder for the vehicle info apk and for door information, and you can easily send messages with Arduino (with canbus board) or with teensy 3.1 (with can transeiver) or other microcontroller.
I notice by default, (after installing Titanium Backup) that the Vehicle App is "frozen" and when I unfreeze it to run, it doesn't really stay open. I do have a CANBus interface for my 08 Mitsubishi Lancer Evolution X. I noticed in Factory Settings>CANBus, it has options (standard/swap) for front door, back door and air conditioning. Is there any way to have the data displayed somehow? Is the vehicle info app supposed to show it?
Sent from my Nexus 9 using Tapatalk
verkion said:
I notice by default, (after installing Titanium Backup) that the Vehicle App is "frozen" and when I unfreeze it to run, it doesn't really stay open. I do have a CANBus interface for my 08 Mitsubishi Lancer Evolution X. I noticed in Factory Settings>CANBus, it has options (standard/swap) for front door, back door and air conditioning. Is there any way to have the data displayed somehow? Is the vehicle info app supposed to show it?
Sent from my Nexus 9 using Tapatalk
Click to expand...
Click to collapse
In my case (mazda cx5) the vehicle.apk is not the one for showing information
When I open any door it is displayed on the unit.
Even having the same options (air conditioning) like you air conditioning info is not displayed.
Enviado desde mi D6603 mediante Tapatalk
Oh. OK. Hrm...must be controlled somewhere else then. I wonder how I can get it to begin to display that type of info.
Sent from my Nexus 9 using Tapatalk
I'm also in the topic for some weeks, and there is no api or information to access the canbus from the unit.
To reverse engineer the can bus app was the only suggestion provided also.
I think the aim should be to create a android socket can bus api driver for the unit.
Thanks for your interest guys, I managed to get the data by examining the "Vehicle" app (MTCControlInfo.apk). :victory:
There's a broadcast "com.microntek.sync" which contains a byte[] extra called "syncdata". The array has 20 byte values of which I decoded the speed, revs, voltage, temperature and total mileage. When data[2] == 2, the data is:
Code:
// RPM
int rpm = (0xFF & data[3]) * 256 + (0xFF & data[4]);
// SPEED
double speed = ((0xFF & data[5]) * 256 + (0xFF & data[6])) * 0.01d;
// BATTERY
double battery = ((0xFF & data[7]) * 256 + (0xFF & data[8])) * 0.01d;
// TEMP
double temp = (0xFF & data[9]) * 256 + (0xFF & data[10]);
if (temp >= 32768) {
temp -= 65536;
}
temp /= 10;
// DISTANCE
int distance = (0xFF & data[11]) * 65536 + (0xFF & data[12]) * 256 + (0xFF & data[13]);
The problem is the Broadcast doesn't come unless the "Vehicle" app is started. They seem to either:
flip a switch like this:
Code:
Settings.System.putInt(this.getContentResolver(), "com.microntek.controlinfo.door", 1); // in onCreate() and onStart()
and
Code:
Settings.System.putInt(this.getContentResolver(), "com.microntek.controlinfo.door", 0); // in onStop()
I couldn't get my app to do this, you're not allowed to do this unless you're a system app.
or get the CarManager (which is in another app which I didn't get yet to examine), to do some command, perhaps another Broadcast.
I can get continuous data Broadcasts if I start the "Vehicle" app, then go to home screen, then start my app. Since onStop() would be called I believe it's the second method of switch that really happens.
As soon as you explicitely exit the "Vehicle" app the Broadcasts stop coming.
I'm using Bytecode Viewer, but it has quite a few errors translating to Java. A better disassembler would come in handy.
TBC...
rumburake said:
Thanks for your interest guys, I managed to get the data by examining the "Vehicle" app (MTCControlInfo.apk). :victory:
There's a broadcast "com.microntek.sync" which contains a byte[] extra called "syncdata". The array has 20 byte values of which I decoded the speed, revs, voltage, temperature and total mileage. When data[2] == 2, the data is:
Code:
// RPM
int rpm = (0xFF & data[3]) * 256 + (0xFF & data[4]);
// SPEED
double speed = ((0xFF & data[5]) * 256 + (0xFF & data[6])) * 0.01d;
// BATTERY
double battery = ((0xFF & data[7]) * 256 + (0xFF & data[8])) * 0.01d;
// TEMP
double temp = (0xFF & data[9]) * 256 + (0xFF & data[10]);
if (temp >= 32768) {
temp -= 65536;
}
temp /= 10;
// DISTANCE
int distance = (0xFF & data[11]) * 65536 + (0xFF & data[12]) * 256 + (0xFF & data[13]);
The problem is the Broadcast doesn't come unless the "Vehicle" app is started. They seem to either:
flip a switch like this:
Code:
Settings.System.putInt(this.getContentResolver(), "com.microntek.controlinfo.door", 1); // in onCreate() and onStart()
and
Code:
Settings.System.putInt(this.getContentResolver(), "com.microntek.controlinfo.door", 0); // in onStop()
I couldn't get my app to do this, you're not allowed to do this unless you're a system app.
or get the CarManager (which is in another app which I didn't get yet to examine), to do some command, perhaps another Broadcast.
I can get continuous data Broadcasts if I start the "Vehicle" app, then go to home screen, then start my app. Since onStop() would be called I believe it's the second method of switch that really happens.
As soon as you explicitely exit the "Vehicle" app the Broadcasts stop coming.
I'm using Bytecode Viewer, but it has quite a few errors translating to Java. A better disassembler would come in handy.
TBC...
Click to expand...
Click to collapse
Use this decompiler:
http://www.javadecompilers.com/apk
According to CarManager - it is located inside framework.jar. You can see example usage in my app here:
https://github.com/f1xpl/MtcdTools
To use it in your project, simply copy source code loated at app/src/main/java/android/microntek/ except f1x dir to your project directory.
Cool you've got something.
But it looks like some processed data and not the raw can you will need for full controll so you have to mine deeper.
iwl said:
But it looks like some processed data and not the raw can you will need for full controll so you have to mine deeper.
Click to expand...
Click to collapse
As said in the original post what I want is this data. Don't put your hopes into me digging into the canbus as it's not my purpose.
rumburake said:
As said in the original post what I want is this data. Don't put your hopes into me digging into the canbus as it's not my purpose.
Click to expand...
Click to collapse
I have been looking into this also.
My unit is an MTCD PX5 MX, currently using Malaysk rom 5.0 and MX mcu 2.59. The car is a Peugeot 407.
I get air condition data: temperature readings from both sides of the car, air flow direction only from the driver's side, and the temperatures are off by 4 degrees (ie. showing 17C when the temp is set at 21C).
Steering wheel keys: Volume up/down always work, the other keys, Next, Prev, Source, and the "clicky wheel button" (which should change radio preset, change folder in music player etc.) only work if they are the very first button pressed after a reboot - it seems like something crashes on the first press, and after that only the volume buttons work.
I tried going into setup, factory settings, and using 'logcan' as password, the can logger starts, showing me that it does receive data on all the steering wheel keys, even if they no longer perform any action on the head unit after the first press.
The keys send data like the following:
Source: 2e 02 11 ...
Next: 2e 02 12 ...
Prev: 2e 02 13 ...
Volume up: 2e 02 14 ...
Volume down: 2e 02 15 ...
Volume up+down (should do Mute): 2e 02 16 ...
Clicky wheel button: 2e 02 03 ... or 2e 02 04 ... depending on the direction.
I want to modify the can bus apk, making it add 4 to air con temperature readings before showing, and I would also like to figure out, what happens when I press a steering wheel key for the first time, since everything works initially and then stops after the first press.
My unit is an MTCD PX5 MX, currently using Malaysk rom 5.0 and MX mcu 2.59. The car is a Peugeot 407.
Click to expand...
Click to collapse
Where did you get this MCU? AFAIK 2.55 is the latest MCU available for MX (according to: https://forum.xda-developers.com/an...opment/mtcd-px5-headunits-repository-t3619906)
MCUs from different models (HA etc) present minor incompatibilities such as different key setups / fascias between models. It may well be your problem with the buttons!
OK I got it now to work properly. :victory:
To get messages you need to send a request using CarManager. I have used the CarManager code from MTCDTools (thank you @f1x !)
In the case of a canbus adapter config 1 (VW/Skoda) you can send this message periodically to receive a data response (including the speed, rpm etc):
Code:
canbus_rsp=46,144,2,65,2,42
These numbers are made by functions specific to the canbus adapter type which you can find in the "Vehicle" app. I could obviously test this only on my car.
For this canbus config there are 2 other sequences, that return other data too:
Code:
canbus_rsp=46,144,2,65,3,41
canbus_rsp=46,144,2,65,1,43
To send a message you can call:
Code:
CarManager.setParameters(String par);
I hope this helps other people.... I will post again when I build something useful on this.
Interesting thread, would be nice to see the speed data applied to other apps (like Graser's Dasaita or F1x' sound to speed adjust, or Malaysk's screensaver), without the need to get GPS data.
But I guess not all MTCx units will have the speed data, so using GPS will be more generic. I do think the speed data from canbus will be more reliable when the unit supports it.
rumburake said:
Code:
canbus_rsp=46,144,2,65,2,42
Code:
CarManager.setParameters(String par);
Click to expand...
Click to collapse
Does this altogether mean : ?
Code:
CarManager.setParameters("canbus_rsp=46,144,2,65,2,42");
logcan as factory settings password is such valuable information....
---------- Post added at 01:48 ---------- Previous post was at 01:31 ----------
if code logcan starts the canlog app, may be this app is to find, smaller and more easy to decompile / hack.
logcan Can Bus Logger How To ?
KlausBJ said:
'logcan'
Click to expand...
Click to collapse
I'm just playing around with the factory settings pw logcan Can-Logger, but get nothing shown.
I've tried to send with 125000 Baud and 500000 Baud.
What number do you have choosen in the upper right corner there is No, 01, ..., FF ?
How have you used the bottom Buttons, I pressend Start, changing to stop then, what is TX RX for?
I'm also confused.
What's supposed to be inside the String when
Code:
CarManager.setParameters()
is called?
With this method is it possible to write to the CanBus or just read from it?
I'm asking because I'm trying to find a way to control the fade on my factory amp and this seems like the perfect way to do it if writes are possible.
I am now working on a volume setting app using the car speed and rpm. The volume is relative to the one set by user. I got promising results so far.
But I'm stuck at setting the HU volume, it does not sync with the manual controls: suppose volume is 5, then I set it programmatically to 10, then the user turns the knob up it becomes 6 (because it starts from 5)!
@f1x you do have experience with this, could you please advise? I have tried all of the following:
This is for setting the real volume in the hardware (a volume value mapped from 0% to 100%):
Code:
carManager.setParameters("av_volume="+mtcLevel);
This is temporary and the Android OS doesn't know the volume was changed.
This setting seems to be used for saving the system known volume (0-30):
Code:
android.provider.Settings.System.putInt(ctx.getContentResolver(),"av_volume=",level);
But doesn't seem to have effect and I get this warning: You shouldn't keep your settings in the secure settings. This will soon become an error.
The same volume used to send a broadcast (also 0-30):
Code:
Intent intent = new Intent("com.microntek.VOLUME_CHANGED");
intent.putExtra("volume",level);
ctx.sendBroadcast(intent);
This probably it's just for notifying other apps (it's also how I get the volume changes in my app).
Anyhow what I mean is to set the volume to 10 and when I turn the knob up to find it at 11. Thanks!
rumburake said:
I am now working on a volume setting app using the car speed and rpm. The volume is relative to the one set by user. I got promising results so far.
But I'm stuck at setting the HU volume, it does not sync with the manual controls: suppose volume is 5, then I set it programmatically to 10, then the user turns the knob up it becomes 6 (because it starts from 5)!
@f1x you do have experience with this, could you please advise? I have tried all of the following:
This is for setting the real volume in the hardware (a volume value mapped from 0% to 100%):
Code:
carManager.setParameters("av_volume="+mtcLevel);
This is temporary and the Android OS doesn't know the volume was changed.
This setting seems to be used for saving the system known volume (0-30):
Code:
android.provider.Settings.System.putInt(ctx.getContentResolver(),"av_volume=",level);
But doesn't seem to have effect and I get this warning: You shouldn't keep your settings in the secure settings. This will soon become an error.
The same volume used to send a broadcast (also 0-30):
Code:
Intent intent = new Intent("com.microntek.VOLUME_CHANGED");
intent.putExtra("volume",level);
ctx.sendBroadcast(intent);
This probably it's just for notifying other apps (it's also how I get the volume changes in my app).
Anyhow what I mean is to set the volume to 10 and when I turn the knob up to find it at 11. Thanks!
Click to expand...
Click to collapse
Take a look at this remark:
Checks if the specified app can modify system settings. As of API level 23, an app cannot modify system settings unless it declares the WRITE_SETTINGS permission in its manifest, and the user specifically grants the app this capability. To prompt the user to grant this approval, the app must send an intent with the action ACTION_MANAGE_WRITE_SETTINGS, which causes the system to display a permission management screen.
Click to expand...
Click to collapse
https://developer.android.com/refer...System.html#canWrite(android.content.Context)