Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Dec 31, 2024
1 parent 83b0480 commit f670f72
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 23 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
CCACHE_DIR: ${{ github.workspace }}/.ccache
USE_CCACHE: 1
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'

- name: Cache Node.js modules
id: node-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-node-modules-${{ hashFiles('package-lock.json') }}
Expand All @@ -40,7 +40,7 @@ jobs:
if: steps.node-cache.outputs.cache-hit != 'true'

- name: Cache Gradle packages
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -56,8 +56,8 @@ jobs:
name: Install Titanium CLI

# TODO: Cache sdk install
- run: ti sdk install 11.1.1.GA --force
name: Install SDK 11.1.1.GA
- run: ti sdk install 12.5.1.GA --force
name: Install Ti SDK

- name: Set up Homebrew
id: set-up-homebrew
Expand All @@ -70,10 +70,10 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
java-version: '17'

- name: Retrieve ccache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ github.sha }}
Expand All @@ -85,7 +85,7 @@ jobs:
with:
api-level: 29
target: playstore
script: npm run test:android -- --sdkVersion 11.1.1.GA
script: npm run test:android -- --sdkVersion 12.5.1.GA
disable-animations: false # defaulting to true, the commands sent to emulator to do this sometimes run too quickly after boot and cause "adb: device offline" failures

- name: Show summary of ccache configuration and statistics counters
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
name: Docs
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'

- run: npm ci
name: Install dependencies
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
runs-on: macos-latest
name: iOS
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'

- name: Cache Node.js modules
id: node-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-node-modules-${{ hashFiles('package-lock.json') }}
Expand All @@ -44,8 +44,8 @@ jobs:

# TODO cache SDK install

- run: ti sdk install 11.1.1.GA --force
name: Install SDK 11.1.1.GA
- run: ti sdk install 12.5.1.GA --force
name: Install Ti SDK

- run: sed -i .bak 's/TITANIUM_SDK_VERSION = .*/TITANIUM_SDK_VERSION = 11.1.1.GA/' ios/titanium.xcconfig
name: Set to Build with 11.1.1.GA SDK
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
runs-on: ubuntu-latest
name: JavaScript
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'

- name: Cache Node.js modules
id: node-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-node-modules-${{ hashFiles('package-lock.json') }}
Expand Down
1 change: 1 addition & 0 deletions android/src/ti/identity/FingerPrintHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public void startListening(KrollFunction callback, KrollObject obj)
promptInfo.setDescription(TitaniumIdentityModule.reasonText);
promptInfo.setSubtitle(TitaniumIdentityModule.reasonSubtitle);
promptInfo.setNegativeButtonText(TitaniumIdentityModule.negativeButtonText);
promptInfo.setConfirmationRequired(TitaniumIdentityModule.confirmationRequired);

final Executor executor = Executors.newSingleThreadExecutor();
final BiometricPrompt prompt =
Expand Down
1 change: 1 addition & 0 deletions android/src/ti/identity/KeychainItemProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public void onAuthenticationFailed()
promptInfo.setSubtitle(TitaniumIdentityModule.reasonSubtitle);
promptInfo.setDescription(TitaniumIdentityModule.reasonText);
promptInfo.setNegativeButtonText(TitaniumIdentityModule.negativeButtonText);
promptInfo.setConfirmationRequired(TitaniumIdentityModule.confirmationRequired);
biometricPromptInfo = promptInfo.build();
}

Expand Down
5 changes: 5 additions & 0 deletions android/src/ti/identity/TitaniumIdentityModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class TitaniumIdentityModule extends KrollModule
public static final String PROPERTY_REASON_SUBTITLE = "reasonSubtitle";
public static final String PROPERTY_REASON_TEXT = "reasonText";
public static final String PROPERTY_CANCEL_TITLE = "cancelTitle";
public static final String PROPERTY_CONFIRMATION = "confirmationRequired";

@Kroll.constant
public static final int SUCCESS = 0;
Expand Down Expand Up @@ -97,6 +98,7 @@ public class TitaniumIdentityModule extends KrollModule
public static String reasonSubtitle = "";
public static String reasonText = "";
public static String negativeButtonText = "Cancel";
public static boolean confirmationRequired = true;

PackageManager pm;

Expand Down Expand Up @@ -162,6 +164,9 @@ public void authenticate(HashMap params)
if (params.containsKey(PROPERTY_CANCEL_TITLE)) {
negativeButtonText = TiConvert.toString(params.get(PROPERTY_CANCEL_TITLE), negativeButtonText);
}
if (params.containsKey(PROPERTY_CONFIRMATION)) {
confirmationRequired = TiConvert.toBoolean(params.get(PROPERTY_CONFIRMATION), confirmationRequired);
}

if (params.containsKey("callback")) {
Object callback = params.get("callback");
Expand Down
10 changes: 10 additions & 0 deletions apidoc/Identity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,16 @@ properties:
platforms: [android, iphone, ipad]
osver: {ios: {min: "10.0"}}

- name: confirmationRequired
summary: |
Sets a hint to the system for whether to require user confirmation after
authentication. For example, implicit modalities like face and iris are passive,
meaning they don't require an explicit user action to complete authentication.
See https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.Builder#setConfirmationRequired(boolean)
type: String
since: "12.7.0"
platforms: [android]

- name: keepAlive
summary: |
Note: This property is iOS only!
Expand Down

0 comments on commit f670f72

Please sign in to comment.