diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index d402f3d..bf64d9b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -1,27 +1,27 @@ -name: Setup -description: Setup Node.js and install dependencies +# name: Setup +# description: Setup Node.js and install dependencies -runs: - using: composite - steps: - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: .nvmrc +# runs: +# using: composite +# steps: +# - name: Setup Node.js +# uses: actions/setup-node@v3 +# with: +# node-version-file: .nvmrc - - name: Cache dependencies - id: yarn-cache - uses: actions/cache@v3 - with: - path: | - **/node_modules - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- +# - name: Cache dependencies +# id: yarn-cache +# uses: actions/cache@v3 +# with: +# path: | +# **/node_modules +# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-yarn- - - name: Install dependencies - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: | - yarn install --cwd example --frozen-lockfile - yarn install --frozen-lockfile - shell: bash +# - name: Install dependencies +# if: steps.yarn-cache.outputs.cache-hit != 'true' +# run: | +# yarn install --cwd example --frozen-lockfile +# yarn install --frozen-lockfile +# shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6d8789..01a9d68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,48 +1,48 @@ -name: CI -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup - uses: ./.github/actions/setup - - - name: Lint files - run: yarn lint - - # - name: Typecheck files - # run: yarn typecheck - - # test: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - - # - name: Setup - # uses: ./.github/actions/setup - - # - name: Run unit tests - # run: yarn test --maxWorkers=2 --coverage - - # build: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - - # - name: Setup - # uses: ./.github/actions/setup - - # - name: Build package - # run: yarn prepack +# name: CI +# on: +# push: +# branches: +# - main +# pull_request: +# branches: +# - main + +# jobs: +# lint: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 + +# - name: Setup +# uses: ./.github/actions/setup + +# - name: Lint files +# run: yarn lint + +# # - name: Typecheck files +# # run: yarn typecheck + +# # test: +# # runs-on: ubuntu-latest +# # steps: +# # - name: Checkout +# # uses: actions/checkout@v3 + +# # - name: Setup +# # uses: ./.github/actions/setup + +# # - name: Run unit tests +# # run: yarn test --maxWorkers=2 --coverage + +# # build: +# # runs-on: ubuntu-latest +# # steps: +# # - name: Checkout +# # uses: actions/checkout@v3 + +# # - name: Setup +# # uses: ./.github/actions/setup + +# # - name: Build package +# # run: yarn prepack diff --git a/README.md b/README.md index f020983..1a82f5f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ ![Simulator Screen Recording](https://user-images.githubusercontent.com/37437842/206644553-e4c3f2bc-b624-47ac-a005-132199e049b2.gif) +![Simulator Screen Recording - iPhone 15 Pro - 2024-07-02 at 21 19 17](https://github.com/0xlethe/react-native-capture-protection/assets/37437842/ac98e942-8dba-4e5d-9f23-fa10f946b26b) + ## Features - iOS Capture Event via screen recording, capture capture with Listener diff --git a/example/0.73/src/Main.tsx b/example/0.73/src/Main.tsx index a96d179..0149e73 100644 --- a/example/0.73/src/Main.tsx +++ b/example/0.73/src/Main.tsx @@ -1,13 +1,13 @@ import * as React from 'react'; -import { StyleSheet, View, Button, Text } from 'react-native'; +import {StyleSheet, View, Button, Text} from 'react-native'; import { CaptureProtection, CaptureProtectionModuleStatus, useCaptureProtection, } from 'react-native-capture-protection'; -import { useNavigation } from '@react-navigation/native'; +import {useNavigation} from '@react-navigation/native'; export default function Main() { - const { isPrevent, status } = useCaptureProtection(); + const {isPrevent, status} = useCaptureProtection(); const navigation = useNavigation(); React.useEffect(() => { @@ -16,19 +16,19 @@ export default function Main() { React.useEffect(() => { console.log( 'Main Prevent Status is', - status ? CaptureProtectionModuleStatus?.[status] : undefined + status ? CaptureProtectionModuleStatus?.[status] : undefined, ); }, [status]); return ( - + {'Record Prevent : ' + isPrevent?.record} - + {'Screenshot Prevent : ' + isPrevent?.screenshot} - + {'Status : ' + (status ? CaptureProtectionModuleStatus?.[status] : undefined)} @@ -36,7 +36,7 @@ export default function Main() { title="set Record Protect Screen by Text" onPress={() => { CaptureProtection.setScreenRecordScreenWithText?.( - 'This is Text Message!' + 'This is Text Message!', ); }} /> @@ -70,6 +70,18 @@ export default function Main() { CaptureProtection.preventScreenshot(); }} /> +