44
|
1 |
#!perl -w
|
|
2 |
# Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Symbian Foundation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
# This script modifies the CCE plugin cenrep file to use the CS plugin rather than the VCC one.
|
|
16 |
#
|
|
17 |
#
|
|
18 |
|
|
19 |
use strict;
|
|
20 |
|
|
21 |
# Open the cenrep files
|
|
22 |
my $cenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.txt";
|
|
23 |
my $newcenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.tmp";
|
|
24 |
my $cenrepbak = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.bak";
|
|
25 |
my $file2string;
|
|
26 |
|
|
27 |
# Open the file in UNICODE-16 and read the whole contents into a string
|
|
28 |
open(my $CENREPREAD, "<:raw:encoding(UTF-16LE):crlf:utf8", $cenrep) or die "Couldn't open current cenrep file";
|
|
29 |
{
|
|
30 |
$/ =undef;
|
|
31 |
$file2string = <$CENREPREAD>;
|
|
32 |
}
|
|
33 |
close($CENREPREAD);
|
|
34 |
|
|
35 |
# Modify the crucial line to the new UID for CS calls rather than VCC
|
|
36 |
$file2string =~ s/0x9001 string \"536924074\"/0x9001 string \"271067365\"/g;
|
|
37 |
|
|
38 |
# Write out the contents into a new UNICODE-16 encoded file
|
|
39 |
open(my $CENREPOUT, ">:raw:encoding(UTF-16LE):crlf:utf8", $newcenrep) or die "Couldn't open new cenrep file for output";
|
|
40 |
print $CENREPOUT $file2string;
|
|
41 |
close($CENREPOUT);
|
|
42 |
|
|
43 |
|
|
44 |
# Now backup the old and copy the new files
|
|
45 |
rename($cenrep, $cenrepbak) or die "Couldn't backup feature data file '$cenrep'\n" unless (-e $cenrepbak); # OK for this to fail as it probably just means there's already a backup
|
|
46 |
rename($newcenrep, $cenrep) or die "Couldn't copy feature data file '$newcenrep'\n";
|
|
47 |
|
|
48 |
print "\tCCE CenRep Setup\n"; |