This commit is contained in:
Renan LE CARO 2025-03-18 15:49:11 +01:00
parent 83b9b8b9e8
commit 2623eaaa73
12 changed files with 12 additions and 7569 deletions

View file

@ -11,8 +11,8 @@ android {
applicationId = "me.lecaro.breakout" applicationId = "me.lecaro.breakout"
minSdk = 21 minSdk = 21
targetSdk = 34 targetSdk = 34
versionCode = 29038466 versionCode = 29038489
versionName = "29038466" versionName = "29038489"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
useSupportLibrary = true useSupportLibrary = true

File diff suppressed because one or more lines are too long

View file

@ -61,10 +61,10 @@ class MainActivity : android.app.Activity() {
val decodedBytes = android.util.Base64.decode(base64Data, android.util.Base64.DEFAULT) val decodedBytes = android.util.Base64.decode(base64Data, android.util.Base64.DEFAULT)
if (url.startsWith("data:application/json;base64,")) { if (url.startsWith("data:application/json;base64,")) {
writeFile(decodedBytes, "breakout-71-save-$currentDate.b71", "application/b71") writeFile(decodedBytes, "breakout-71-save-$currentDate.json", "application/json")
} else if (url.startsWith("data:video/webm;base64,")) { } else if (url.startsWith("data:video/webm;base64,")) {
writeFile(decodedBytes, "breakout-71-gameplay-capture-$currentDate.webm", "application/b71") writeFile(decodedBytes, "breakout-71-gameplay-capture-$currentDate.webm", "video/webm")
} else { } else {
Log.w("DL", "unexpected type " + url) Log.w("DL", "unexpected type " + url)
} }
@ -85,7 +85,7 @@ class MainActivity : android.app.Activity() {
val contentValues = ContentValues().apply { val contentValues = ContentValues().apply {
put(MediaStore.Downloads.DISPLAY_NAME, fileName) put(MediaStore.Downloads.DISPLAY_NAME, fileName)
put(MediaStore.Downloads.MIME_TYPE,mime ) put(MediaStore.Downloads.MIME_TYPE,mime )
put(MediaStore.Downloads.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS) put(MediaStore.Downloads.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS)
} }
val uri: Uri? = contentResolver.insert( val uri: Uri? = contentResolver.insert(

33
dist/PWA/sw-b71.js vendored
View file

@ -1,33 +1,2 @@
// The version of the cache. function e(e,t,n,r,a,i,c){try{var o=e[i](c),u=o.value}catch(e){n(e);return}o.done?t(u):Promise.resolve(u).then(r,a)}function t(t){return function(){var n=this,r=arguments;return new Promise(function(a,i){var c=t.apply(n,r);function o(t){e(c,a,i,o,u,"next",t)}function u(t){e(c,a,i,o,u,"throw",t)}o(void 0)})}}function n(e,t){var n,r,a,i,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(i){return function(o){return function(i){if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(a=(a=c.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){c.label=i[1];break}if(6===i[0]&&c.label<a[1]){c.label=a[1],a=i;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(i);break}a[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,o])}}}var r="breakout-71-".concat("29038489"),a=["/"];self.addEventListener("install",function(e){e.waitUntil(t(function(){return n(this,function(e){switch(e.label){case 0:return[4,caches.open(r)];case 1:return e.sent().addAll(a),[2]}})})())}),self.addEventListener("activate",function(e){e.waitUntil(t(function(){return n(this,function(e){switch(e.label){case 0:return[4,caches.keys()];case 1:return[4,Promise.all(e.sent().map(function(e){if(e!==r)return caches.delete(e)}))];case 2:return e.sent(),[4,clients.claim()];case 3:return e.sent(),[2]}})})())}),self.addEventListener("fetch",function(e){if("navigate"===e.request.mode&&e.request.url.endsWith("/index.html?isPWA=true")){e.respondWith(caches.match("/"));return}});
const VERSION = "29038466";
// The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`;
// The static resources that the app needs to function.
const APP_STATIC_RESOURCES = [
"/"
];
// On install, cache the static resources
self.addEventListener("install", (event)=>{
event.waitUntil((async ()=>{
const cache = await caches.open(CACHE_NAME);
cache.addAll(APP_STATIC_RESOURCES);
})());
});
// delete old caches on activate
self.addEventListener("activate", (event)=>{
event.waitUntil((async ()=>{
const names = await caches.keys();
await Promise.all(names.map((name)=>{
if (name !== CACHE_NAME) return caches.delete(name);
}));
await clients.claim();
})());
});
self.addEventListener("fetch", (event)=>{
if (event.request.mode === "navigate" && event.request.url.endsWith("/index.html?isPWA=true")) {
event.respondWith(caches.match("/"));
return;
}
});
//# sourceMappingURL=sw-b71.js.map //# sourceMappingURL=sw-b71.js.map

File diff suppressed because one or more lines are too long

3765
dist/index.html vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

BIN
src/PWA/icon-512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -1,5 +1,5 @@
// The version of the cache. // The version of the cache.
const VERSION = "29038466"; const VERSION = "29038489";
// The name of the cache // The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`; const CACHE_NAME = `breakout-71-${VERSION}`;

View file

@ -1 +1 @@
"29038466" "29038489"

View file

@ -738,7 +738,7 @@ async function openSettingsPanel() {
let input: HTMLInputElement = document.createElement("input"); let input: HTMLInputElement = document.createElement("input");
input.setAttribute("type", "file"); input.setAttribute("type", "file");
input.setAttribute("id", "save_file_picker"); input.setAttribute("id", "save_file_picker");
input.setAttribute("accept", ".b71"); input.setAttribute("accept", ".b71,.json");
input.style.position = "absolute"; input.style.position = "absolute";
input.style.left = "-1000px"; input.style.left = "-1000px";
input.addEventListener("change", async (e) => { input.addEventListener("change", async (e) => {