Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
rn-update-apk
Advanced tools
Easily check for new APKs and install them in React Native.
npm install rn-update-apk --save
Linking automatically with react-native link
react-native link rn-update-apk
react-native link react-native-fs
Android API24+ requires the use of a FileProvider to share "content" (like downloaded APKs) with other applications (like the system installer, to install the APK update). So you must add a FileProvider entry to your AndroidManifest, and it will reference a "filepaths" XML file. Both are demonstrated in the example.
Please install and run the example to see how it works then adapt it into your own app.
import { Alert } from 'react-native';
import updateApk from 'rn-update-apk';
const updater = new updateApk({
iosAppId: '123456', // iOS is app store only, but we can point the user there
apkVersionUrl: 'https://github.com/your-github-name/version.json',
fielProviderAuthority: "com.example.fileprovider",
needUpdateApp: (needUpdate) => {
Alert.alert(
'Update Available',
'New version released, do you want to update?',
[
{text: 'Cancel', onPress: () => {}},
{text: 'Update', onPress: () => needUpdate(true)}
]
);
},
forceUpdateApp: () => {
console.log("Force update will start")
},
notNeedUpdateApp: () => {
console.log("App is up to date")
},
downloadApkStart: () => { console.log("Start") },
downloadApkProgress: (progress) => { console.log(`Downloading ${progress}%...`) },
downloadApkEnd: () => { console.log("End") },
onError: () => { console.log("downloadApkError") }
});
updater.checkUpdate();
// version.json example
// Note you will need to verify SSL works for Android <5 as it has SSL Protocol bugs
// If it doesn't then you may be able to use Google Play Services to patch the SSL Provider, or just serve your updates over HTTP for Android <5
// https://stackoverflow.com/a/36892715
{
"versionName":"1.0.0",
"apkUrl":"https://github.com/NewApp.apk",
"forceUpdate": false
}
3.1.0
FAQs
Check for new APK versions and update app from React Native
The npm package rn-update-apk receives a total of 79 weekly downloads. As such, rn-update-apk popularity was classified as not popular.
We found that rn-update-apk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.