File: README

package info (click to toggle)
ensymble 0.27-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 476 kB
  • ctags: 414
  • sloc: python: 4,276; makefile: 42; sh: 31
file content (1294 lines) | stat: -rw-r--r-- 42,613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
             The Ensymble developer utilities for Symbian OS
                 Copyright 2006, 2007, 2008 Jussi Ylnen

                         Last updated 2008-06-30


ABOUT
=====

This is the Ensymble developer utilities for Symbian OS(TM), a
collection of Python modules and command line programs for Symbian OS
[1] software development.

Current focus of Ensymble development is to provide useful tools for
making "Python for S60" [2] (also called PyS60) programs. Supported
functions include generation of SIS (installation) packages, merging
several SIS packages into one, (re-)signing existing SIS packages and
modifying extension DLL headers. Support for other Symbian OS software
development tasks will follow.

A long term goal of Ensymble is to provide a cross-platform, open-source
way to do Symbian OS software development, supporting Symbian OS
versions 9.1 and later. The original tools by Symbian are closed source
and only available for the Windows operating system.

Symbian OS is the operating system used by Nokia [3] in some of its
mobile phones [4]. Other manufacturers have also licensed Symbian OS.
Python for S60 is a port of the popular Python programming language [5]
to a Nokia phone platform called S60 [6]. Before November 2005, S60 was
called Series 60.


VERSION COMPATIBILITY
=====================

Ensymble targets Symbian OS v9.1 and later. For Nokia phones, this means
S60 3rd Edition. 1st and 2nd Edition phones are not directly supported
by Ensymble. A program called py2sisng [7] supports 1st and 2nd Edition
phones and can be used for a subset of tasks that Ensymble performs.

The py2sis command of the Ensymble command line tool produces
installation packages (SIS) for Python for S60 version 1.4.0 and later.
Version 1.4.0 of Python for S60 is the first officially signed release
from Nokia. Although packages generated with Ensymble also work with
PyS60 from v1.3.8 upto v1.3.23, a harmless warning is generated during
installation for a missing Python for S60 component.

Ensymble is written in Python. Python v2.2 or newer is required, as
older versions lack necessary language features. Ensymble has been
tested on the following systems:

 * Debian GNU/Linux Sid (i386) with Python v2.3.5 and v2.4.4
 * Red Hat Linux release 9 (i386) with Python v2.2.2
 * Red Hat Enterprise Linux AS release 3 (i386) with Python v2.2.3
 * Red Hat Enterprise Linux AS release 4 (i386) with Python v2.3.4
 * Apple OS X Tiger (G4) with Python v2.3.5
 * Apple OS X Leopard (i386) with Python v2.5
 * Microsoft Windows XP, SP2 with Python v2.5

Note: Python for S60 versions 1.3.20 and older require that SIS files
generated by Ensymble are installed into main phone memory instead of
memory card. This bug has been corrected in version 1.3.21 of PyS60.


INSTALLATION
============

Care has been taken to ensure that minimum amount of extra software is
needed to run Ensymble. A working installation of Python is required
(see VERSION COMPATIBILITY above). In addition, the OpenSSL command line
tool [8] is required for installation package (SIS) generation, merging
and (re-)signing. Any recent version will do, and can usually be found
pre-installed. For Windows, the Stunnel OpenSSL binaries [9] are
recommended, but any other binaries will do as well.

The Ensymble command line tool is normally installed as a single file
"ensymble.py". This file contains everything except the OpenSSL command
line tool and is created using Fredrik Lundh's nifty squeeze utility
[10]. Pre-squeezed files for various Python versions may be downloaded
from the Ensymble home page. To find out which version to download, type
"python -V" on the command line:

    $ python -V
    Python 2.4.4

or

    C:\> python -V
    Python 2.4.4

A pre-squeezed version for Python 2.4 would be the correct one in this
case.

Users on Unix-like systems (Linux, *BSD, Apple OS X) can download the
correct pre-squeezed version and put in in the "bin" directory under the
user's home directory (if such a thing exists), and possibly rename the
file to "ensymble.py" as well.

Windows users need to download "openssl.zip" (NOT "stunnel-n.nn.exe" or
"stunnel-n.nn-installer.exe") [9] and unpack it somewhere, for example
"C:\Ensymble", and then put the correct pre-squeezed version of Ensymble
there as well, renamed to "ensymble.py":

    C:\Ensymble\      [directory]
        ensymble.py   [76046 bytes]
        openssl.exe   [1153024 bytes]
        libssl32.dll  [632226 bytes]
        libeay32.dll  [1578787 bytes]

To allow using the Ensymble command line tool without explicitly giving
a full command path each time, it is advisable to add the installation
directory ("C:\Ensymble" in the example above) in the Path environment
variable in Windows' environment variables dialog (My Computer ->
Properties -> Advanced -> Environment Variables -> System Variables ->
Path). The Command Prompt window must be restarted after the change.

