Skip to content

Commit

Permalink
feat: add new feature
Browse files Browse the repository at this point in the history
Fixed issue with linting,
Added the URL scheme to info.plist,
  • Loading branch information
Anshul Thakur committed May 15, 2024
1 parent dcd5895 commit 2e3407f
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 25 deletions.
8 changes: 7 additions & 1 deletion example/ios/DetectFridaExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
Expand All @@ -48,5 +47,12 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>cydia</string>
<string>undecimus</string>
<string>sileo</string>
<string>zbra</string>
</array>
</dict>
</plist>
28 changes: 22 additions & 6 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import * as React from 'react';

import { FlatList, Platform, SafeAreaView, StyleSheet, Text, View } from 'react-native';
import {
FlatList,
Platform,
SafeAreaView,
StyleSheet,
Text,
View,
} from 'react-native';
import { isDeviceRooted } from 'react-native-detect-frida';

export default function App() {
Expand All @@ -25,15 +32,21 @@ export default function App() {
});
}, []);

const getItemStateColor = (state: boolean) => {
return state ? 'red' : 'green';
};

const _renderItem = (item: CheckStatus) => {
return (
<View style={styles.itemStyle}>
<Text style={{ textTransform: 'capitalize' }}>{item.name}</Text>
<Text style={styles.itemTextStyle}>{item.name}</Text>
<Text
style={{
color: item.state ? 'red' : 'green',
textTransform: 'capitalize',
}}
style={[
styles.itemTextStyle,
{
color: getItemStateColor(item.state),
},
]}
>
{item.state ? 'Detected' : 'Secured'}
</Text>
Expand Down Expand Up @@ -75,4 +88,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'space-between',
},
itemTextStyle: {
textTransform: 'capitalize',
},
});
28 changes: 14 additions & 14 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#pre-commit:
# parallel: true
# commands:
# lint:
# glob: '*.{js,ts,jsx,tsx}'
# run: npx eslint {staged_files}
# types:
# glob: '*.{js,ts, jsx, tsx}'
# run: npx tsc --noEmit
#commit-msg:
# parallel: true
# commands:
# commitlint:
# run: npx commitlint --edit
pre-commit:
parallel: true
commands:
lint:
glob: '*.{js,ts,jsx,tsx}'
run: yarn eslint {staged_files}
types:
glob: '*.{js,ts,jsx,tsx}'
run: yarn tsc --noEmit
commit-msg:
parallel: true
commands:
commitlint:
run: yarn commitlint --edit
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-detect-frida",
"version": "0.1.2",
"version": "0.1.3",
"description": "A React-Native library to detect if frida server is running or not",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -36,8 +36,13 @@
},
"keywords": [
"react-native",
"ios",
"android"
"react-native-detect-frida",
"react-native-frida",
"detect-frida",
"frida",
"detect-frida-server",
"frida-root-detection",
"react-native-prevent-frida-bypass"
],
"repository": {
"type": "git",
Expand Down
Binary file removed react-native-detect-frida-0.1.0.tgz
Binary file not shown.
Binary file removed react-native-detect-frida-0.1.1.tgz
Binary file not shown.
Binary file removed react-native-detect-frida-0.1.2.tgz
Binary file not shown.
1 change: 1 addition & 0 deletions src/ValueTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface CheckStatus {
state: boolean;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface RootCheckResult {
isRooted: boolean;
checkStatus: CheckStatus[];
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export function isDeviceRooted(): Promise<RootCheckResult> {
if (isAndroid()) {
return DetectFrida.detectRoot();
} else {
return DetectFrida.isJailBroken()
return DetectFrida.isJailBroken();
}
}

0 comments on commit 2e3407f

Please sign in to comment.