New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flyskywhy/react-native-android-shell

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flyskywhy/react-native-android-shell

This module for execute shell android, use command and execute shell

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
0
Weekly downloads
 
Created
Source

@flyskywhy/react-native-android-shell

npm version npm downloads npm licence Platform

This module is for execute shell command on android.

On rooted device with e.g. install-supersu, even can run root command, e.g.

AndroidShell.executeCommand(
    'su -c ifconfig eth0 down; su -c ifconfig eth0 hw ether 19:21:19:49:20:21; su -c ifconfig eth0 up',
    (result) => {},
);

1.x if gradle < 7 2.x if gradle >= 7



Forked from react-native-android-shel, and fix Error: Program type already present: com.reactlibrary.BuildConfig on release build. Below is its README.



Screenshot

Alt text Alt text Alt text

Getting started

$ npm install @flyskywhy/react-native-android-shell --save

Usage

import AndroidShell from '@flyskywhy/react-native-android-shell';

// TODO: What to do with the module?
AndroidShell.executeCommand('your Command', (result) => {
  console.log(result)
});

Example

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import AndroidShell from '@flyskywhy/react-native-android-shell'

class demo extends Component {
    constructor(props) {
        super(props);
        this.state = {
            result: ''
        };
    }

    componentDidMount() {
        AndroidShell.executeCommand("ls", (result) => {
            this.setState({ result: 'yeu : ' + result });
            console.log('Result :', result);
        });
    }

    render() {
        return (
            <View style={{alignItems: 'center', flex: 1 }}>
                <Text>{this.state.result}</Text>
            </View>
        );
    }
}

export default demo;

Keywords

FAQs

Package last updated on 07 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc