Skip to content

Commit 84c788c

Browse files
committed
Support gettbsdata for Apkv3 packages
Also die() in the replacesignature function for apkv3.
1 parent f99ca41 commit 84c788c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Build/Apk.pm

+3
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,9 @@ sub mktar {
721721
722722
sub replacesignature {
723723
my ($handle, $ohandle, $signature, $time, $algo, $hash, $keyname, $keyid) = @_;
724+
if (is_apkv3($handle)) {
725+
die("replacesignature: apkv3 support is not implemented\n");
726+
}
724727
my $sigtype;
725728
$sigtype = 'RSA' if $algo eq 'rsa' && $hash eq 'sha1';
726729
$sigtype = 'RSA256' if $algo eq 'rsa' && $hash eq 'sha256';

Build/Apkv3.pm

+2-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ sub calcapkchksum {
482482
my ($file, $type, $section) = @_;
483483
$section ||= 'ctrl';
484484
$type ||= 'Q1';
485-
die("unsupported apkchksum type $type\n") unless $type eq 'Q1' || $type eq 'Q2' || $type eq 'X1' || $type eq 'X2' || $type eq 'md5';
485+
die("unsupported apkchksum type $type\n") unless $type eq 'Q1' || $type eq 'Q2' || $type eq 'X1' || $type eq 'X2' || $type eq 'md5' || $type eq 'raw';
486486
die("unsupported apkchksum section $section\n") unless $section eq 'ctrl';
487487
my $fd = open_apk($file);
488488
die("nor an apk package file\n") unless read_file_header($fd) eq 'pckg';
@@ -491,6 +491,7 @@ sub calcapkchksum {
491491
die("oversized adb block\n") if $adbsize > 0x10000000; # 256 MB
492492
my $adb = doread($fd, $adbsize);
493493
close($fd);
494+
return $adb if $type eq 'raw';
494495
return calcapkchksum_adb($adb, $type);
495496
}
496497

0 commit comments

Comments
 (0)