Skip to content

Commit 29ac3e0

Browse files
Move to mpk format, add icon for LVGLTest, add more apps to appstore
1 parent a5666a0 commit 29ac3e0

File tree

7 files changed

+55
-19
lines changed

7 files changed

+55
-19
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ output/
33
notes.txt
44

55
trash/
6+
7+
appstore_backend/bundled_apps/

appstore_backend/apps.json

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
11
[
2+
{
3+
"name": "Camera Tester",
4+
"publisher": "ACME Inc",
5+
"short_description": "Simple test of the camera",
6+
"long_description": "A simple test of the camera makes it possible to validate the hardware.",
7+
"icon_url": "http://demo.lnpiggy.com:2121/apps/com.example.camtest_0.0.1.mpk_icon_64x64.png",
8+
"download_url": "http://demo.lnpiggy.com:2121/apps/com.example.camtest_0.0.1.mpk",
9+
"fullname": "com.example.camtest",
10+
"version": "0.0.1"
11+
},
12+
{
13+
"name": "IMU Tester",
14+
"publisher": "ACME Inc",
15+
"short_description": "Testing the Inertial Measurement Unit",
16+
"long_description": "It is always good to make sure the accelerometer is working properly. How else can you measure acceleration and position?",
17+
"icon_url": "http://demo.lnpiggy.com:2121/apps/com.example.imutest_0.0.1.mpk_icon_64x64.png",
18+
"download_url": "http://demo.lnpiggy.com:2121/apps/com.example.imutest_0.0.1.mpk",
19+
"fullname": "com.example.imutest",
20+
"version": "0.0.1"
21+
},
22+
{
23+
"name": "Animation Tester",
24+
"publisher": "ACME Inc",
25+
"short_description": "Testing on-display animations",
26+
"long_description": "Stress testing multiple concurrent animations on the display by adding more and more spinners",
27+
"icon_url": "http://demo.lnpiggy.com:2121/apps/com.example.lvgltest_0.0.1.mpk_icon_64x64.png",
28+
"download_url": "http://demo.lnpiggy.com:2121/apps/com.example.lvgltest_0.0.1.mpk",
29+
"fullname": "com.example.imutest",
30+
"version": "0.0.1"
31+
},
232
{
333
"name": "Weather Pro",
434
"publisher": "SkyTech",
@@ -10,23 +40,23 @@
1040
"version": "0.0.1"
1141
},
1242
{
13-
"name": "Task Manager",
43+
"name": "Task Manager (broken download link)",
1444
"publisher": "Productivity Inc.",
1545
"short_description": "Organize your tasks",
1646
"long_description": "Task Manager helps you stay organized with customizable to-do lists, reminders, and progress tracking for personal and team projects.",
1747
"icon_url": "http://demo.lnpiggy.com:2121/icons/task_manager.png",
18-
"download_url": "http://demo.lnpiggy.com:2121/zips/com.example.app2_0.0.1.zip",
19-
"fullname": "com_example_app2",
48+
"download_url": "httpppp://completelybrokendownloadlink",
49+
"fullname": "com.productivityinc.taskmanager",
2050
"version": "0.0.1"
2151
},
2252
{
23-
"name": "Fitness Tracker",
53+
"name": "Fitness Tracker (broken icon)",
2454
"publisher": "HealthCo",
2555
"short_description": "Track your workouts",
2656
"long_description": "Fitness Tracker monitors your daily activities, workouts, and sleep patterns, offering personalized insights to help you achieve your fitness goals.",
27-
"icon_url": "http://demo.lnpiggy.com:2121/icons/fitness_tracker.png",
57+
"icon_url": "httppp://completelybrokeniconurl",
2858
"download_url": "http://demo.lnpiggy.com:2121/zips/com.example.imutest_0.0.1.zip",
29-
"fullname": "com_example_imutest",
59+
"fullname": "com.healthco.fitnesstracker",
3060
"version": "0.0.1"
3161
}
3262
]

appstore_backend/bundleapps.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
22.6 KB
Loading

internal_filesystem/builtin/apps/com.example.appstore/assets/appstore.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ def download_and_unzip(zip_url, dest_folder, label):
9494
progress_bar.set_value(20, lv.ANIM.ON)
9595
time.sleep_ms(500)
9696
try:
97-
# Step 1: Download the .zip file
98-
print(f"Downloading .zip file from: {zip_url}")
97+
# Step 1: Download the .mpk file
98+
print(f"Downloading .mpk file from: {zip_url}")
9999
response = urequests.get(zip_url, timeout=10)
100100
if response.status_code != 200:
101101
print("Download failed: Status code", response.status_code)
102102
response.close()
103103
label.set_text(action_label_install)
104104
progress_bar.set_value(40, lv.ANIM.ON)
105105
time.sleep_ms(500)
106-
# Save the .zip file to a temporary location
106+
# Save the .mpk file to a temporary location
107107
try:
108108
os.remove(temp_zip_path)
109109
except Exception:
@@ -112,15 +112,15 @@ def download_and_unzip(zip_url, dest_folder, label):
112112
os.mkdir("/tmp")
113113
except Exception:
114114
pass
115-
temp_zip_path = "/tmp/temp.zip"
116-
print(f"Writing to temporary zip path: {temp_zip_path}")
115+
temp_zip_path = "/tmp/temp.mpk"
116+
print(f"Writing to temporary mpk path: {temp_zip_path}")
117117
# TODO: check free available space first!
118118
with open(temp_zip_path, "wb") as f:
119119
f.write(response.content)
120120
progress_bar.set_value(60, lv.ANIM.ON)
121121
time.sleep_ms(500)
122122
response.close()
123-
print("Downloaded .zip file, size:", os.stat(temp_zip_path)[6], "bytes")
123+
print("Downloaded .mpk file, size:", os.stat(temp_zip_path)[6], "bytes")
124124
# Step 2: Unzip the file
125125
if zipfile is None:
126126
print("WARNING: zipfile module not available in this MicroPython build, unzip will fail!")
@@ -132,7 +132,7 @@ def download_and_unzip(zip_url, dest_folder, label):
132132
print("Unzipped successfully")
133133
# Step 3: Clean up
134134
os.remove(temp_zip_path)
135-
print("Removed temporary .zip file")
135+
print("Removed temporary .mpk file")
136136
except Exception as e:
137137
print("Operation failed:", str(e))
138138
finally:

internal_filesystem/lib/shutil.mpy

543 Bytes
Binary file not shown.

scripts/bundleapps.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mkdir -p appstore_backend/bundled_apps
2+
ls -1 internal_filesystem/apps | while read appdir; do
3+
echo "Bundling $appdir"
4+
pushd internal_filesystem/apps/"$appdir"
5+
# TODO: get and append version from manifest instead of hardcoding:
6+
mpkname="../../../appstore_backend/bundled_apps/"$appdir"_0.0.1.mpk"
7+
zip -r0 "$mpkname" .
8+
cp res/mipmap-mdpi/icon_64x64.png "$mpkname"_icon_64x64.png
9+
popd
10+
done

0 commit comments

Comments
 (0)