Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-native-pack
Advanced tools
#描述 rnpack是一个rn项目的打包构建工具,支持ios和android渠道提交,支持自建服务的增量更新
npm install rnpack-cli -g
##rnpack工具使用
##客户端使用
npm install react-native-pack --save
##工具客户端库:
import {Platform, Alert, Linking} from "react-native";
import {checkUpdate, packageVersion, currentVersion, downloadUpdate, switchVersion, Env, downloadApk} from "react-native-pack";
import _updateConfig from "../../rnpack_app.json";
const {appKey} = _updateConfig[Platform.OS];
const doUpdate = info => {
console.log("doUpdate info:", info);
downloadUpdate(info).then(hash => {
console.log("doUpdate 应用更新");
//不再提示,默认下次启动应用更新
// Alert.alert('提示', '检查到新的版本'+info.name+',是否重启应用?', [
// {text: '立即重启', onPress: ()=>{switchVersion(hash);}},
// {text: '下次启动时应用更新', onPress: ()=>{switchVersionLater(hash);}},
// ]);
switchVersion(info.hash, info.name).then((data)=>{
console.log("switchVersion hash:", info.hash);
console.log("switchVersion name:", info.name);
}).catch((err)=>{
console.log("switchVersion err:", err);
});
}).catch(err => {
Alert.alert('提示', '更新失败.');
console.log("doUpdate 更新失败:", err);
});
};
export const checkVersionUpdate = (isLaunch) => {
console.log("checkVersionUpdate");
checkUpdate(appKey, Env).then(info => {
console.log("check info:", info);
if (info.type == "Package") {
if(Platform.OS == "ios"){
let url = info.opt.url || "https://itunes.apple.com/cn/app/wan-wu-she/id1156373629?l=en&mt=8";
Alert.alert('提示', '您的应用版本已更新,请前往应用商店下载新的版本',
[{
text: '确定',
onPress: ()=>{
Linking.openURL(url);
}
}],
{cancelable:false}
);
}else{
Alert.alert('提示', '您的应用版本已更新,是否更新?',
[
{
text: '取消', onPress: () => {}
},
{
text: '确定', onPress: () => {
downloadApk(info.data.url, info.data.hash).then((res)=>{
console.log("downloadApk res:", res);
}).catch((err)=>{
console.log("downloadApk err:", err);
})
}
}
],
{
cancelable: false
}
);
}
} else if (info.type == "Bundle") {
doUpdate(info.updateInfo);
} else {
// Alert.alert('提示', '您的应用版本已是最新.');
console.log("您的应用版本已是最新:", currentVersion + " packageVersion:" + packageVersion);
if(!isLaunch){
utils.toast("已经是最新版本");
}
}
}).catch(err => {
//Alert.alert('提示', '检测更新失败.');
console.log("checkVersionUpdate 检测更新失败 err:", err);
});
};
##工具服务端:
FAQs
rnpack是一个rn项目的打包构建工具,支持ios和android渠道提交,支持自建服务的增量更新
The npm package react-native-pack receives a total of 5 weekly downloads. As such, react-native-pack popularity was classified as not popular.
We found that react-native-pack 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.