summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/createpackage.pl15
-rwxr-xr-xbin/patch_capabilities.pl83
-rwxr-xr-xbin/syncqt3
3 files changed, 77 insertions, 24 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl
index 2569a66733..cce0b54510 100755
--- a/bin/createpackage.pl
+++ b/bin/createpackage.pl
@@ -139,6 +139,9 @@ unless (GetOptions('i|install' => \$install,
Usage();
}
+my $epocroot = $ENV{EPOCROOT};
+$epocroot =~ s,[\\/]$,,x;
+
my $certfilepath = abs_path(dirname($certfile));
# Read params to variables
@@ -303,12 +306,12 @@ if ($preprocessonly) {
}
if($stub) {
- if(!($ENV{EPOCROOT})) { die("EPOCROOT must be set to create stub sis files"); }
- my $systeminstall = "$ENV{EPOCROOT}epoc32/data/z/system/install";
+ if(!($epocroot)) { die("EPOCROOT must be set to create stub sis files"); }
+ my $systeminstall = "$epocroot/epoc32/data/z/system/install";
mkpath($systeminstall);
my $stub_sis_name = $systeminstall."/".$stub_sis_name;
# Create stub SIS.
- system ("makesis -s $pkgoutput $stub_sis_name");
+ system ("$epocroot/epoc32/tools/makesis -s $pkgoutput $stub_sis_name");
} else {
if ($certtext eq "Self Signed"
&& !@certificates
@@ -321,7 +324,11 @@ if($stub) {
# Create SIS.
# The 'and' is because system uses 0 to indicate success.
- system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");
+ if($epocroot) {
+ system ("$epocroot/epoc32/tools/makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");
+ } else {
+ system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");
+ }
print("\n");
my $targetInsert = "";
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
index 0c0538c476..a85f073912 100755
--- a/bin/patch_capabilities.pl
+++ b/bin/patch_capabilities.pl
@@ -46,7 +46,13 @@
#
#######################################################################
+#
+# Note: Please make sure to output all changes done to the pkg file in a print statements
+# starting with "Patching: " to ease integration into IDEs!
+#
+
use File::Copy;
+use File::Spec;
sub Usage() {
print("This script can be used to set capabilities of all binaries\n");
@@ -142,39 +148,56 @@ if (@ARGV)
# Parse each line.
while (<PKG>)
{
- # Patch pkg UID
my $line = $_;
my $newLine = $line;
- if ($line =~ m/^\#.*\(0x[0-9|a-f|A-F]*\).*$/)
+
+ # Patch pkg UID if it's in protected range
+ if ($line =~ m/^\#.*\((0x[0-7][0-9|a-f|A-F]*)\).*$/)
{
- $newLine =~ s/\(0x./\(0xE/;
+ my $oldUID = $1;
+ my $newUID = $oldUID;
+ $newUID =~ s/0x./0xE/i;
+ $newLine =~ s/$oldUID/$newUID/;
+ print ("Patching: UID $oldUID is not compatible with self-signing! Changed to: $newUID.\n");
}
- # Patch embedded sis name and UID
- if ($line =~ m/^@.*\.sis.*\(0x[0-9|a-f|A-F]*\).*$/)
+ # Patch embedded sis name and UID if UID is in protected range
+ if ($line =~ m/^@\"*(.*\.sis).*\((0x[0-7][0-9|a-f|A-F]*)\).*$/)
{
- $newLine =~ s/\(0x./\(0xE/;
- if ($line !~ m/^.*_selfsigned.sis.*$/)
+ my $oldSisName = $1;
+ my $oldUID = $2;
+ my $newUID = $oldUID;
+ $newUID =~ s/0x./0xE/i;
+ $newLine =~ s/$oldUID/$newUID/;
+ print ("Patching: Embedded sis $oldSisName UID $oldUID changed to: $newUID.\n");
+
+ if ($oldSisName !~ m/^.*_selfsigned.sis$/i)
{
- $newLine =~ s/\.sis/_selfsigned\.sis/i;
+ my $newSisName = $oldSisName;
+ $newSisName =~ s/\.sis$/_selfsigned\.sis/i;
+ $newLine =~ s/$oldSisName/$newSisName/i;
+ print ("Patching: Embedded sis $oldSisName name changed to: $newSisName.\n");
}
}
- # Remove dependencies to known problem packages (i.e. packages that are likely to be patched, also)
+ # Remove dependencies to known problem packages (i.e. packages that are likely to be patched, too)
# to reduce unnecessary error messages.
- if ($line =~ m/^\(0x2002af5f\).*\{.*\}$/)
+ if ($line =~ m/^\((0x2002af5f)\).*\{.*\}$/)
{
- $newLine = "\n"
+ $newLine = "\n";
+ print ("Patching: Removed dependency to sqlite3.sis ($1) to avoid installation issues in case sqlite3.sis is also patched.\n");
}
- if ($line =~ m/^\(0x2001E61C\).*\{.*\}$/)
+ if ($line =~ m/^\((0x2001E61C)\).*\{.*\}$/)
{
- $newLine = "\n"
+ $newLine = "\n";
+ print ("Patching: Removed dependency to qt.sis ($1) to avoid installation issues in case qt.sis is also patched.\n");
}
# Remove manufacturer ifdef
if ($line =~ m/^.*\(MANUFACTURER\)\=\(.*\).*$/)
{
$newLine = "\n";
+ print ("Patching: Removed manufacturer check as it is usually not desirable in self-signed packages.\n");
}
if ($line =~ m/^ELSEIF.*MANUFACTURER$/)
@@ -240,7 +263,9 @@ if (@ARGV)
foreach my $binaryPath(@binaries)
{
# Create the command line for setting the capabilities.
+ my ($binaryVolume, $binaryDirs, $binaryBaseName) = File::Spec->splitpath($binaryPath);
my $commandToExecute = $baseCommandToExecute;
+ my $executeNeeded = 0;
if (@capabilitiesSpecified)
{
$commandToExecute = sprintf($baseCommandToExecute, join(" ", @capabilitiesSpecified));
@@ -250,34 +275,54 @@ if (@ARGV)
my $dllCaps;
open($dllCaps, "elftran -dump s $binaryPath |") or die ("Could not execute elftran");
my $capsFound = 0;
+ my $originalVid;
my @capabilitiesToSet;
my $capabilitiesToAllow = join(" ", @capabilitiesToAllow);
+ my @capabilitiesToDrop;
while (<$dllCaps>) {
+ if (/^Vendor ID: (.*)$/) {
+ $originalVid = "$1";
+ }
if (!$capsFound) {
$capsFound = 1 if (/Capabilities:/);
} else {
$_ = trim($_);
if ($capabilitiesToAllow =~ /$_/) {
push(@capabilitiesToSet, $_);
+ } else {
+ push(@capabilitiesToDrop, $_);
}
}
}
close($dllCaps);
+ if ($originalVid !~ "00000000") {
+ print ("Patching: Vendor ID (0x$originalVid) incompatible with self-signed packages, setting it to zero for \"$binaryBaseName\".\n");
+ $executeNeeded = 1;
+ }
+ if ($#capabilitiesToDrop) {
+ my $capsToDropStr = join("\", \"", @capabilitiesToDrop);
+ $capsToDropStr =~ s/\", \"$//;
+
+ print ("Patching: The following capabilities used in \"$binaryBaseName\" are not compatible with a self-signed package and will be removed: \"$capsToDropStr\".\n");
+ $executeNeeded = 1;
+ }
$commandToExecute = sprintf($baseCommandToExecute, join(" ", @capabilitiesToSet));
}
$commandToExecute .= $binaryPath;
- # Actually execute the elftran command to set the capabilities.
- print ("Executing ".$commandToExecute."\n");
- system ($commandToExecute." > $nullDevice");
-
+ if ($executeNeeded) {
+ # Actually execute the elftran command to set the capabilities.
+ print ("\n");
+ system ("$commandToExecute > $nullDevice");
+ }
## Create another command line to check that the set capabilities are correct.
#$commandToExecute = "elftran -dump s ".$binaryPath;
}
print ("\n");
- print ("NOTE: A patched package may not work as expected due to reduced capabilities.\n");
- print (" Therefore it should not be used for any kind of Symbian signing or distribution!\n");
+ print ("NOTE: A patched package may not work as expected due to reduced capabilities and other modifications,\n");
+ print (" so it should not be used for any kind of Symbian signing or distribution!\n");
+ print (" Use a proper certificate to avoid the need to patch the package.\n");
print ("\n");
}
}
diff --git a/bin/syncqt b/bin/syncqt
index a2eece07ff..faa357538e 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -51,6 +51,7 @@ my %modules = ( # path to module name map
"QtWebKit" => "$basedir/src/3rdparty/webkit/WebCore",
"phonon" => "$basedir/src/phonon",
"QtMultimedia" => "$basedir/src/multimedia",
+ "QtMeeGoGraphicsSystemHelper" => "$basedir/tools/qmeegographicssystemhelper",
);
my %moduleheaders = ( # restrict the module headers to those found in relative path
"QtWebKit" => "../WebKit/qt/Api",
@@ -690,7 +691,7 @@ my $class_lib_map_contents = "";
my @ignore_for_master_contents = ( "qt.h", "qpaintdevicedefs.h" );
my @ignore_for_include_check = ( "qatomic.h" );
my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" );
-my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" );
+my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h", "qatomic_arm.h", "qatomic_armv7.h" );
my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" );
my %colliding_headers = ();
my %inject_headers;