UWP appx package Signtool "Error: SignerSign() failed." (-2147024885/0x8007000b) - windows-store-apps

EDIT
Event log error was this:
error 0x8007000B: The app manifest publisher name (CN=...)
must match the subject name of the signing certificate
(CN={19BE29DF-4812-4F2E-8FC1-A138B146946A}).
The command below now seems to work. So either user error on my part that I cannot identify or something hinky with the state of machine when I was seeing this. That guid associated with the signing cert in the event log message is not what the cert shows in the Certificate Manager snap-in, which is weird.
Original Question
I am attempting to sign a UWP appx package that was generated using MakeAppx.exe. The pfx is a developer code signing certificate generated with these commands from https://msdn.microsoft.com/windows/uwp/porting/desktop-to-uwp-manual-conversion.
C:\> MakeCert.exe -r -h 0 -n "CN=<publisher_name>" -eku 1.3.6.1.5.5.7.3.3 -pe -sv <my.pvk> <my.cer>
C:\> pvk2pfx.exe -pvk <my.pvk> -spc <my.cer> -pfx <my.pfx>
The private key is in my trusted root cert store and worked when I generated an appx from an installer using the Desktop App Converter.
The command line I am using is:
signtool.exe sign -f <path to my pfx file> -fd SHA256 -v .\FishTank.appx
but SignTool is erroring with this:
The following certificate was selected:
Issued to: ...
Issued by: ...
Expires: Sat Dec 31 18:59:59 2039
SHA1 hash: ...
Done Adding Additional Store
Error information: "Error: SignerSign() failed." (-2147024885/0x8007000b)
The certificate publisher matches what is in the appmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
<Identity Name="..."
ProcessorArchitecture="x64"
Publisher="CN=..."
Version="1.1.0.0" />
<Properties>
<DisplayName>Fish Tank</DisplayName>
<PublisherDisplayName>Reserved</PublisherDisplayName>
<Description>Some fish. Swimming around on your screen.</Description>
<Logo>StoreLogo.png</Logo>
</Properties>
<Resources>
<Resource Language="en-us" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
<Applications>
<Application Id="FishTank" Executable="FishTank.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
BackgroundColor="#464646"
DisplayName="Fish Tank"
Square150x150Logo="Square150x150Logo.png"
Square44x44Logo="Square44x44Logo.png"
Description="Some fish. Swimming around on your screen." />
</Application>
</Applications>
</Package>

Just like answered here (though for a different error code) - you have to make sure that the Publisher name (in the AppxManifest.xml file) is the same as the certificate's publisher.
For more information, see here (in the bottom "Remarks" section).

The MakeCert /n argument has to be the full Publisher string from your xml.

Related

Use environment variables inside google-repo manifest?

We are trying to start using google-repo in our project as the project is divided into multiple repositories. The problem is that our git server requires that one puts the username into the URL, e.g.
git clone ssh://username#git.server.com
But is it possible to get that into the manifest? I've tried the following
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="gerrit"
fetch="ssh://$USER#git.server.com"
review="ssh://$USER#git.server.com"
revision="refs/heads/master"/>
<default remote="gerrit" sync-j="4"/>
<project name="project" remote="gerrit" path="project"/>
</manifest>
but google-repo simply uses ssh://$USER#git.server.com when cloning (that is, it does not dereference environment variable $USER).
This is a ssh config issue, you should not add $USER in the remote of your manifest.
In ~/.ssh/config, add:
host whatever git.server.com
IdentityFile ~/.ssh/id_rsa
User <your_user>
IdentityFile should link to your ssh private key (YMMV).
You should now be able to
git clone ssh://git.server.com

PhpStorm is throwing an error if running phpcs

