Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
react-native-pack
Advanced tools
#描述 rnpack是一个rn项目的打包构建工具,支持ios和android渠道提交,支持自建服务的增量更新
#v1.2.2 新增支持android
#v1.2.1 新增支持新版的xocdebuild
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 3 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.