Geek7 commited on
Commit
8ef9801
·
verified ·
1 Parent(s): b84882d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py CHANGED
@@ -25,6 +25,13 @@ app = Flask(__name__)
25
  CORS(app) # Enable CORS for all routes
26
 
27
 
 
 
 
 
 
 
 
28
 
29
 
30
 
@@ -132,6 +139,22 @@ def get_ip():
132
 
133
 
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
 
137
 
 
25
  CORS(app) # Enable CORS for all routes
26
 
27
 
28
+ # ✅ Define the latest app version
29
+ LATEST_VERSION = "1.5.0"
30
+
31
+ # ✅ Store the latest APK download link
32
+ APK_DOWNLOAD_URL = "https://your-website.com/latest.apk"
33
+
34
+
35
 
36
 
37
 
 
139
 
140
 
141
 
142
+ @app.route('/check_update', methods=['GET'])
143
+ def check_update():
144
+ installed_version = request.args.get("current_version", "0")
145
+
146
+ # ✅ Compare installed version with latest version
147
+ update_available = installed_version < LATEST_VERSION
148
+
149
+ return jsonify({
150
+ "latest_version": LATEST_VERSION,
151
+ "update_available": update_available
152
+ })
153
+
154
+ @app.route('/get_apk_link', methods=['GET'])
155
+ def get_apk_link():
156
+ return jsonify({"apk_url": APK_DOWNLOAD_URL}) # ✅ Return latest APK link
157
+
158
 
159
 
160