First of all, let me list some versions so you know the setup.
OS: Windows 10
php: 7.2.7 NTS with xDebug 2.6.1 active
PhpStorm: 2016.2.2
PHP_CodeSniffer: version 3.4.0 (stable) by Squiz (http://www.squiz.net)
PEAR: 1.10.7
Now let me describe the problem:
The code sniffer was installed via pear. I'm using the following bat script for starting the sniffer.
#echo off
set folder=C:\Program Files\php
set phpcs=%folder%\phpcs
php "%phpcs%" %*
If I start the code sniffer via the PowerShell with the following command:
phpcs.bat index.php --standard=PSR2 --encoding=utf-8 --report=xml
I'm getting a valid output:
xml version="1.0" encoding="UTF-8"?>
<file name="C:\Users\simon\Documents\Repositories\mm-BIT\CatalogGenerator\index.php" errors="3" warnings="0" fixable="3">
<error line="1" column="1" source="Generic.Files.LineEndings.InvalidEOLChar" severity="5" fixable="1">End of line character is invalid; expected "\n" but found "\r\n"</error>
<error line="124" column="1" source="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" severity="5" fixable="1">Space before opening parenthesis of function call prohibited</error>
<error line="129" column="1" source="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" severity="5" fixable="1">Space before opening parenthesis of function call prohibited</error>
</file>
</phpcs>
In PhpStorm the setting looks like this:
If I validate the installation PhpStorm tells me everything is fine:
The data for the coding standards on the Inspections page was loaded automatically, so this seems to work as well.
If PhpStorm is running the script I'm getting the following error:
PHP Code Sniffer
phpcs: xml version="1.0" encoding="UTF-8"?>
I was exposing some data via the script which is getting called:
PHP Code Sniffer
phpcs: C:/temp/___1.tmp/Core/DataContainers/Language.php --standard=PSR2 --encoding=utf-8 --report=xml
command: php "C:\Program Files\php\phpcs" C:/temp/___1.tmp/Core/DataContainers/Language.php --standard=PSR2 --encoding=utf-8 --report=xml
xml version="1.0" encoding="UTF-8"?>
I did check the temp folder for writing permissions and was checking if the file is created correctly on the path mentioned above. I did copy the folder as soon as it was created and did run the command line by hand in the PowerShell successfully.
php "C:\Program Files\php\phpcs"
C:/temp/___.tmp/Core/DataContainers/Modules/SimpleTableModule.php --
standard=PSR2 --encoding=utf-8 --report=xml
which delivers the following output:
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="3.4.0">
xml version="1.0" encoding="UTF-8"?>
<file name="C:\temp\___.tmp\Core\DataContainers\Modules\SimpleTableModule.php" errors="1" warnings="1" fixable="1">
<warning line="82" column="114" source="Generic.Files.LineLength.TooLong" severity="5" fixable="0">Line exceeds 120 characters; contains 123 characters</warning>
<error line="106" column="1" source="PSR2.Files.EndFileNewline.NoneFound" severity="5" fixable="1">Expected 1 newline at end of file; 0 found</error>
</file>
</phpcs>
I don't know how to fix this if you could provide me with some ideas I would be really happy.
The problem was solved, I did replace the content of the phpcs.bat file with the official script:
#echo off
REM PHP_CodeSniffer detects violations of a defined coding standard.
REM
REM #author Greg Sherwood <gsherwood#squiz.net>
REM #copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
REM #license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
if "%PHP_PEAR_PHP_BIN%" neq "" (
set PHPBIN=%PHP_PEAR_PHP_BIN%
) else set PHPBIN=php
"%PHPBIN%" "%~dp0\phpcs" %*
Script in the repository
I was trying this before but it was not working, I was giving myself full access rights on the PHP installation folder as well. Seems like the problem is fixed now.
Still a big thanks to everyone taking a look.
Edit: I checked my bat file again and it was not completely identical with the one from the git repository. I did leave my old code as a comment in the file. After I cleaned this up this morning the sniffer wasn't working anymore, after I readded the comments again the feature was working again. So here is the complete content of the file in the current working state:
#echo off
REM PHP_CodeSniffer detects violations of a defined coding standard.
REM
REM #author Greg Sherwood <gsherwood#squiz.net>
REM #copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
REM #license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
if "%PHP_PEAR_PHP_BIN%" neq "" (
set PHPBIN=%PHP_PEAR_PHP_BIN%
) else set PHPBIN=php
"%PHPBIN%" "%~dp0\phpcs" %*
REM End of file
We did confirm this behavior on another computer with the same installed software, so this seems to be the problem.
Edit2: Seems like you just need a comment line after the last line of the original script. I did update the code snippet I'm using at the moment.

Google Omaha installer hangs

I'm trying to get Google Omaha to work, and even though I feel I'm really close for some reason it is not.
I've read the few guides and tutorials available online for it and finally managed to get the client built. I've also installed the docker package provided by Crystalnix and as far as I can tell everything is setup as it should.
For some reason however the installation process gets stuck after the API request for the package information is made.
The last response from the server looks as follows:
<response protocol="3.0" server="prod">
<daystart elapsed_seconds="62157" elapsed_days="4372"/>
<app status="ok" appid="{XXX-XXX-XXX}">
<updatecheck status="ok">
<urls>
<url codebase="http://updates.example.com/static/media/build/Product/stable/win/78065329307666/"/>
</urls>
<manifest version="71.0.57.18">
<packages>
<package required="true" hash="6uZwsU9+WCZ1oR3ovGnFyrTCqhM=" name="install.exe" size="59309528"/>
</packages>
<actions>
<action successsaction="default" run="install.exe" event="install"/>
</actions>
</manifest>
</updatecheck>
</app>
</response>
After this request is being retried for three times the installer hangs with this error: Unable to connect to the Internet. If you use a firewall, please whitelist ProductUpdate.exe
What could the issue for this be?
LE: this is the complete Omaha log file https://pastebin.com/QALnk7X7

tsa and tsacert error while running the xamarin.forms application

I am trying to use google maps in my xamarin.forms application. when I run the application, I get the message saying that there are deployment errors
2>C:\Program Files\Java\jdk1.8.0_161\\bin\jarsigner.exe -keystore "C:\Users\e245737\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\\com.test.and-Signed-Unaligned.apk C:\VisualStudioMobileApplication\and\and\and.Android\obj\Debug\android\bin\com.test.and.apk androiddebugkey
2>No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2048-02-09) or after any future revocation date.
2>C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\zipalign.exe 4 "C:\VisualStudioMobileApplication\and\and\and.Android\bin\Debug\com.test.and-Signed-Unaligned.apk" "bin\Debug\\com.test.app1-Signed.apk"
2>Unexpected install output: pkg: /data/local/tmp/com.test.app1-Signed.apk
2>Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
My package name is all lower case. Below is the name.
com.test.app1
I am not sure about this below error:
No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2048-02-09) or after any future revocation date.
My androidManifest.xml file looks like this:
my properties file looks like this:
any help will be appreciated.

