
Security News
VulnCon 2025: NVD Scraps Industry Consortium Plan, Raising Questions About Reform
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
react-native-android-auto-update
Advanced tools
React Native Android自动下载更新APK,进度条在通知栏中显示
$ npm install git+http://git@github.com/React-Sextant/react-native-android-auto-update.git
$ react-native link react-native-android-auto-update
import {UpdateApp,UiType} from 'react-native-android-auto-update'
UpdateApp({
apkUrl:"http://.example.com/demo.apk",
updateTitle:"发现新版本V2.3.0",
updateContent:"1、Kotlin重构版\n2、支持自定义UI\n3、增加md5校验\n4、更多功能等你探索",
force:true,
uiType:UiType.PLENTIFUL,
titleTextColor:"red",
UpdateDownloadListener:(type,msg)=>{
//@param type: onStart | onDownload | onFinish | onError
if(type === "onDownload"){
console.log(msg); // progress
}else if(type === "onError"){
alert(msg); // error message
}
},
OnBtnClickListener:(type)=>{
console.log(type); // onCancelBtnClick, onUpdateBtnClick
return false; // 事件是否消费,是否需要传递下去。false-会执行原有点击逻辑,true-只执行本次设置的点击逻辑
}
});
完善uiType类型UiType.CUSTOM
UiType.CUSTOM
类型,本库custom ui不能通过RN生成,只能自定义XML实现,view_update_dialog_custom.xml
的Layout文件即可覆盖view_update_dialog_custom.xml
元素ID必须按照以下命名
<!--更新标题-->
<TextView android:id="@+id/tv_update_title" />
<!--更新内容-->
<TextView android:id="@+id/tv_update_content" />
<!--apk版本名-->
<TextView android:id="@+id/tv_version_name" />
<!--apk版本号-->
<TextView android:id="@+id/tv_version_code" />
<!--更新按钮文案-->
<TextView android:id="@+id/btn_update_sure" />
<!--取消按钮文案-->
<Button android:id="@+id/btn_update_cancel" />
...
FAQs
React Native Android 应用自动更新
The npm package react-native-android-auto-update receives a total of 3 weekly downloads. As such, react-native-android-auto-update popularity was classified as not popular.
We found that react-native-android-auto-update 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
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.