Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ buck-out/

# Bundle artifact
*.jsbundle

.vscode/settings.json
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Don't ship the example project
# Don't ship the example projects
ExampleProject/
ExampleExpo/

.github/
.yarn/
.yarnrc
41 changes: 41 additions & 0 deletions ExampleExpo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
.kotlin/
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# generated native folders
/ios
/android
117 changes: 117 additions & 0 deletions ExampleExpo/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { useEffect, useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { StatusBar } from 'expo-status-bar';
import JailMonkey from 'jail-monkey';

export default function App() {
const [isDevelopmentSettingsMode, setIsDevelopmentSettingsMode] = useState<
boolean | undefined
>();
const [isDebuggedMode, setIsDebuggedMode] = useState<boolean | undefined>();

useEffect(() => {
JailMonkey.isDevelopmentSettingsMode()
.then(setIsDevelopmentSettingsMode)
.catch(console.warn);
}, []);

useEffect(() => {
JailMonkey.isDebuggedMode().then(setIsDebuggedMode).catch(console.warn);
}, []);

return (
<SafeAreaView style={styles.root}>
<StatusBar style="auto" />
<View style={styles.content}>
<Text style={styles.title}>Expo SDK 55 (New Architecture)</Text>
<Text style={styles.subtitle}>jail-monkey from ../ (local)</Text>

<Text style={styles.section}>Android & iOS</Text>
<Row label="isJailBroken" value={JailMonkey.isJailBroken()} />
<Row label="canMockLocation" value={JailMonkey.canMockLocation()} />
<Row label="trustFall" value={JailMonkey.trustFall()} />
<Row label="isDebuggedMode" value={isDebuggedMode} />

<Text style={styles.section}>Android</Text>
<Text style={styles.note}>
These APIs will always return false on iOS.
</Text>
<Row label="hookDetected" value={JailMonkey.hookDetected()} />
<Row
label="isOnExternalStorage"
value={JailMonkey.isOnExternalStorage()}
/>
<Row label="AdbEnabled" value={JailMonkey.AdbEnabled()} />
<Row
label="isDevelopmentSettingsMode"
value={isDevelopmentSettingsMode}
/>
</View>
</SafeAreaView>
);
}

function Row({
label,
value,
}: {
label: string;
value: string | boolean | undefined;
}) {
return (
<View
style={styles.row}
accessibilityLabel={`${label}: ${value?.toString() ?? 'unknown'}`}>
<Text style={styles.label}>{label}:</Text>
<Text style={styles.value}>{value?.toString() ?? 'unknown'}</Text>
</View>
);
}

const styles = StyleSheet.create({
root: {
flex: 1,
backgroundColor: '#fff',
},
content: {
padding: 20,
},
title: {
fontSize: 22,
color: '#000',
fontWeight: '700',
marginBottom: 4,
},
subtitle: {
fontSize: 13,
color: '#666',
marginBottom: 16,
},
section: {
fontSize: 20,
color: '#000',
fontWeight: '700',
marginTop: 16,
marginBottom: 5,
},
note: {
fontSize: 11,
color: '#888',
marginBottom: 10,
},
row: {
flexDirection: 'row',
marginBottom: 5,
},
label: {
fontSize: 16,
color: '#444',
fontWeight: '700',
marginRight: 5,
},
value: {
fontSize: 16,
color: '#444',
},
});
30 changes: 30 additions & 0 deletions ExampleExpo/app.json

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon we'd like to rename this directory to ExampleExpo -- we'll likely want to update the SDK version here over time without creating a new exmaple project with every major SDK.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"expo": {
"name": "ExampleExpo",
"slug": "ExampleExpo",
"version": "1.0.0",
"scheme": "exampleexpo",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.jailmonkey.exampleexpo"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.jailmonkey.exampleexpo"
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file added ExampleExpo/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleExpo/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleExpo/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ExampleExpo/assets/splash-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions ExampleExpo/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { registerRootComponent } from 'expo';
import { SafeAreaProvider } from 'react-native-safe-area-context';

import App from './App';

function Root() {
return (
<SafeAreaProvider>
<App />
</SafeAreaProvider>
);
}

registerRootComponent(Root);
28 changes: 28 additions & 0 deletions ExampleExpo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "example-expo",
"version": "1.0.0",
"main": "index.tsx",
"private": true,
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"prebuild": "expo prebuild",
"prebuild:clean": "expo prebuild --platform all --clean"
},
"dependencies": {
"expo": "~55.0.0",
"expo-dev-client": "~55.0.19",
"expo-status-bar": "~55.0.4",
"expo-system-ui": "~55.0.11",
"jail-monkey": "../",
"react": "19.2.0",
"react-native": "0.83.6",
"react-native-safe-area-context": "~5.6.2"
},
"devDependencies": {
"@types/react": "~19.2.10",
"typescript": "~5.9.2"
}
}
6 changes: 6 additions & 0 deletions ExampleExpo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
}
}
Loading
Loading