Installation is also possible from the original source package. For
Unix-like systems, there is a simple installation script which squeezes
all the required files together and copies the resulting package to a
given directory (which must exist already):

    $ ./install.sh ~/bin


USAGE
=====

DESCRIPTION

The Ensymble command line tool provides access to most Ensymble
functionality:

    $ ensymble.py command options...

, where "command" is the command to be executed and "options" are the
command specific options. Running ensymble.py without arguments will
list all the available commands.

The following commands are currently supported by Ensymble:

    altere32   Alter the IDs and capabilities of e32image files (EXEs, DLLs)
    infoe32    Show the IDs and capabilities of e32image files (EXEs, DLLs)
    mergesis   Merge several SIS packages into one
    py2sis     Create a SIS package for a "Python for S60" application
    signsis    Sign a SIS package
    simplesis  Create a SIS package from a directory structure
    version    Print Ensymble version

Each command is documented in detail below.

Note about security: When using SIS certificates, the private key of the
certificate is saved unencrypted to a temporary file and could be
recovered by others. This is due to compatibility with old versions of
OpenSSL. In the future, Ensymble may require a more recent version of
OpenSSL.


COMMON OPTIONS

    --encoding=terminal,filesystem
    -e terminal,filesystem

Local character encodings for terminal and filesystem. For example
"--encoding=utf8,latin1", if the terminal is using a UTF-8 character set
and the filesystem is still using the older latin1 (ISO-8859-1)
character set. See [11] for a list of Python standard encodings.

The encodings will be autodetected most of the time, but on some special
environments this may not be possible, hence this option.

    --verbose
    -v

Print extra statistics, such as file names, option summary.

    --help
    -h

On-line help for a command can be found using this option.


EXAMPLES

    $ ensymble.py

    Ensymble developer utilities for Symbian OS

    usage: ensymble.py command [command options]...

    Commands:
        altere32   Alter the IDs and capabilities of e32image files (EXEs, DLLs)
        infoe32    Show the IDs and capabilities of e32image files (EXEs, DLLs)
        mergesis   Merge several SIS packages into one
        py2sis     Create a SIS package for a "Python for S60" application
        signsis    Sign a SIS package
        simplesis  Create a SIS package from a directory structure
        version    Print Ensymble version

    Use 'ensymble.py command --help' to get command specific help.

When no commands and options are given, Ensymble prints a short help.

    $ ensymble.py version -h

    Ensymble developer utilities for Symbian OS

    usage: ensymble.py version

    Print Ensymble version.

Each command has an on-line help. A short description of what the
command does and a list of options are printed.


The "altere32" command
----------------------

SYNOPSIS

    $ ensymble.py altere32
        [--uid=0x01234567] [--secureid=0x01234567] [--vendorid=0x01234567]
        [--caps=Cap1+Cap2+...] [--encoding=terminal,filesystem] [--verbose]
        <infile> <outfile>

or

    $ ensymble.py altere32
        [--uid=0x01234567] [--secureid=0x01234567] [--vendorid=0x01234567]
        [--caps=Cap1+Cap2+...] [--encoding=terminal,filesystem] [--verbose]
        --inplace <infile>...


DESCRIPTION

The "altere32" command alters the IDs and capabilities of e32image files
(Symbian EXEs and DLLs). Extension module authors can use this command
to quickly generate variations of extension modules without recompiling.


PARAMETERS

    infile

Path of the original e32image file. If option "--inplace" (see below) is
set, there may be more than one file name present.

    outfile

Path of the modified e32image file. Only used when not using option
"--inplace", see below. If a directory name is given, input file name is
used as the output file name.

    --inplace
    -i

Allow more than one input file name, modify input files in-place.

Note: Use this option with caution, as no backups of the original files
will be made!

    --uid=0x01234567
    -u 0x01234567

Symbian UID for the e32image. This is normally same as the secure ID,
see below. If this option is not given, the UID is not changed.

    --secureid=0x01234567
    -s 0x01234567

Secure ID for the e32image. This is normally same as the UID, see above.
If this option is not given, the secure ID is not changed.

    --vendorid=0x01234567
    -r 0x01234567

Vendor ID for the e32image. In most cases the vendor ID is 0. If this
option is not given, the vendor ID is not changed.

    --caps=Cap1+Cap2+...
    -b Cap1+Cap2+...

or

    --caps=0x12345
    -b 0x12345

Capability names separated by "+" or a numeric capability bitmask. If no
capability option is given, capabilities are not changed.

    --heapsize=min,max
    -H min,max

Heap size limits for the e32image, only valid for EXEs. If no heap size
option is given, the heap size limits are not changed. If only one value
is given, it is used as both the heap minimum value and heap maximum
value.

Values may have suffix "k" or "M" (case insensitive) to denote kilobytes
(1024 bytes) and megabytes (1048576 bytes), respectively.

