06-30-2009 01:19 PM
If you don't know an application's module name, how can you find it out?
For example, if I have the name of another application's jad file, can I assume that the module name of the app is the jad's basename? As in, would a jad name of MyApp.jad translate into a module name of "MyApp"?
That was my assumption at first, and it is seeming to be the case most of the time, but not all. In particular, if the jad is name:
MyApp-1.0.0.jad
I have found that the actual module name on one Bold running v4.6.167 (and the 4.6.0 JDE simulator of the Bold) is
MyApp$2d1
However, *on another Bold* (this one running v4.6.0.162) , the exact same application shows a module name of
MyApp$2d1$2e0$2e0
So that's why I am wondering if there is some more definitive way to obtain an application's module. I have scoured the API documentation and the solution is not leaping out at me.
Thoughts?
Thanks for any help.
Solved! Go to Solution.
06-30-2009 03:01 PM - edited 06-30-2009 03:02 PM
2D and 2E are hexadecimal representation of ASCII symbols - and .
When you install an application that has such symbols device converts it to $xx representation.
I do not think that there is a good documentation on this topic.
I would do the following.
The first approach:
Name your application module in unique way, at least give a unique symbolic prefix to the module name.
You can use com_yoursite prefix. It nearly 100% that no-one else will use this prefix in his apps.
And check this prefix for every module name.
The second approach:
Process name of every found module to convert $xx to corresponding ASCII symbols and construct user-friendly names.
And after that compare these names to find a module you want to be found.
06-30-2009 05:09 PM
Thanks for the reply.
I did realize that the dashes and dots were being escaped, and the string I use for a module search has been altered to handle that accordingly. Also, the applications I am searching for are not under my control, so I cannot name them anything more convenient.
My main problem now is handling the inconsistency I mentioned in my first post -- how two different Bold handsets assigned different module names to the identical application (which I found very bizarre -- is that a known issue?).
What I am doing now is basically:
int handles[] = CodeModuleManager.getModuleHandles(); for (int i = 0; i < handles.length; i++) { if (CodeModuleManager.isLibrary(handles[i])) { continue; } String name = CodeModuleManager.getModuleName(handles[i]); if (nameImLookingFor.startsWith(name)) { // Match! System.out.println("match on " + name); nameImLookingFor= name; break; } }
However, while this piece of code works for the problem I was trying to solve, it occurs to me that I would get into trouble if I were looking for a module "MyAppTest" and someone had installed a module called "MyApp" (because I am using a String.startsWith call instead of an exact string match now).
I would love to be able to guarantee some kind of exact matching, but given the differences in the way module names are apparently handled, it doesn't appear that I can. Am I missing something important here? Perhaps a further pattern match that I haven't considered?
Thanks again.
06-30-2009 05:47 PM
06-30-2009 11:23 PM
Symbols conversion is doing by device software.
And seems that different device software versions deal with symbols in different way.
Use english letter symbols to name your application or make a unique prefix in name.
English letter symbols are not processed neither changed by device software.