Comments (8)
@GantMan
Thanks for the help and this great Library.
I'm able to run on Android now.
from jail-monkey.
That's odd - I don't mention a navigator anywhere in this library. Are you sure you have cleaned your packager and cache?
I just created a brand new 0.30.0 app and implemented the following app, it worked fine:
import React, { Component } from 'react';
import JailMonkey from 'jail-monkey';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
class RNMonkey extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
IS JAIL BROKEN?
</Text>
<Text style={styles.instructions}>
{JailMonkey.isJailBroken().toString()}
</Text>
<Text style={styles.welcome}>
CAN MOCK LOCATION?
</Text>
<Text style={styles.instructions}>
{JailMonkey.canMockLocation().toString()}
</Text>
<Text style={styles.welcome}>
TRUST FALL?
</Text>
<Text style={styles.instructions}>
{JailMonkey.trustFall().toString()}
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('RNMonkey', () => RNMonkey);
from jail-monkey.
I found out that base on the same code.
It works fine on iOS but gets errors on Android.
And I not sure how to clean packager and cache.
Did I miss something else?
from jail-monkey.
Is the Android code exactly the same? Can you copy and paste it?
from jail-monkey.
@GantMan
Yes ,exactly the same.
Here's my code
import React, { Component } from 'react';
import JailMonkey from 'jail-monkey';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
class Fuck extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
IS JAIL BROKEN?
</Text>
<Text style={styles.instructions}>
{JailMonkey.isJailBroken().toString()}
</Text>
<Text style={styles.welcome}>
CAN MOCK LOCATION?
</Text>
<Text style={styles.instructions}>
{JailMonkey.canMockLocation().toString()}
</Text>
<Text style={styles.welcome}>
TRUST FALL?
</Text>
<Text style={styles.instructions}>
{JailMonkey.trustFall().toString()}
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('Fuck', () => Fuck);
from jail-monkey.
@GantMan
Have you tried on Android?
from jail-monkey.
I know it works perfectly on Android in 0.27.2, I'll check on 0.30.0 now.
from jail-monkey.
I found your problem
If you use rnpm to link the library, it doesn't know about the update that happened in 0.29. rnpm actually is FAILING to link anything after 0.29.0, because it links the Activity in Java and not the Application (introduced in 0.29.0).
Looks like people will have to use react-native link
if they are 0.29+. I'll add this to the README.
If you adjust your MainApplication.java
to this, it will work for you:
package com.rnmonkey;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.gantix.JailMonkey.JailMonkeyPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new JailMonkeyPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}
from jail-monkey.
Related Issues (20)
- null is not an object (evaluating 'JailMonkey.isJailBroken') HOT 3
- Android canMockLocation Does Not Check If Permission Is Granted
- False Alarm on OnePlus 6 and OnePlus 6T on updating the Android version to 11 HOT 5
- Disable RootBeer logs in production
- False alarm on iPhone 7 HOT 1
- Jailbreak Hestia not detected on iOS
- JailMonkey in Android is Depreciated by Magisk HOT 4
- JailMonkey.canMockLocation() return false in physical device (Android and Ios) and Ios Emulator return True HOT 1
- Android and iOS Devices always return different result -> JailMonkey.isJailBroken() HOT 1
- AAPT: error: resource android:attr/lStar not found. HOT 1
- Frida pass hookDetected and isJailBroken methods on Android HOT 12
- Update Rootbeer latest version in the jail-monkey HOT 4
- Error : Cannot read property 'rootedDetectionMethods' of null HOT 1
- Failed unit test: TypeError: Cannot read properties of undefined (reading 'rootedDetectionMethods') HOT 2
- jail-monkey not working in Sony Xperia devices
- CanMockLocation method returns true even for the calender in xaiomi phones HOT 3
- Unexpected Behavior in isJailBroken() Method After React Native Upgrade HOT 2
- Using expo start for development is breaking, Cannot read property 'rootedDetectionMethods' of null HOT 1
- Exception in HostObject::get for prop 'JailMonkey': java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
- React Native run ios problem with cocoapods file cannot be open()ed errno=1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jail-monkey.