The heap minimum value determines if a program is allowed to start. If
less than the set amount of memory is available, program start-up fails.
The heap maximum value limits the memory a program can allocate. Memory
allocations beyond the set limit will fail.


EXAMPLES

Note: The command lines below may be wrapped over multiple lines due to
layout constraints. In reality, each of them should be contained in one
physical command line, with no spaces around the "+" characters.

    $ ensymble.py altere32
        --caps=LocalServices+Location+NetworkServices+PowerMgmt+ProtServ+
        ReadUserData+SurroundingsDD+SWEvent+UserEnvironment+WriteUserData+
        ReadDeviceData+TrustedUI+WriteDeviceData
        myextension_orig.pyd myextension.pyd

This will modify "myextension_orig.pyd" (a "Python for S60" extension
DLL) with the capabilities listed, and generate file "myextension.pyd"
with the new capabilities.

    $ ensymble.py altere32 --caps=0xff1b4 --inplace *.dll

This modifies every DLL file in the current directory using the same
capabilities as above but in a numeric form. Original files will be
modified, so use the "--inplace" option with caution!

    $ ensymble.py altere32 --heapsize=4k,4M myapp_orig.exe myapp.exe

Program "myapp.exe" is modified so that it can allocate upto four
megabytes of memory. Heap minimum value is usually kept at the default
four kilobytes.

Note: When modifying the UID, the secure ID should be modified
accordingly. Modifying UIDs of application EXEs is generally not
possible, because applications usually include the UID in program code
as well.


The "infoe32" command
---------------------

SYNOPSIS

    $ ensymble.py infoe32
    [--encoding=terminal,filesystem] [--verbose]
    <infile>...


DESCRIPTION

The "infoe32" displays information about Symbian e32image files (Symbian
EXEs and DLLs). All three UIDs as well as the vendor ID and secure ID
are printed. Capabilities are displayed textually and as a hexadecimal
number.


PARAMETERS

    infile

One or more e32image files to inspect.


EXAMPLES

    $ ensymble.py infoe32 myprogram.exe somelibrary.dll
    myprogram.exe:
        UID1          0x1000007a
        UID2          0x100039ce
        UID3          0x12345678
        Secure ID     0x12345678
        Vendor ID     0x00000000
        Capabilities  0x0 (NONE)
    somelibrary.dll:
        UID1          0x10000079
        UID2          0x00000000
        UID3          0x00000000
        Secure ID     0x00000000
        Vendor ID     0x00000000
        Capabilities  0xff7be (ALL-TCB-DRM-AllFiles)

This will display information about "myprogram.exe" and
"somelibrary.dll".


The "mergesis" command
----------------------

SYNOPSIS
    $ ensymble.py mergesis
        [--cert=mycert.cer] [--privkey=mykey.key] [--passphrase=12345]
        [--encoding=terminal,filesystem] [--verbose]
        <infile> [mergefile]... <outfile>


DESCRIPTION

The "mergesis" command takes a set of SIS files and inserts them as
unconditional embedded SIS files in the first one. The resulting SIS
package is then signed with the certificate provided. None of the
certificates of the first SIS file are preserved.

Note: The "mergesis" command will only work with SIS files that do not
already contain other embedded SIS files.


PARAMETERS

    infile

Path of the base SIS file.

    mergefile

Zero or more SIS files to embed in the base sis file.

    outfile

Path of the resulting SIS file. If a directory name is given, base SIS
file name is used as the output file name.

    --cert=mycert.cer
    -a mycert.cer

Certificate to use for signing in PEM (text) format. If no certificate
and its private key are given, Ensymble uses a default self-signed
certificate (see option "--cert" for command "py2sis" above).

    --privkey=mykey.key
    -k mykey.key

Private key of the certificate in PEM (text) format. If option "--cert"
(above) is given, this option is required as well.

    --passphrase=12345
    -p 12345

Pass phrase of the private key.

Note: Using command line options to give the pass phrase is insecure.
Any user of the computer will be able to see command lines of started
programs and thus will see the pass phrase in plain view. Instead,
standard input should be used (see examples below).

If no pass phrase is given on the command line or standard input, it
will be asked interactively.


EXAMPLES

Note: The command lines below may be wrapped over multiple lines due to
layout constraints. In reality, each of them should be contained in one
physical command line.

    $ ensymble.py mergesis
        --cert=mycert.cer --key=mykey.key --passphrase=12345
        myapp_v1_0_0.sis PythonForS60_1_3_17_3rdEd_selfsigned.SIS
        myapp_standalone_v1_0_0.sis

A Python for S60 script "myapp_v1_0_0.sis" will be merged with Python
runtime SIS "PythonForS60_1_3_17_3rdEd_selfsigned.SIS". A new SIS file
"myscript_standalone_v1_0_0.sis" will be created and signed with
"mycert.cer" using private key "mykey.key".

    $ echo "12345" | ensymble.py mergesis
        --cert=mycert.cer --key=mykey.key
        basefile.sis addon1.sis addon2.sis

