diff --git a/Makefile b/Makefile index 5f420c0..50590b0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=blue-merle -PKG_VERSION:=1.0.0 +PKG_VERSION:=1.1.0 PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=Matthias @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/package.mk define Package/blue-merle SECTION:=utils CATEGORY:=Utilities - DEPENDS:=+bash +coreutils-shred +python3 +python3-pyserial +patch + DEPENDS:=gl-ui gl-e750-mcu +bash +coreutils-shred +python3 +python3-pyserial +patch TITLE:=Anonymity Enhancements for GL-E750 Mudi endef @@ -96,13 +96,27 @@ define Package/blue-merle/preinst } if grep -q "GL.iNet GL-E750" /proc/cpuinfo; then - if grep -q -w "3.215" /etc/glversion; then - CHECK_MCUVERSION - echo "Device is supported, installing blue-merle." - exit 0 - else - ABORT_GLVERSION - fi + GL_VERSION=$$(cat /etc/glversion) + case $$GL_VERSION in + 4.*) + echo Version $$GL_VERSION is not supported + exit 1 + ;; + 3.215) + echo Version $$GL_VERSION is supported + CHECK_MCUVERSION + exit 0 + ;; + 3.*) + echo Version $$GL_VERSION is *probably* supported + ABORT_GLVERSION + ;; + *) + echo Unknown version $$GL_VERSION + ABORT_GLVERSION + ;; + esac + CHECK_MCUVERSION else ABORT_GLVERSION fi @@ -130,8 +144,8 @@ define Package/blue-merle/postrm mv /usr/bin/switchaction.orig /usr/bin/switchaction mv /usr/bin/switch_queue.orig /usr/bin/switch_queue - rm /tmp/sim_change_start - rm /tmp/sim_change_switch + rm -f /tmp/sim_change_start + rm -f /tmp/sim_change_switch endef $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/files/lib/blue-merle/imei_generate.py b/files/lib/blue-merle/imei_generate.py index 4fd7cfe..59db66c 100644 --- a/files/lib/blue-merle/imei_generate.py +++ b/files/lib/blue-merle/imei_generate.py @@ -141,6 +141,10 @@ def generate_imei(imei_prefix, imsi_d): def validate_imei(imei): + # before anything check if length is 14 characters + if len(imei) != 14: + print(f"NOT A VALID IMEI: {imei} - IMEI must be 14 characters in length") + return False # cut off last digit validation_digit = int(imei[-1]) imei_verify = imei[0:14]