(I passed the test on 6680 and N70 in the following way)
Under 2nd
After each agent is installed, the installation file is put under C:/system/midlets/. For example, the installation of tellsymbianiloveu. jar will generate the following file:
C:/system/midlets/[1010000ab7]/dump
C:/system/midlets/[10366ab7]/tellsymbianiloveu. Jad
C:/system/midlets/[10366ab7]/tellsymbianiloveu. Jar
C:/system/midlets/[1010000ab7]/UIDs
Among them, 10 bytes ab7 is uid, Which is randomly generated by the Symbian system.
The content of the UIDs file in this folder is as follows:
B71a1321377d1910
In the first eight examples, [1010000ab7] is used, and the last eight are the UID: 10197d97 in C:/system/apps /.
You can find the following folder under C:/system/apps /:
C:/system/apps/[10197d97]/[10197d97]. AIF
C:/system/apps/[10197d97]/[10197d97]. app
C:/system/apps/[10197d97]/[10197d97]. Bin
C:/system/apps/[10197d97]/41510197d97].txt
[10197d97] is the last 8 bits of the previous UIDs file.
Therefore, we can guess that UIDs is a uid image file, which maps the jar files under C:/system/midlets/to the app files under C:/system/apps /.
In this way, we need to start the installed j2s program under 2nd to get the file path.
First scan C:/system/midlets/, find the UIDs file in the same directory as our j2s program, read the last 8-bit uid of the file, then combine the UID into the path of the app file
(Here I will use my j2_program name tellsymbianiloveu. jar as an example)
This process is quite troublesome.
Void getappfilepath (TDES & apath)
{
Rlog: log (_ L ("in getappfilepath ()"));
_ Parameters (kjarfile, "tellsymbianiloveu. Jar ");
_ Outputs (kapppath, "C: // system // apps //[");
# Ifndef _ wins __
_ Queue (kmidlpath, "C: // system // midlets //"); // for real device
# Else
_ Queue (kmidlpath, "C: // logs //"); // For win
# Endif
// Obtain the UIDs file path
Cdirscan * DS = cdirscan: newlc (icoeenv-> fssession ());
Trapd (ERR, DS-> setscandatal (kmidlpath, kentryattnormal, esortbyname | eascending, cdirscan: escandowntree ));
If (Err! = Kerrnone)
{
Cleanupstack: popanddestroy (DS );
Return;
}
Cdir * c = NULL;
Tfilename fullname;
Tbuf <100> jarpath;
While (1)
{
DS-> nextl (C );
If (! C)
Break;
For (tint I = 0; I <c-> count (); I ++)
{
Const tentry E = (* C) [I];
Fullname. Copy (DS-> fullpath ());
Fullname. append (E. INAME );
Tparseptrc P (fullname );
If (! P. nameandext (). Compare (kjarfile ))
{
Rlog: log (fullname );
Rlog: log (P. nameandext ());
Jarpath. Copy (P. Path ());
}
}
Delete C;
C = NULL;
}
Cleanupstack: popanddestroy (DS );
// Read UIDs
Rlog: log (_ L ("jarpath "));
Rlog: log (jarpath); // the value obtained here is "/system/midlets/[10366ab7]/"
Tbuf <100> uidspath;
Uidspath. append (_ L ("C :"));
Uidspath. append (jarpath );
Uidspath. append (_ L ("UIDs "));
Rlog: log (uidspath); // you can obtain C:/system/midlets/[10366ab7]/UIDs.
Tint filelength;
Rfs fs;
Rfile file;
FS. Connect ();
File. Open (FS, uidspath, efileread );
File. Size (filelength );
Rlog: log (_ L ("filelength"), filelength );
Hbufc8 * heapbuf = hbufc8: newlc (filelength );
Tptr8 UIDs = heapbuf-> des ();
File. Read (UIDs, filelength );
Rlog: log (UIDs );
File. Close ();
FS. Close ();
// Obtain the UID Value
Tbuf <8> uidbuf;
Tint I = 0;
For (I = 7; I> 3; I --)
{
Tint aint = 0;
Aint = (Tint) UIDs [I];
Rlog: log (_ L ("aint"), aint );
Tint value = aint/16;
Uidbuf. append (ITOA (value ));
Value = aint % 16;
Uidbuf. append (ITOA (value ));
}
Cleanupstack: popanddestroy (); // heapbuf
Rlog: log (uidbuf); // get 10197d97
Tbuf <100> apppath;
Apppath. append (kapppath );
Apppath. append (uidbuf );
Apppath. append (_ L ("] // [");
Apppath. append (uidbuf );
Apppath. append (_ L ("]. app "));
Apath. Copy (apppath );
Rlog: log (apath); // get C:/system/apps/[10197d97]/[10197d97]. app
Return;
}
Tchar ITOA (tint aint)
{
If (aint <0 | aint> 15)
{
Rlog: log (_ L ("eeror in ITOA"), aint );
Return aint;
}
Switch (aint)
{
Case 0:
Case 1:
Case 2:
Case 3:
Case 4:
Case 5:
Case 6:
Case 7:
Case 8:
Case 9:
Return aint + 48;
Case 10:
Case 11:
Case 12:
Case 13:
Case 14:
Case 15:
Return aint + 87;
}
}
Void dolaunchlorophyll ()//
{
Rlog: log (_ L ("in dolaunchlorophyll ()"));
Tbuf <100> path;
Path. Copy (_ L8 ("Err "));
Getappfilepath (PATH );
// Start
Capacommandline * cmdline = capacommandline: newlc ();
Using line-> setlibrarynamel (PATH );
Using line-> setcommandl (eapacommandrun );
Rapalssession ls;
User: leaveiferror (LS. Connect ());
Cleanupclosepushl (LS );
User: leaveiferror (LS. Startapp (* using line ));
Cleanupstack: popanddestroy (2); // ls, using line
Rlog: log (_ L ("End dolaunchlorophyll ()"));
}