Pass phrase can be given in Ensymble standard input, so that it will not
be visible to all users of the computer (see option "--passphrase"
above).


The "py2sis" command
--------------------

SYNOPSIS

    $ ensymble.py py2sis
        [--uid=0x01234567] [--appname=AppName] [--version=1.0.0]
        [--lang=EN,...] [--icon=icon.svg] [--shortcaption="App. Name",...]
        [--caption="Application Name",...] [--drive=C]
        [--textfile=mytext_%C.txt] [--cert=mycert.cer] [--privkey=mykey.key]
        [--passphrase=12345] [--caps=Cap1+Cap2+...]
        [--vendor="Vendor Name",...] [--autostart]
        [--encoding=terminal,filesystem] [--verbose]
        <src> [sisfile]


DESCRIPTION

The "py2sis" command is used to pack a Python for S60 application script
and its auxiliary files (if any) into a Symbian installation package
(SIS).


PARAMETERS

    src

The source script or directory name. When a directory name is given, the
directory structure is preserved under an application specific private
directory ("\private\<uid>\") on the phone. A file called "default.py"
is required to exist on the root of the directory given. This will be
the main file that starts the application. (See option "--extrasdir"
below for more options for file placement.)

When a regular file name is given, it will be located under the
application specific private directory, with the name "default.py".

    sisfile

Path of the SIS file to create. If a directory name is given, output
file name is derived from input file name and application version (see
option "--version" below). This is also the case when no SIS file name
is given.

    --appname=AppName
    -n AppName

Name of the application. If no application name is given, it will be
derived from the input file name.

This name is used as the base for all generated file names (EXE, icon,
resources) on the phone. It will also be used as the default caption if
none are given, and a temporary UID (see option "--uid" below) will be
generated from application name if not given explicitly.

    --uid=0x01234567
    -u 0x01234567

Symbian UID for the application. If the UID option is not given, the
main Python file ("default.py", see parameter "src" above) will be
scanned for a special string. If no UID can be found, a temporary UID is
generated from the application name (see option "--appname" above).

The special UID string can appear anywhere in the main Python file,
including comments and as part of string literals. It is of the form

    SYMBIAN_UID = UID

, where whitespace around the equals sign is optional. UID is in the
same format as with the command line parameter (see option "--uid"
above).

Note: Use a real UID for all applications to be distributed. The
auto-generated test UID is only meant for development and testing, not
for real applications. UIDs can be ordered from Symbian Signed [12]. If
you have already ordered UIDs for 1st or 2nd Edition phones, to use
these UIDs in 3rd Edition phones the first hex digit (a "1") needs to be
changed to an "f".

Also note: When changing the application name (or source file /
directory name in case no application name is explicitly given), the
temporary UID changes and the SIS package will be considered a new
application on the phone, unless an UID is explicitly specified.

    --version=1.0.0
    -r 1.0.0

Application version: X.Y.Z or X,Y,Z (major, minor, build). There may be
a "v" or "V" in front of the major number. Minor and build numbers are
optional.

If the version option is not given, the main Python file ("default.py",
see parameter "src" above) will be scanned for a special string. If no
version can be found, it defaults to 1.0.0.

The special version string can appear anywhere in the main Python file,
including comments and as part of string literals. It is of the form

    SIS_VERSION = "1.0.0"

, where whitespace around the equals sign is optional. Version is in the
same format as with the command line parameter (see option "--version"
above), except that it may optionally be enclosed in single or double
quotes.

    --lang=EN,...
    -l EN,...

Comma separated list of two-character language codes. These are the
languages that the SIS file claims to support, English by default.
Application must then somehow determine which language was selected
during install. Symbian installation tools reference [13] lists the
available language codes.

    --icon=icon.svg
    -i icon.svg

Icon file in SVG-Tiny format. If no icon is given, the Python logo is
used as the icon. The Python logo is a trademark of the Python Software
Foundation.

Ensymble does not support the old style MBM bitmap icons.

    --shortcaption="App. Name",...
    -s "App. Name",...

    --caption="Application Name",...
    -c "Application Name",...

Comma separated list of short and long captions in all selected
languages, i.e. there must be as many comma separated captions as there
are languages listed with the "--lang" option. If no captions are given,
application name is used (see option "--appname" above). If only the
short captions are given, long captions will use those instead.

Captions are visible names used in various places on the phone display.
Short caption is displayed under the application icon when using the
grid layout. Long caption is used on top of the screen when the
application is launched and beside the icon in list layout. Long caption
is also used as the package name, which is displayed during application
installation.

    --drive=C
    -f C

Installation drive "C" or "E" or "any", to select where the SIS is to be
installed. Default is "any", which causes the phone to ask the user
where to install the package.

    --extrasdir=root
    -x root

Name of "extras" directory under the application source directory. The
extras directory contains a directory tree which is placed under the
root of the installation drive, instead of in the application private
directory. If no extras directory name is given, this feature is
disabled.

Option "--extrasdir" is similar to the "simplesis" command (see below).
It allows placing files under "\sys\bin" and "\resource", for example.

    --textfile=mytext_%C.txt
    -t mytext_%C.txt

Text file (or pattern, see below) to display during install. If none is
given, no extra text will be displayed during install.

Files to display are in UTF-8 encoding, without Byte-Order Marker (BOM).
The file name may contain formatting characters that are substituted for
each selected language (see option "--lang" above). If no formatting
characters are present, the same text will be used for all languages.

    %%           - literal %
    %n           - language number (01 - 99)
    %c           - two-character language code in lowercase letters
    %C           - two-character language code in capital letters
    %l           - language name in English, using only lowercase letters
    %l           - language name in English, using mixed case letters

For example, if there are files named "mytext_EN.txt", "mytext_GE.txt"
and "mytext_SP.txt", a pattern of "mytext_%C.txt" will be able to use
them.

    --cert=mycert.cer
    -a mycert.cer

Certificate to use for signing in PEM (text) format.

SIS files for Symbian OS v9 and later are required to be digitally
signed. Unsigned packages will not install on the phone. A
self-generated ("self-signed" in crypto parlance) certificate will do,
but only a restricted subset of features ("capabilities", see option
"--caps" below) are available for self-signed applications.

If no certificate and its private key are given, Ensymble uses a default
self-signed certificate. Software authors are encouraged to create their
own unique certificates for SIS packages that are to be distributed.

    --privkey=mykey.key
    -k mykey.key

Private key of the certificate in PEM (text) format. If option "--cert"
(above) is given, this option is required as well.

    --passphrase=12345
    -p 12345

Pass phrase of the private key.

Note: Using command line options to give the pass phrase is insecure.
Any user of the computer will be able to see command lines of started
programs and thus will see the pass phrase in plain view. Instead,
standard input should be used (see examples below).

If no pass phrase is given on the command line or standard input, it
will be asked interactively.

    --caps=Cap1+Cap2+...
    -b Cap1+Cap2+...

or

    --caps=0x12345
    -b 0x12345

Capability names separated by "+" or a numeric capability bitmask. If no
capability option is given, the application will not have any special
capabilities. Symbian Signed [12] has an FAQ which explains all the
available capabilities.

    --vendor=Name,...
    -d Name,...

Comma separated list of vendor names in all selected languages, i.e.
there must be as many comma separated vendor names as there are
languages listed with the "--lang" option. Alternatively, if only one
vendor name is given, it will be used for all languages. If no vendor
names are given then "Ensymble" will be used.

Vendor name is visible during installation and on the Application
manager, except when using self-signed certificates (see option "--cert"
above).

    --autostart
    -g

Flag to control automatic startup of the application. On S60 3rd Edition
phones, an application can register itself to be automatically started
when the phone is turned on.

Note: Self-signed applications and applications with UID in the
unprotected range cannot register to be automatically started (see
options "--uid" and "--cert" above).

    --runinstall
    -R

Run the application after installation. After copying all files to the
phone, the application is automatically started.

Note: Phones will ignore this flag in SIS files using self-signed
certificates (see option "--cert" above).

    --heapsize=min,max
    -H min,max

Heap size limits for the application. Defaults of 4 kilobytes and one
megabyte are used if no heap size option is given. If only one value is
given, it is used as both the heap minimum and heap maximum value.

Values may have suffix "k" or "M" (case insensitive) to denote kilobytes
(1024 bytes) and megabytes (1048576 bytes), respectively.

The heap minimum value determines if a program is allowed to start. If
less than the set amount of memory is available, program start-up fails.
The heap maximum value limits the memory a program can allocate. Memory
allocations beyond the set limit will fail. The default of one megabyte
is usually enough, but processing large datasets such as images from an
integrated camera might require setting the heap maximum value higher.


EXAMPLES

Note: The command lines below may be wrapped over multiple lines due to
layout constraints. In reality, each of them should be contained in one
physical command line.

    $ ensymble.py py2sis myprog.py

This generates a SIS file called "myprog_v1_0_0.sis" in current working
directory. This SIS file is ready to be uploaded to a S60 3rd Edition
phone. Package version defaults to 1.0.0, a test UID is auto-generated
for the package and a default self-signed certificate is used to
digitally sign the SIS file. A default icon (the Python logo) is used
for application icon.

    $ echo "12345" | ensymble.py py2sis
        --cert mycert.cer --privkey mykey.key
        myprog.py

Pass phrase can be given in Ensymble standard input, so that it will not
be visible to all users of the computer (see option "--passphrase"
above).


The "signsis" command
---------------------

SYNOPSIS

    $ ensymble.py signsis
        [--cert=mycert.cer] [--privkey=mykey.key] [--passphrase=12345]
        [--execaps=Cap1+Cap2+...] [--dllcaps=Cap1+Cap2+...]
        [--encoding=terminal,filesystem] [--verbose]
        <infile> [outfile]


DESCRIPTION

The "signsis" command (re-)signs a SIS package with the certificate
provided, stripping out any existing certificates, if any. Capabilities
of all EXE and DLL files contained in the SIS package can optionally be
modified.

Extension module authors may want to distribute a version of their SIS
packages with only limited capabilities. Users can then adjust the
capabilities according to their own needs and sign the SIS package with
their own certificates.

Note: SIS packages may embed other SIS packages. The "signsis" command
will only alter the main SIS, leaving all embedded SIS packages intact.


PARAMETERS

    infile

Path of the original SIS file.

    outfile

Path of the modified SIS file. If a directory name is given, input file
name is used as the output file name.

Note: If no output file name is given, original SIS file is overwritten!

    --cert=mycert.cer
    -a mycert.cer

Certificate to use for signing in PEM (text) format. If no certificate
and its private key are given, Ensymble uses a default self-signed
certificate (see option "--cert" for command "py2sis" above).

    --privkey=mykey.key
    -k mykey.key

Private key of the certificate in PEM (text) format. If option "--cert"
(above) is given, this option is required as well.

    --passphrase=12345
    -p 12345

Pass phrase of the private key.

Note: Using command line options to give the pass phrase is insecure.
Any user of the computer will be able to see command lines of started
programs and thus will see the pass phrase in plain view. Instead,
standard input should be used (see examples below).

If no pass phrase is given on the command line or standard input, it
will be asked interactively.

    --execaps=Cap1+Cap2+...
    -b Cap1+Cap2+...

or

    --execaps=0x12345
    -b 0x12345

Capability names separated by "+" or a numeric capability bitmask. EXEs
inside the SIS file will be modified according to these capabilities. If
no capability option is given, no EXEs will be modified. Symbian Signed
[12] has an FAQ which explains all the available capabilities.

    --dllcaps=Cap1+Cap2+...
    -d Cap1+Cap2+...

or

    --dllcaps=0x12345
    -d 0x12345

Capability names separated by "+" or a numeric capability bitmask. DLLs
inside the SIS file will be modified according to these capabilities. If
no capability option is given, no DLLs will be modified.


EXAMPLES

Note: The command lines below may be wrapped over multiple lines due to
layout constraints. In reality, each of them should be contained in one
physical command line, with no spaces around the "+" characters.

    $ ensymble.py signsis
        --dllcaps=LocalServices+Location+NetworkServices+PowerMgmt+ProtServ+
        ReadUserData+SurroundingsDD+SWEvent+UserEnvironment+WriteUserData+
        ReadDeviceData+TrustedUI+WriteDeviceData
        --cert=mycert.cer --key=mykey.key --passphrase=12345
        coolextension_nocert.sis coolextension_mycert.sis

Extension module "coolextension_nocert.sis" will be modified with the
capabilities listed. A new SIS file "coolextension_mycert.sis" will be
created and signed with "mycert.cer" using private key "mykey.key".

    $ echo "12345" | ensymble.py signsis
        --dllcaps=0xff1b4 --cert=mycert.cer --key=mykey.key
        coolextension_nocert.sis coolextension_mycert.sis

Pass phrase can be given in Ensymble standard input, so that it will not
be visible to all users of the computer (see option "--passphrase"
above).


The "simplesis" command
-----------------------

SYNOPSIS

    $ ensymble.py simplesis
        [--uid=0x01234567] [--version=1.0.0] [--lang=EN,...]
        [--caption="Package Name",...] [--drive=C] [--textfile=mytext_%C.txt]
        [--cert=mycert.cer] [--privkey=mykey.key] [--passphrase=12345]
        [--vendor="Vendor Name",...] [--encoding=terminal,filesystem]
        [--verbose]
        <srcdir> [sisfile]


DESCRIPTION

The "simplesis" command is used to create a Symbian installation package
(SIS) from an existing directory structure. Conditional inclusion of
files, dependencies or other fancy features of SIS files are not
supported.


PARAMETERS

    srcdir

The source directory name. The directory structure is preserved under
the installation drive, i.e files and directories under "srcdir" will be
located on the root of the installation drive.

    sisfile

Path of the SIS file to create. If a directory name is given, output
file name is derived from source directory name and package version (see
option "--version" below). This is also the case when no SIS file name
is given.

    --uid=0x01234567
    -u 0x01234567

Symbian UID for the package. If the UID option is not given, the source
directory name will be used to generate a temporary UID.

Note: Use a real UID for all packages to be distributed. The
auto-generated test UID is only meant for development and testing, not
for real packages. UIDs can be ordered from Symbian Signed [12]. If you
have already ordered UIDs for 1st or 2nd Edition phones, to use these
UIDs in 3rd Edition phones the first hex digit (a "1") needs to be
changed to an "f".

Also note: When changing the source directory name, the temporary UID
changes and the SIS package will be considered a new application on the
phone.

    --version=1.0.0
    -r 1.0.0

Package version: X.Y.Z or X,Y,Z (major, minor, build). There may be a
"v" or "V" in front of the major number. Minor and build numbers are
optional.

If the version option is not given it defaults to 1.0.0.

    --lang=EN,...
    -l EN,...

Comma separated list of two-character language codes. These are the
languages that the SIS file claims to support, English by default.
Symbian installation tools reference [13] lists the available language
codes.

    --caption="Application Name",...
    -c "Application Name",...

Comma separated list of package captions in all selected languages, i.e.
there must be as many comma separated captions as there are languages
listed with the "--lang" option. If no captions are given, source
directory name is used (see parameter "srcdir" above).

Package caption is displayed during application installation.

    --drive=C
    -f C

Installation drive "C" or "E" or "any", to select where the SIS is to be
installed. Default is "any", which causes the phone to ask the user
where to install the package.

    --textfile=mytext_%C.txt
    -t mytext_%C.txt

Text file (or pattern, see below) to display during install. If none is
given, no extra text will be displayed during install.

Files to display are in UTF-8 encoding, without Byte-Order Marker (BOM).
The file name may contain formatting characters that are substituted for
each selected language (see option "--lang" above). If no formatting
characters are present, the same text will be used for all languages.

    %%           - literal %
    %n           - language number (01 - 99)
    %c           - two-character language code in lowercase letters
    %C           - two-character language code in capital letters
    %l           - language name in English, using only lowercase letters
    %l           - language name in English, using mixed case letters

For example, if there are files named "mytext_EN.txt", "mytext_GE.txt"
and "mytext_SP.txt", a pattern of "mytext_%C.txt" will be able to use
them.

    --cert=mycert.cer
    -a mycert.cer

Certificate to use for signing in PEM (text) format.

SIS files for Symbian OS v9 and later are required to be digitally
signed. Unsigned packages will not install on the phone. A
self-generated ("self-signed" in crypto parlance) certificate will do,
but only a restricted subset of features ("capabilities", see option
"--caps" below) are available for self-signed applications.

If no certificate and its private key are given, Ensymble uses a default
self-signed certificate. Software authors are encouraged to create their
own unique certificates for SIS packages that are to be distributed.

    --privkey=mykey.key
    -k mykey.key

Private key of the certificate in PEM (text) format. If option "--cert"
(above) is given, this option is required as well.

    --passphrase=12345
    -p 12345

Pass phrase of the private key.

Note: Using command line options to give the pass phrase is insecure.
Any user of the computer will be able to see command lines of started
programs and thus will see the pass phrase in plain view. Instead,
standard input should be used (see examples below).

If no pass phrase is given on the command line or standard input, it
will be asked interactively.


EXAMPLES

Note: The command lines below may be wrapped over multiple lines due to
layout constraints. In reality, each of them should be contained in one
physical command line.

    $ ls -R mymodule
    mymodule:
    resource/  sys/

    mymodule/resource:
    apps/  mymodule.py

    mymodule/resource/apps:
    mymodule.rsc

    mymodule/sys:
    bin/

    mymodule/sys/bin:
    _mymodule.pyd
    $ ensymble.py simplesis mymodule

This generates a SIS file called "mymodule_v1_0_0.sis" in current
working directory. Contents of the SIS file are directly taken from
directory "mymodule" and the relative path of each file is preserved.
The SIS file is ready to be uploaded to a S60 3rd Edition phone. Package
version defaults to 1.0.0, a test UID is auto-generated for the package
and a default self-signed certificate is used to digitally sign the SIS
file.

    $ echo "12345" | ensymble.py py2sis
        --cert mycert.cer --privkey mykey.key
        mymodule

Pass phrase can be given in Ensymble standard input, so that it will not
be visible to all users of the computer (see option "--passphrase"
above).


The "version" command
---------------------

SYNOPSIS

    $ ensymble.py version


DESCRIPTION

The "version" command prints Ensymble version.


PARAMETERS

No parameters


EXAMPLES

    $ ensymble.py version
    Ensymble v0.27 2008-06-30

The version string is printed.


PROJECT HISTORY
===============

2008-06-30
Released Ensymble version v0.27 2008-06-30.
Implemented --heapsize option for the py2sis and altere32 commands.
Implemented --extrasdir option for the py2sis command for more flexibility.
Added support for PKCS#8 format private keys which Symbian sends to people.

2008-01-27
Released Ensymble version v0.26 2008-01-27.
Incorporated a --runinstall option for the py2sis command, by Jari Kirma.
Commands mergesis and signsis no longer choke on extra bytes in input SIS files.

2007-12-15
Released Ensymble version v0.25 2007-12-15.
Added --drive option to py2sis and simplesis commands, for installation drive.
Added --vendor option for the simplesis command, as well.
The OpenSSL command line tool can reside in the same directory as Ensymble now.
Prevent leaving zero-byte output files behind when no OpenSSL tool is found.
Made it possible to use numeric capability bitmasks.
Rewrote installation instructions to better take Windows users into account.

2007-10-18
Released Ensymble version v0.24 2007-10-18.
Added --autostart option to the py2sis command, like in the official py2sis.
Added --vendor option to the py2sis command, useful when signing packages.
Added infoe32 command contributed by Martin Storsj.

2007-07-16
Released Ensymble version v0.23 2007-07-16.
Python for S60 changed its UID due to Nokia finally signing it, adapted.
Clarified README in using embedded version and UID strings with py2sis command.

2007-02-08
Released Ensymble version 2007-02-08 v0.22.
Added simplesis command for creating a SIS package out of a directory structure.
Added maximum file size sanity check for py2sis command.

2007-02-01
Released Ensymble version 2007-02-01 v0.21.
Added mergesis command for combining several SIS files into one.

2007-01-01
Released Ensymble version 2007-01-01 v0.20.
Revamped documentation. Now every command and option is explained.
Added signsis command for (re-)signing SIS files.
Added altere32 command for altering pre-compiled Symbian EXEs and DLLs.
Implemented text file option for py2sis command ("Freeware Route to Market").
Made py2sis language option more robust against mistyped language codes.
Made it possible modify signatures of an existing SISController object.
Generated capability fields are smaller now (4 bytes instead of 8 bytes).
Moved default certificate to its own module: defaultcert.py.
Made exception dumps more verbose when the --debug option is present.
Miscellaneous clean-ups.

2006-11-18
Released Ensymble version 2006-11-18 v0.15.
Rewrote certificate to binary conversion. Fixes problems on Windows.
Removed line feed after pass phrase for OpenSSL. It will not work on Windows.

2006-11-12
Released Ensymble version 2006-11-12 v0.14.
Modified the generated SIS a bit, to be compatible with native signsis.exe.
Test UIDs use lower case appname now, due to Symbian OS being case insensitive.
Added support for signature chains. Symbian Signed uses those.

2006-10-06
Fourth public preview release: 2006-10-06 v0.13
OpenSSL invocation uses absolute paths now. Windows XP Pro should work now.

2006-10-05
Third public preview release: 2006-10-05 v0.12
Implemented automatic test UID generation for the py2sis command.
Added warning message for UIDs in the protected range.
Changed OpenSSL path detection to be carried out only on demand.
Added debug messages for troubleshooting OpenSSL-related problems.
Miscellaneous clean-ups

2006-09-26
Second public preview release: 2006-09-26 v0.11
Made the default certificate a bit more anonymous.
Added Windows (NT/2000/XP) support.

2006-09-25
Tested Ensymble on Python v2.2.
Added COPYING file to the source package.
Minor edits to README and ensymble.html

2006-09-24
First public preview release: 2006-09-24 v0.10


LICENSE
=======

Ensymble developer utilities for Symbian OS(TM)
Copyright 2006, 2007 Jussi Ylnen
Released under the GNU General Public Licence (see file COPYING)


CONTACT
=======

Official web page for Ensymble can be found at

        http://www.nbl.fi/jussi.ylanen/ensymble.html


Please send comments, suggestions, corrections and enhancements to:

        jussi.ylanen@iki.fi


ACKNOWLEDGEMENTS
================

Symbian and all Symbian-based marks and logos are trade marks of Symbian
Limited.

"Python" and the Python logo are trademarks or registered trademarks of
the Python Software Foundation.

Nokia, S60 and logo, Series 60 are trademarks or registered trademarks
of Nokia Corporation.

Windows is a registered trademark of Microsoft Corporation in the United
States and other countries.


REFERENCES
==========

[1]
Symbian OS
http://www.symbian.com

[2]
Python for S60
http://www.forum.nokia.com/python

[3]
Nokia
http://www.nokia.com

[4]
A list of Nokia S60 phone editions:
http://www.forum.nokia.com/devices/matrix_s60_1.html

[5]
The Python programming language
http://www.python.org

[6]
S60 Platform
http://www.s60.com

[7]
Python-to-SIS, the next generation by Jussi Ylnen
http://www.nbl.fi/jussi.ylanen/py2sisng.html

[8]
OpenSSL
http://www.openssl.org

[9]
Stunnel OpenSSL binaries
http://www.stunnel.org/download/binaries.html

[10]
squeeze utility by Fredrik Lundh
http://effbot.org/zone/squeeze.htm

[11]
Python standard encodings
http://docs.python.org/lib/standard-encodings.html

[12]
Symbian Signed
http://www.symbiansigned.com

[13]
Symbian installation tools reference
http://www.symbian.com/developer/techlib/v70sdocs/doc_source/ToolsAndUtilities/Installing-ref/PackageFileFormatReference.guide.html