George McKinney Adventures in Software Development

April 20, 2021

Alexa Fact Skill Content

Filed under: Alexa,Amazon,AWS — georgemck @ 5:41 pm

 

const SKILL_NAME = ‘SKILL_NAME ‘;
const GET_FACT_MESSAGE = ‘Here\’s your information: ‘;
const HELP_MESSAGE = ‘You can say tell me a fact, or, tell me about something… What can I help you with?’;
const HELP_REPROMPT = ‘What can I help you with?’;
const STOP_MESSAGE = ‘Goodbye!’;

const data = [
‘Fact Number One.’,
‘Fact Number Two.’
];

const GetNewFactHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === ‘LaunchRequest’
|| (request.type === ‘IntentRequest’
&& request.intent.name === ‘GetNewFactIntent’);
},
handle(handlerInput) {
const factArr = data;
const factIndex = Math.floor(Math.random() * factArr.length);
const randomFact = factArr[factIndex];
const speechOutput = GET_FACT_MESSAGE + randomFact;

return handlerInput.responseBuilder
.speak(speechOutput)
.withSimpleCard(SKILL_NAME, randomFact)
.getResponse();
},
};

March 10, 2021

AWS CLI Builder

Filed under: AWS — georgemck @ 6:19 pm

Tool for constructing AWS CLI commands

https://awsclibuilder.com/home

Created by https://twitter.com/pdomala

AWS BASH Export Lambda Functions

Filed under: AWS — georgemck @ 6:18 pm

AWS CLI 2 for Exporting Lambdas

https://gist.github.com/TheNetJedi/0847ba0ec1da9879b4fa1d8f3276b004

Export all lambda functions to lambdafunctions directory as indivudual zip files. Be sure to update the region, currently set to us-east-1

 

mkdir lambdafunctions
aws lambda list-functions | \
grep FunctionName | \
cut -d '"' -f4 | \
while read -r name; do
aws lambda get-function --function-name $name | tail -n 3 | egrep -o 'https?://[^ ]+' | sed 's/"//' | xargs wget -O ./lambdafunctions/$name.zip
done

AWS BASH Export Lex Bots

Filed under: AWS — georgemck @ 6:14 pm

AWS CLI 2 for Exporting a Bot

https://docs.aws.amazon.com/lex/latest/dg/export-to-lex.html

https://docs.aws.amazon.com/lex/latest/dg/API_GetExport.html

Export all bots to lexbots directory as indivudual zip files. Be sure to update the region, currently set to us-east-1

 

mkdir lexbots
aws lex-models get-bots | grep name | cut -d '"' -f4 | \
while read -r name; do
echo $name
url=$(aws lex-models get-export --name $name --resource-type BOT --export-type LEX --resource-version 1 --region us-east-1 --output json | grep url | cut -d '"' -f4)
wget $url -O ./lexbots/$name.zip
done

 

March 9, 2021

AWS Shell Gradle Install

Filed under: AWS — georgemck @ 3:12 am

Gradle versions available from:

https://gradle.org/releases/

 

sudo mkdir /opt/gradle
wget -c https://services.gradle.org/distributions/gradle-6.8.3-bin.zip
sudo unzip -d /opt/gradle gradle-6.8.3-bin.zip
export PATH=$PATH:/opt/gradle/gradle-6.8.3/bin

gradle -v

 

**NOTE:   export PATH will have to be done over with every launch of the shell. Alternatively, add it to ~/.bash_profile

PATH=$PATH:$HOME/.local/bin:$HOME/bin:/opt/gradle

 

AWS Shell Java Install

Filed under: AWS — georgemck @ 3:05 am

You can switch between versions with sudo

from https://tecadmin.net/install-java-on-amazon-linux/

 

Step 1 – Install Java on Amazon Linux

The OpenJDK 8 is available under default yum repositories and OpenJDK 11 is available under Amazon Linux 2 extras repositories. You can simply install Java 11 or Java 8 on the Amazon Linux system using the following commands.

  • Run below commands to install Java 11 on Amazon Linux:
    sudo amazon-linux-extras install java-openjdk11
    
  • Run below commands to install Java 8 on Amazon Linux:
    sudo yum install java-1.8.0-openjdk
    

Step 2 – Check Active Java Version

After successfully installing Java on Amazon Linux using the above steps, Let’s verify the installed version using the following command.

java -version

openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

Step 3 – Switch Java Version

Use alternatives command-line utility to switch active Java version on your Amazon Linux system. Run below command from the command line and select the appropriate Java version to make it default.

sudo alternatives --config java

Install Java on Amazon Linux

After switching let’s check again active Java version:

java -version

openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

 

 

 

February 7, 2021

Apple Developer Certificate Expiration APPLEWWDCRCA3.cer

Filed under: iOS,iPhone — georgemck @ 11:00 pm

Periodically, Apple updates its development and distribution certificates. They are updated when XCode updates. If you haven’t updated to the latest version you may have to update these files yourself.

1. Download the certificate APPLEWWDCRCA3.cer
2. Install it into KeyChain Access

https://developer.apple.com/support/certificates/
https://stackoverflow.com/questions/64596362/iphone-distribution-certificate-is-not-trusted

XC Run Tool xcrun

Filed under: iOS,iPhone — georgemck @ 12:54 am

XCode’s CLI Swiss Army Knife

xcrun -h (for help)

xcrun -v (verbose output)

