mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Don't include firmware in development builds (speeds install time)
This commit is contained in:
parent
c7c89aeb71
commit
40055f603d
9 changed files with 71 additions and 4 deletions
|
|
@ -1442,7 +1442,7 @@ class MeshService : Service(), Logging {
|
|||
/***
|
||||
* Return the filename we will install on the device
|
||||
*/
|
||||
fun setFirmwareUpdateFilename(info: MeshProtos.MyNodeInfo) {
|
||||
private fun setFirmwareUpdateFilename(info: MeshProtos.MyNodeInfo) {
|
||||
firmwareUpdateFilename = try {
|
||||
if (info.region != null && info.firmwareVersion != null && info.hwModel != null)
|
||||
SoftwareUpdateService.getUpdateFilename(
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ class SoftwareUpdateService : JobIntentService(), Logging {
|
|||
hwVerIn: String,
|
||||
swVer: String,
|
||||
mfg: String
|
||||
): String {
|
||||
): String? {
|
||||
val curver = context.getString(R.string.cur_firmware_version)
|
||||
|
||||
val regionRegex = Regex(".+-(.+)")
|
||||
|
|
@ -230,7 +230,12 @@ class SoftwareUpdateService : JobIntentService(), Logging {
|
|||
val (region) = regionRegex.find(hwVer)?.destructured
|
||||
?: throw Exception("Malformed hw version")
|
||||
|
||||
return "firmware/firmware-$mfg-$region-$curver.bin"
|
||||
val name = "firmware/firmware-$mfg-$region-$curver.bin"
|
||||
// Check to see if the file exists (some builds might not include update files for size reasons)
|
||||
return if (!context.assets.list(name).isNullOrEmpty())
|
||||
name
|
||||
else
|
||||
null
|
||||
}
|
||||
|
||||
/** Return the filename this device needs to use as an update (or null if no update needed)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue