> no no no!!!
>
> you can pass a parameter in the makePRC bat file!!
>
> i decompiled the PalmDatabase archive and verified this.
>
> -creator ABCD
>
> added to the command line will create it with this ID.. if
> you omit it.. it generates one randomly (using a CRC
> algorithm).
>
> you can control it.. they just did not document how..
> so i had to look at the source code myself.
i have attached the decompiled file (below).. look for
the section (i snipped out the rest) dealing with the
variable 'dbCreator'.
if you supply "-creator <...>" it assigns it the value
you specify, otherwise it creates one using a CRC
routine (in another file - which probably explains
the "randomness").
i decompiled the .class files to obtain this knowledge,
the only thing lacking with KVM is:
a) stability
b) set of classes (basic AWT etc)
to verify, here is the file:
MakePalmApp.java
---
// Decompiled by Jad v1.5.7. Copyright 1997-99 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3)
// Source File Name: MakePalmApp.java
package PalmDatabase;
import java.io.*;
import java.util.*;
// Referenced classes of package PalmDatabase:
// DatabaseGenerator, Bitmap, ClassInfo, ClassPath,
// PalmUtil, Resource
public class MakePalmApp extends DatabaseGenerator
{
public static void main(String args[])
throws IOException
{
new MakePalmApp(args);
}
MakePalmApp(String as[])
throws IOException
{
<snip>
if(!parseArguments(as))
return;
<snip>
writeDatabase(outputFile, dbName, dbCreator, "appl", getResourceList());
}
private boolean parseArguments(String as[])
{
int i;
for(i = 0; i < as.length; i++)
{
String s = as[i];
if(!s.startsWith("-"))
break;
try
{
<snip>
else
if(s.equals("-creator"))
dbCreator = (as[++i] + " ").substring(0, 4);
else
<snip>
if(dbCreator == null)
{
int k = PalmUtil.longCRC(mainClass) >>> 1;
char ac[] = new char[4];
ac[0] = 'J';
ac[1] = (char)(32 + k % 224);
k /= 224;
ac[2] = (char)(32 + k % 224);
k /= 224;
ac[3] = (char)(32 + k % 224);
k /= 224;
if(((ac[1] | ac[2] | ac[3]) & 0x80) == 0)
ac[1 + mainClass.length() % 3] = (char)((0x80 | k) & 0xff);
dbCreator = new String(ac);
if(verbose > 1)
System.out.println("Creator id = " + dbCreator);
}
return true;
}
<snip>
String dbCreator;
<snip>
}
---
for once my Java knowledge might be worth something to people
on this list.
cheers.
az.
--
Aaron Ardiri
Lecturer http://www.hig.se/~ardiri/
University-College i G�vle mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN
Tel: +46 26 64 87 38 Fax: +46 26 64 87 88
Mob: +46 70 352 8192 A/H: +46 26 10 16 11