xcrun –show-sdk-path (will show the SDK path including its platform)

ls /Applications/Xcode.app/Contents/Developer/Platforms (displays all the platforms)

xcrun simctl list (list device uuid for the simulator)

xcrun simctl install [sim-device-uuid] tester.app (install an app onto the simulator)

===============================================

xcrun actool Assets.xcassets –compile build –platform iphoneos –minimum-deployment-target 9.3 (Create Assets.car by compiling the .xcassets folder)
[ platform name is all lowercase ]

xcrun –sdk iphoneos assetutil –info Assets.car (view contents of the archive)

/Applications/Xcode.app/Contents/Developer/usr/bin/actool Assets.xcassets –compile build –platform tvOS –minimum-deployment-target 8.0

https://guides.codepath.com/ios/Adding-Image-Assets

AIR SDK 33.1.1.345 iOS 14.3 signature issue
https://github.com/Gamua/Adobe-Runtime-Support/issues/590
Hello, when I compile IPA applications and install it into device with iOS 14.3, I got this message:
This app will not work with future versions of iOS

February 6, 2021

iPhone App Icons with Assets.car

Filed under: iOS,iPhone — georgemck @ 10:31 pm

For Adobe AIR for Mobile Section 11.3 iOS of “Release_Notes_AIR_SDK_33.1.1.345.pdf” (page 22) from Samsung Harman regarding iPhone App Development states:

“The splash screen is implemented as a launch storyboard with the binary storyboard and related assets
included in the SDK. This has implications for those who are providing their own storyboards or images in an
Assets.car file:
– If you are on the ‘free tier’ then the AIR developer tool will ignore any launch storyboard you have
specified within your application descriptor file, or provided within the file set for packaging into the
IPA file.
– If you are creating an Assets.car file, then you need to add in the AIR splash images from the SDK
which are in the “lib/aot/res” folder. These should be copied and pasted into your “.xcassets” folder in
the Xcode project that you are using for creation of your assets.”

============================

I recommend creating a new iPhone project with Xcode. Within this project, you can add all the icons and the 6 Harman splash images. These will be added to the Assets.car which you must include in the iPhone app. There is a default Assets.car bundled with the Harman SDK. I use the one I created instead for submission to Apple’s App Store. You can manage the Assets.car file with xcrun.

============================

ERROR ITMS-90022: “Missing required icon file. The bundle does not contain an app icon for iPhone / iPod Touch of exactly ‘120×120’ pixels, in .png format for iOS versions >= 7.0. To support older versions of iOS, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface”

ERROR ITMS-90023: “Missing required icon file. The bundle does not contain an app icon for iPad of exactly ‘152×152’ pixels, in .png format for iOS versions >= 7.0. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface”

ERROR ITMS-90023: “Missing required icon file. The bundle does not contain an app icon for iPad of exactly ‘167×167′ pixels, in .png format for iOS versions supporting iPad Pro. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface”

ERROR ITMS-90023: “Missing required icon file. The bundle does not contain an app icon for iPad of exactly ’76×76’ pixels, in .png format for iOS versions >= 7.0. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface”
ERROR ITMS-90022: “Missing required icon file. The bundle does not contain an app icon for iPhone / iPod Touch of exactly ‘120×120’ pixels, in .png format for iOS versions >= 7.0. To support older versions of iOS, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface”

February 4, 2021

iPhone App Signing (manual process)

Filed under: Flash Debugger,iOS,iPhone,Mobile — georgemck @ 10:49 pm

Scenario: created an iPhone app for Grip 411 using Adobe Air for Mobile now managed by Samsung Harman’s AIR SDK. The build process created the app’s grip411.ipa properly but was rejected by Apple because:
‘ERROR ITMS-90034: “Missing or invalid signature. The bundle ‘com.grip411.release’ at bundle path ‘Payload/Grip 411.app’ is not signed using an Apple submission certificate.”‘ Reason: Apple updated their code signing tools which get updated automatically using the latest version of XCode but since I am still on the previous version the certificate for signing had not been updated yet.

The process below uses a manual signing process via the command line.


# https://stackoverflow.com/questions/5160863/how-to-re-sign-the-ipa-file
# same process worked on Feb. 4, 2021
# had to first update the certificate APPLEWWDCRCA3.cer and install it into KeyChain Access
# https://developer.apple.com/support/certificates/
# https://stackoverflow.com/questions/64596362/iphone-distribution-certificate-is-not-trusted

# this version was tested OK vith macOs Sierra 10.12.5 (16F73) on oct 0th, 2017
# original ipa file must be store in current working directory

IPA="ipa-filename.ipa"
PROVISION="path-to.mobileprovision"
CERTIFICATE="hexadecimal-certificate-identifier" # must be in keychain
# identifier maybe retrieved by running: security find-identity -v -p codesigning

# unzip the ipa
unzip -q "$IPA"

# remove the signature
rm -rf Payload/*.app/_CodeSignature

# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision

# generate entitlements for current app
cd Payload/
codesign -d --entitlements - *.app > entitlements.plist
cd ..
mv Payload/entitlements.plist entitlements.plist

# sign with the new certificate and entitlements
/usr/bin/codesign -f -s "$CERTIFICATE" '--entitlements' 'entitlements.plist' Payload/*.app

# zip it back up
zip -qr resigned.ipa Payload

Older Posts »

Powered by WordPress