Archive for July, 2015

Code object is not signed at all #Xamarin #Mac #OSX

It turns out that submitting a Mac app, you need to make sure the naming of your app is consistent, so your app is entitled exactly the same on the app store, and on the desktop. If you get this wrong, then your app will be rejected, and you’ll have wasted 1 week’s review on a silly mistake. (like me! – thanks Apple!)

So, In Xamarin, I went to change the Assembly name under Projects > Build > Output  – and the project would no longer compile, – with an error saying “Code object is not signed at all” – I finally figured out that you have to open the plist file, view source, and change the executable file and mono bundle executable.

I haven’t figured out how to use special chars in the name of the project, but hopefully apple will let me away with having no spaces in my executable file name – fingers crossed!

Categories: Uncategorized

Updating to the latest version of Cordova PhoneGap

After receiving a message from Google some time ago saying that security vulnerabilities in older versions of Cordova PhoneGap meant that my apps could be de-listed, I decided to go and upgrade my Cordova Setup, just to keep ahead of the curve.

So, step 1 (this is on a Mac, but should be similar on a PC)

sudo npm update -g cordova

cordova platform check

cordova platform update android

cordova platform update ios

Now, I noticed that all my ajax requests were failing with a 404 error, so I learned that you had to add a new plugin

cordova plugin add cordova-plugin-whitelist

Added this into the config.xml (probably overkill)

<allow-navigation href=”*” />
<!– The above is equivalent to these three declarations –>
<allow-navigation href=”http://*/*&#8221; />
<allow-navigation href=”https://*/*&#8221; />
<allow-navigation href=”data:*” />
<access origin=”*”/>
<allow-navigation href=”*”/>
<allow-intent href=”*”/>

and I added this into the HTML:

<meta http-equiv=”Content-Security-Policy” content=”* * ‘self’ default-src ‘unsafe-inline’ ‘unsafe-eval’ http://* https://* data: cdvfile://* content://*;”>

When building the release APK for Android, I noticed that no longer had any effect, so you now have to include a build.json file in the project root as follows

“android”: {
“release”: {
“keystore”: “android”,
“storePassword”: “xxxx”,
“alias”: “android”,
“password” : “xxxx”,
“keystoreType”: “”

The keystore file has to be in the project root – this doesn’t allow absolute paths.

Categories: Uncategorized

Generate Random string in MS-SQL within UDF

Just modified some code posted on stackoverflow to generate a random string with SQL, to fit it into a UDF (User defined function) as follows;

SELECT crypt_gen_random(8) rndResult

create function randomString
( ) returns varchar(8) as
declare @BinaryData varbinary(max), @CharacterData varchar(max)

SELECT @BinaryData = rndResult FROM rndView
set @CharacterData=cast(” as xml).value(‘xs:base64Binary(sql:variable(“@BinaryData”))’, ‘varchar(max)’)

return @CharacterData

The secondary view is required to get around a limitation that UDF’s are not supposed to change database state. – It does mean that it is limited to generating fixed-length random strings though (i.e. 8 chars)

Categories: Uncategorized
%d bloggers like this: