Skip to content

Commit

Permalink
refactor(example): update example to run on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored and sgtcoolguy committed Sep 16, 2020
1 parent e930357 commit 9e96345
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 0 additions & 5 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ var App = {
};
global.App = App;

var isAndroid = Ti.Platform.name === 'android';
global.isAndroid = isAndroid;
var isiOS = Ti.Platform.name === 'iOS' || Ti.Platform.name === 'iPhone OS';
global.isiOS = isiOS;

// Load the crypto modules
var Crypto = require('ti.crypto');
global.Crypto = Crypto;
Expand Down
2 changes: 1 addition & 1 deletion example/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ testAlgorithm({
multiple: [ 'Titanium Crypto Module', 'Some additional text to encrypt' ],
multipleEncrypted: [ 'WNaIeDZqUTMPdlHm35r3Uw==', 'WNaIeDZqUTMPdlHm35r3U9R50OumHt987wOrM7GuNVJ+m9+ZR/03jngU6vPygXrR' ]
});
if (isiOS) {
if (OS_IOS) {
testAlgorithm({
id: 'RC4xMin',
keySize: Crypto.KEYSIZE_MINRC4,
Expand Down
5 changes: 2 additions & 3 deletions example/ui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
App.UI = (function () {
var algorithms;
if (isiOS) {
if (OS_IOS) {
algorithms = [
{ title: 'AES-128', subTitle: '128-bit key', keySize: Crypto.KEYSIZE_AES128, algorithm: Crypto.ALGORITHM_AES128, options: Crypto.OPTION_PKCS7PADDING },
{ title: 'AES-128', subTitle: '192-bit key', keySize: Crypto.KEYSIZE_AES192, algorithm: Crypto.ALGORITHM_AES128, options: Crypto.OPTION_PKCS7PADDING },
Expand All @@ -15,7 +15,7 @@ App.UI = (function () {
{ title: 'RC2', subTitle: '1024-bit key', keySize: Crypto.KEYSIZE_MAXRC2, algorithm: Crypto.ALGORITHM_RC2, options: Crypto.OPTION_PKCS7PADDING }
];
}
if (isAndroid) {
if (OS_ANDROID) {
algorithms = [
{ title: 'AES-128', subTitle: '128-bit key', keySize: Crypto.KEYSIZE_AES128, algorithm: Crypto.ALGORITHM_AES128, options: Crypto.OPTION_PKCS7PADDING },
{ title: 'AES-128', subTitle: '192-bit key', keySize: Crypto.KEYSIZE_AES192, algorithm: Crypto.ALGORITHM_AES128, options: Crypto.OPTION_PKCS7PADDING },
Expand Down Expand Up @@ -95,7 +95,6 @@ App.UI = (function () {

function openDemoWindow(controller) {
var demoWindow = Ti.UI.createWindow({
backgroundColor: 'white',
layout: 'vertical'
});

Expand Down

0 comments on commit 9e96345

Please sign in to comment.