How to send junit report via email as report doesn't display

I have a Junit HTML Report below in my local which is built through ANT:
Now the problem I am having is that if I try and attach this report by simply sending just the index.html, it will display this:
I want to know how can I send the above report via email so everyone can see the html report. I only want to send the index.html I don't want to send everybody the corresponding files.
The xml code to build this report is below (I xxx out some things which are not xxx in the real file):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="Test_Report" name="Test_Report">
<target name="xxx_SoapUI">
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat">
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg>
</exec>
</target>
<target name="xxx_SoapUI">
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat">
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg>
</exec>
</target>
<target name="xxx_SoapUI">
<exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat">
<arg line="-r -j -f 'D:\xxx\xxx' 'D:\xxx).xml'"></arg>
</exec>
</target>
</project>
The format="frames"attribute normally generates separate files for frames and maybe stylesheets. As mentioned in the task documentation, you can set the value to noframes and Ant will generate the report in a single HTML:
The noframes format does not use redirecting and generates one file called junit-noframes.html.
In case you need to customize the XSL used to generate the report, you can override it using the styledir attribute (note that the file must be named junit-noframes.xsl). The default XSL is embedded in the Ant source code and can be viewed here.
Here is alternative approach.
In this approach, do not use any attachment of the test result. Instead, host the result in a container such as tomcat or WebDAV.
Here is the example for tomcat(should be something similar for WebDAV as well):
Install tomcat
Create a directory say reports under TOMCAT_HOME\webapps directory and make sure tomcat is started.
After generating reports using current ant target, create new target for moving current reports under TOMCAT_HOME\webapps\reports\<timestamp>
Send the reports link in the email. The report link could be http://<hostname>:<port>/reports/<timestamp>/index.html
This way, every one can access the report online.