os/security/cryptoservices/certificateandkeymgmt/twtlscert/scripts/batchfiles/certstorePlugins
Update contrib.
5 # Controls the availability of cert store plugins on the emulator, for testing
8 $UsageMessage = <<"EOF";
10 pluginScript disable PLUGIN
11 Disable the specified plugin by moving it to a backup location
12 pluginScript disable_all
14 pluginScript enable PLUGIN
15 Enable the specified plugin by copying the backup to its original location
16 pluginScript list PLATFORM BUILD
17 List the currently enabled plugins for the specified platform and build
18 (default is winscw udeb)
21 @plugins = ('filecertstore.dll',
22 'tadditionalstores.dll',
23 'tadditionalstoressoftware.dll',
25 'swicertstoreplugin.dll',
29 'tDeviceImmutablestores.dll',
30 'MIDP2CertStore.dll');
32 @platforms = ('wins', 'winscw');
34 @builds = ('udeb', 'urel');
36 $EpocRoot = $ENV{'EPOCROOT'} . "epoc32";
46 print "Copying $from -> $to\n";
47 die "Can't copy: $!" unless system("cmd", "/c", "copy", $from, $to) == 0;
53 print "Deleting $file\n";
54 die "Can't delete '$file': $!" unless unlink $file;
62 print "Creating $dir\n";
63 die "Can't create dir '$dir': $!" unless mkdir $dir;
70 $plugin =~ s/\.dll/.rsc/i;
71 return -f "$EpocRoot\\data\\z\\resource\\plugins\\$plugin"
76 my ($plugin, $path) = @_;
78 if (isSecure($plugin))
84 return "$path\\z\\system\\libs\\plugins";
90 my ($plugin, $path) = @_;
92 if (isSecure($plugin))
94 return "$path\\plugins_backup";
98 return "$path\\z\\system\\libs\\plugins_backup";
106 for my $platform (@platforms)
108 for my $build (@builds)
110 my $path = "$EpocRoot\\release\\$platform\\$build";
112 my $backupDir = backupDir($plugin, $path);
113 my $pluginDir = pluginDir($plugin, $path);
114 my $pluginFile = "$pluginDir\\$plugin";
115 my $backupFile = "$backupDir\\$plugin";
119 # Always copy, in case plugin has been rebuilt
120 ensureDir($backupDir);
121 copyFile($pluginFile, $backupDir);
123 deleteFile($pluginFile);
131 for my $plugin (@plugins)
141 for my $platform (@platforms)
143 for my $build (@builds)
145 my $path = "$EpocRoot\\release\\$platform\\$build";
147 my $backupDir = backupDir($plugin, $path);
148 my $pluginDir = pluginDir($plugin, $path);
149 my $pluginFile = "$pluginDir\\$plugin";
150 my $backupFile = "$backupDir\\$plugin";
152 if (! -f $pluginFile && -f $backupFile)
154 copyFile($backupFile, $pluginDir);
162 my ($platform, $build) = @_;
163 my $path = "$EpocRoot\\release\\$platform\\$build";
165 printf "%-32s %-12s %s\n", "Plugin:", "Type:", "Status:";
167 for my $plugin (@plugins)
169 my $secure = isSecure($plugin);
174 $enabled = -f "$path\\$plugin";
178 $enabled = -f "$path\\z\\system\\libs\\plugins\\$plugin";
181 my $secureMess = $secure ? 'secure' : 'old-style';
182 my $enabledMess = $enabled ? 'enabled' : 'disabled';
184 printf "%-32s %-12s %s\n", $plugin, $secureMess, $enabledMess;
190 my $action = shift || usage();
191 if ($action eq 'backup_all')
195 elsif ($action eq 'disable')
197 my $plugin = shift || usage();
198 usage() unless grep { $_ eq $plugin } @plugins;
201 elsif ($action eq 'disable_all')
205 elsif ($action eq 'enable')
207 my $plugin = shift || usage();
208 usage() unless grep { $_ eq $plugin } @plugins;
211 elsif ($action eq 'list')
213 my $platform = shift || 'winscw';
214 my $build = shift || 'udeb';
215 usage() unless grep { $_ eq $platform } @platforms;
216 usage() unless grep { $_ eq $build } @builds;
217 list($platform, $build);