Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ablota
Store
App
Commits
316bc7b2
Verified
Commit
316bc7b2
authored
Dec 29, 2020
by
FabioWidmer
Browse files
Improve formatting
parent
6b046fef
Changes
25
Hide whitespace changes
Inline
Side-by-side
src/components/app.vue
View file @
316bc7b2
<
template
>
<f7-app
:params=
"f7params"
>
<f7-views
class=
"safe-areas"
>
<f7-view
main
url=
"/"
:push-state=
"pushState"
:stack-pages=
"true"
:routes=
"routes
"
></f7-view>
<f7-view
:push-state=
"pushState"
:routes=
"routes"
:stack-pages=
"true"
main
url=
"/
"
></f7-view>
</f7-views>
</f7-app>
</
template
>
<
script
>
import
{
Device
}
from
'
framework7/framework7-lite.esm.bundle.js
'
;
import
cordovaApp
from
'
../js/cordova-app.js
'
;
import
routes
from
'
../js/routes.js
'
;
import
{
Device
}
from
'
framework7/framework7-lite.esm.bundle.js
'
;
import
cordovaApp
from
'
../js/cordova-app.js
'
;
import
routes
from
'
../js/routes.js
'
;
export
default
{
data
()
{
return
{
pushState
:
!
Device
.
cordova
,
routes
,
f7params
:
{
id
:
'
com.ablota.store
'
,
name
:
'
Ablota Store
'
,
version
:
'
1.0.1
'
,
theme
:
'
auto
'
,
data
:
function
()
{
return
{
url
:
'
https://store.ablota.com/
'
,
server
:
{
url
:
'
https://api.store.ablota.com/
'
},
deviceInfo
:
null
,
};
},
autoDarkTheme
:
true
,
serviceWorker
:
Device
.
cordova
?
{}
:
{
path
:
'
/service-worker.js
'
,
},
input
:
{
scrollIntoViewOnFocus
:
Device
.
cordova
&&
!
Device
.
electron
,
scrollIntoViewCentered
:
Device
.
cordova
&&
!
Device
.
electron
,
},
statusbar
:
{
enabled
:
false
,
},
toast
:
{
closeButton
:
true
,
closeButtonText
:
this
.
$t
(
'
words.ok
'
),
closeTimeout
:
5000
,
destroyonClose
:
true
,
},
dialog
:
{
buttonOk
:
this
.
$t
(
'
words.ok
'
),
buttonCancel
:
this
.
$t
(
'
words.cancel
'
),
},
photoBrowser
:
{
routableModals
:
false
,
type
:
'
popup
'
,
pageBackLinkText
:
this
.
$t
(
'
words.back
'
),
popupCloseLinkText
:
this
.
$t
(
'
words.ok
'
),
navbarOfText
:
this
.
$t
(
'
words.of
'
),
},
lazy
:
{
sequential
:
false
,
},
touch
:
{
tapHold
:
true
,
},
export
default
{
data
()
{
return
{
pushState
:
!
Device
.
cordova
,
routes
,
f7params
:
{
id
:
'
com.ablota.store
'
,
name
:
'
Ablota Store
'
,
version
:
'
1.0.1
'
,
theme
:
'
auto
'
,
data
:
function
()
{
return
{
url
:
'
https://store.ablota.com/
'
,
server
:
{
url
:
'
https://api.store.ablota.com/
'
,
},
deviceInfo
:
null
,
};
},
};
},
autoDarkTheme
:
true
,
serviceWorker
:
Device
.
cordova
?
{}
:
{
path
:
'
/service-worker.js
'
,
},
input
:
{
scrollIntoViewOnFocus
:
Device
.
cordova
&&
!
Device
.
electron
,
scrollIntoViewCentered
:
Device
.
cordova
&&
!
Device
.
electron
,
},
statusbar
:
{
enabled
:
false
,
},
toast
:
{
closeButton
:
true
,
closeButtonText
:
this
.
$t
(
'
words.ok
'
),
closeTimeout
:
5000
,
destroyonClose
:
true
,
},
dialog
:
{
buttonOk
:
this
.
$t
(
'
words.ok
'
),
buttonCancel
:
this
.
$t
(
'
words.cancel
'
),
},
photoBrowser
:
{
routableModals
:
false
,
type
:
'
popup
'
,
pageBackLinkText
:
this
.
$t
(
'
words.back
'
),
popupCloseLinkText
:
this
.
$t
(
'
words.ok
'
),
navbarOfText
:
this
.
$t
(
'
words.of
'
),
},
lazy
:
{
sequential
:
false
,
},
touch
:
{
tapHold
:
true
,
},
},
};
},
mounted
()
{
this
.
$f7ready
((
f7
)
=>
{
if
(
Device
.
cordova
)
{
cordovaApp
.
init
(
f7
);
}
mounted
()
{
this
.
$f7ready
((
f7
)
=>
{
if
(
Device
.
cordova
)
{
cordovaApp
.
init
(
f7
);
}
this
.
$store
.
dispatch
(
'
load
'
,
{
server
:
this
.
$f7
.
data
.
server
,
sourceAge
:
this
.
$store
.
state
.
settings
.
sourceAge
,
warningCallback
:
(
error
,
payload
=
{})
=>
this
.
$f7
.
dialog
.
alert
(
this
.
$t
(
error
,
payload
)),
});
this
.
$store
.
dispatch
(
'
load
'
,
{
server
:
this
.
$f7
.
data
.
server
,
sourceAge
:
this
.
$store
.
state
.
settings
.
sourceAge
,
warningCallback
:
(
error
,
payload
=
{})
=>
this
.
$f7
.
dialog
.
alert
(
this
.
$t
(
error
,
payload
)),
});
},
};
});
},
};
</
script
>
src/components/popovers/antifeatures.vue
View file @
316bc7b2
<
template
>
<div
class=
"popover-antifeatures"
>
<f7-popover
:class=
"`popover-antifeatures-$
{key}`"
v-for="(antiFeature, key) in $t('lists.antiFeatures')" :key="key">
<f7-popover
v-for=
"(antiFeature, key) in $t('lists.antiFeatures')"
:key=
"key"
:class=
"`popover-antifeatures-$
{key}`"
>
<f7-block><p>
{{
antiFeature
.
description
}}
</p></f7-block>
<f7-list>
<f7-list-item
:footer=
"antiFeature.key"
:link=
"`https://f-droid.org/docs/Anti-Features/#$
{key}`" :title="$t('words.more')" external popover-close target="_system">
<f7-icon
aurora=
"f7:link"
ios=
"f7:link"
md=
"material:link"
slot=
"media"
></f7-icon>
<f7-icon
slot=
"media"
aurora=
"f7:link"
ios=
"f7:link"
md=
"material:link"
></f7-icon>
</f7-list-item>
</f7-list>
</f7-popover>
...
...
src/components/popups/downloadapp.vue
View file @
316bc7b2
...
...
@@ -14,7 +14,7 @@
<div
class=
"timeline-item-inner"
>
<div
class=
"timeline-item-title"
>
{{
$t
(
'
words.download
'
)
}}
</div>
<div
class=
"timeline-item-text"
>
{{
$t
(
'
popups.downloadApp.steps.download.description
'
)
}}
</div>
<f7-button
href=
"https://ablota.com/repo/Ablota_Store.apk"
:text=
"$t('words.download')"
fill
raised
external
></f7-button>
<f7-button
:text=
"$t('words.download')"
external
fill
href=
"https://ablota.com/repo/Ablota_Store.apk"
raised
></f7-button>
</div>
</div>
</div>
...
...
@@ -45,7 +45,7 @@
<div
class=
"timeline-item-inner"
>
<div
class=
"timeline-item-title"
>
{{
$t
(
'
words.done
'
)
}}
</div>
<div
class=
"timeline-item-text"
>
{{
$t
(
'
popups.downloadApp.steps.done.description
'
)
}}
</div>
<f7-button
href=
"https://store.ablota.com"
:text=
"$t('words.launch')"
fill
raised
external
></f7-button>
<f7-button
:text=
"$t('words.launch')"
external
fill
href=
"https://store.ablota.com"
raised
></f7-button>
</div>
</div>
</div>
...
...
src/css/app.scss
View file @
316bc7b2
...
...
@@ -2,8 +2,9 @@ $icon-sizes: 20, 30, 40, 50, 60;
/* iOS Cordova Tweak */
.device-cordova.device-ios
{
height
:
100vh
;
height
:
100vh
;
}
/* Your app custom styles here */
body
{
...
...
@@ -80,6 +81,7 @@ body {
.item-inner
{
padding
:
0
;
}
.item-subtitle
p
{
margin-top
:
0
;
}
...
...
src/css/icons.css
View file @
316bc7b2
/* Material Icons Font (for MD theme) */
@font-face
{
font-family
:
'Material Icons'
;
font-style
:
normal
;
font-weight
:
400
;
src
:
url(../fonts/MaterialIcons-Regular.eot)
;
src
:
local
(
'Material Icons'
),
local
(
'MaterialIcons-Regular'
),
url(../fonts/MaterialIcons-Regular.woff2)
format
(
'woff2'
),
url(../fonts/MaterialIcons-Regular.woff)
format
(
'woff'
),
url(../fonts/MaterialIcons-Regular.ttf)
format
(
'truetype'
);
font-family
:
'Material Icons'
;
font-style
:
normal
;
font-weight
:
400
;
src
:
url(../fonts/MaterialIcons-Regular.eot)
;
src
:
local
(
'Material Icons'
),
local
(
'MaterialIcons-Regular'
),
url(../fonts/MaterialIcons-Regular.woff2)
format
(
'woff2'
),
url(../fonts/MaterialIcons-Regular.woff)
format
(
'woff'
),
url(../fonts/MaterialIcons-Regular.ttf)
format
(
'truetype'
);
}
.material-icons
{
font-family
:
'Material Icons'
;
font-weight
:
normal
;
font-style
:
normal
;
font-size
:
24px
;
display
:
inline-block
;
line-height
:
1
;
text-transform
:
none
;
letter-spacing
:
normal
;
word-wrap
:
normal
;
white-space
:
nowrap
;
direction
:
ltr
;
-webkit-font-smoothing
:
antialiased
;
text-rendering
:
optimizeLegibility
;
-moz-osx-font-smoothing
:
grayscale
;
font-feature-settings
:
'liga'
;
font-family
:
'Material Icons'
;
font-weight
:
normal
;
font-style
:
normal
;
font-size
:
24px
;
display
:
inline-block
;
line-height
:
1
;
text-transform
:
none
;
letter-spacing
:
normal
;
word-wrap
:
normal
;
white-space
:
nowrap
;
direction
:
ltr
;
-webkit-font-smoothing
:
antialiased
;
text-rendering
:
optimizeLegibility
;
-moz-osx-font-smoothing
:
grayscale
;
font-feature-settings
:
'liga'
;
}
/* Framework7 Icons Font (for iOS theme) */
@font-face
{
font-family
:
'Framework7 Icons'
;
font-style
:
normal
;
font-weight
:
400
;
src
:
url("../fonts/Framework7Icons-Regular.eot")
;
src
:
url("../fonts/Framework7Icons-Regular.woff2")
format
(
"woff2"
),
url("../fonts/Framework7Icons-Regular.woff")
format
(
"woff"
),
url("../fonts/Framework7Icons-Regular.ttf")
format
(
"truetype"
);
font-family
:
'Framework7 Icons'
;
font-style
:
normal
;
font-weight
:
400
;
src
:
url("../fonts/Framework7Icons-Regular.eot")
;
src
:
url("../fonts/Framework7Icons-Regular.woff2")
format
(
"woff2"
),
url("../fonts/Framework7Icons-Regular.woff")
format
(
"woff"
),
url("../fonts/Framework7Icons-Regular.ttf")
format
(
"truetype"
);
}
.f7-icons
{
font-family
:
'Framework7 Icons'
;
font-weight
:
normal
;
font-style
:
normal
;
font-size
:
28px
;
line-height
:
1
;
letter-spacing
:
normal
;
text-transform
:
none
;
display
:
inline-block
;
white-space
:
nowrap
;
word-wrap
:
normal
;
direction
:
ltr
;
-webkit-font-smoothing
:
antialiased
;
text-rendering
:
optimizeLegibility
;
-moz-osx-font-smoothing
:
grayscale
;
-webkit-font-feature-settings
:
"liga"
;
-moz-font-feature-settings
:
"liga=1"
;
-moz-font-feature-settings
:
"liga"
;
font-feature-settings
:
"liga"
;
text-align
:
center
;
font-family
:
'Framework7 Icons'
;
font-weight
:
normal
;
font-style
:
normal
;
font-size
:
28px
;
line-height
:
1
;
letter-spacing
:
normal
;
text-transform
:
none
;
display
:
inline-block
;
white-space
:
nowrap
;
word-wrap
:
normal
;
direction
:
ltr
;
-webkit-font-smoothing
:
antialiased
;
text-rendering
:
optimizeLegibility
;
-moz-osx-font-smoothing
:
grayscale
;
-webkit-font-feature-settings
:
"liga"
;
-moz-font-feature-settings
:
"liga=1"
;
-moz-font-feature-settings
:
"liga"
;
font-feature-settings
:
"liga"
;
text-align
:
center
;
}
src/i18n/de.js
View file @
316bc7b2
...
...
@@ -9,4 +9,4 @@ export default {
],
},
},
}
}
;
src/i18n/en.js
View file @
316bc7b2
...
...
@@ -343,7 +343,7 @@ export default {
},
done
:
{
description
:
'
@:app.name is ready! You can now launch @:app.name and start downloading apps.
'
,
}
}
,
},
},
},
...
...
src/index.html
View file @
316bc7b2
...
...
@@ -3,43 +3,45 @@
<head>
<meta
charset=
"utf-8"
>
<
%
if
(process.env.NODE_ENV =
==
'
production
')
{
%
>
<meta
http-equiv=
"Content-Security-Policy"
content=
"default-src 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content: https://api.store.ablota.com"
>
<meta
content=
"default-src 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content: https://api.store.ablota.com"
http-equiv=
"Content-Security-Policy"
>
<
%
}
%
>
<meta
http-equiv=
"x-ua-compatible"
content=
"ie=edge"
>
<meta
property=
"og:image:width"
content=
"128"
>
<meta
property=
"og:image:height"
content=
"128"
>
<meta
property=
"og:description"
content=
"The universal, decentralized and open source app store."
>
<meta
property=
"og:title"
content=
"Ablota Store"
>
<meta
property=
"og:url"
content=
"https://store.ablota.com"
>
<meta
property=
"og:image"
content=
"https://store.ablota.com/static/icons/favicon.png"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover"
>
<meta
name=
"robots"
content=
"noarchive, notranslate, noimageindex"
>
<meta
name=
"theme-color"
content=
"#007aff"
>
<meta
name=
"format-detection"
content=
"telephone=no"
>
<meta
name=
"format-detection"
content=
"date=no"
>
<meta
name=
"format-detection"
content=
"address=no"
>
<meta
name=
"msapplication-TileColor"
content=
"#007aff"
>
<meta
name=
"msapplication-tap-highlight"
content=
"no"
>
<meta
name=
"author"
content=
"Ablota (StarApps GmbH)"
>
<meta
name=
"description"
content=
"The universal, decentralized and open source app store."
>
<meta
name=
"keywords"
content=
"ablota store, ablota, store, app, apps, game, game, app store, universal, open source, decentralized, foss, floss, android, ios, web, electron, desktop, starapps, starapps ltd, starapps gmbh"
>
<meta
content=
"ie=edge"
http-equiv=
"x-ua-compatible"
>
<meta
content=
"128"
property=
"og:image:width"
>
<meta
content=
"128"
property=
"og:image:height"
>
<meta
content=
"The universal, decentralized and open source app store."
property=
"og:description"
>
<meta
content=
"Ablota Store"
property=
"og:title"
>
<meta
content=
"https://store.ablota.com"
property=
"og:url"
>
<meta
content=
"https://store.ablota.com/static/icons/favicon.png"
property=
"og:image"
>
<meta
content=
"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover"
name=
"viewport"
>
<meta
content=
"noarchive, notranslate, noimageindex"
name=
"robots"
>
<meta
content=
"#007aff"
name=
"theme-color"
>
<meta
content=
"telephone=no"
name=
"format-detection"
>
<meta
content=
"date=no"
name=
"format-detection"
>
<meta
content=
"address=no"
name=
"format-detection"
>
<meta
content=
"#007aff"
name=
"msapplication-TileColor"
>
<meta
content=
"no"
name=
"msapplication-tap-highlight"
>
<meta
content=
"Ablota (StarApps GmbH)"
name=
"author"
>
<meta
content=
"The universal, decentralized and open source app store."
name=
"description"
>
<meta
content=
"ablota store, ablota, store, app, apps, game, game, app store, universal, open source, decentralized, foss, floss, android, ios, web, electron, desktop, starapps, starapps ltd, starapps gmbh"
name=
"keywords"
>
<title>
Ablota Store
</title>
<
%
if
(process.env.TARGET =
==
'
web
')
{
%
>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black-translucent"
>
<meta
content=
"yes"
name=
"apple-mobile-web-app-capable"
>
<meta
content=
"black-translucent"
name=
"apple-mobile-web-app-status-bar-style"
>
<
%
for
(
var
index
in
htmlWebpackPlugin.files.css
)
{
%
>
<link
rel=
"preload"
href=
"<%= htmlWebpackPlugin.files.css[index] %>"
as=
"style"
>
<
%
}
%
>
<
%
for
(
var
index
in
htmlWebpackPlugin.files.js
)
{
%
>
<link
rel=
"preload"
href=
"<%= htmlWebpackPlugin.files.js[index] %>"
as=
"script"
>
<link
as=
"style"
href=
"<%= htmlWebpackPlugin.files.css[index] %>"
rel=
"preload"
>
<
%
}
%
>
<
%
for
(
var
index
in
htmlWebpackPlugin.files.js
)
{
%
>
<link
as=
"script"
href=
"<%= htmlWebpackPlugin.files.js[index] %>"
rel=
"preload"
>
<
%
}
%
>
<link
rel=
"apple-touch-icon"
sizes=
"256x256"
href=
"/static/icons/apple-touch-icon.png"
>
<link
re
l
=
"
icon"
type=
"image/png"
sizes=
"128x128"
href=
"/static/icons/favicon.
png"
>
<link
rel=
"manifest"
href=
"/manifest.json"
>
<link
href=
"/static/icons/apple-touch-icon.png"
rel=
"apple-touch-icon"
sizes=
"256x256"
>
<link
h
re
f
=
"
/static/icons/favicon.png"
rel=
"icon"
sizes=
"128x128"
type=
"image/
png"
>
<link
href=
"/manifest.json"
rel=
"manifest"
>
<
%
}
%
>
</head>
<body>
...
...
src/js/utils.js
View file @
316bc7b2
import
{
Request
,
Device
}
from
'
framework7
'
;
import
{
Device
,
Request
}
from
'
framework7
'
;
import
sanitizeHtml
from
'
sanitize-html
'
;
import
sourceValidator
from
'
../validators/source
'
;
...
...
@@ -38,7 +38,13 @@ export function fetchSource(url, server, age = 6) {
}
});
[
'
phoneScreenshots
'
,
'
sevenInchScreenshots
'
,
'
tenInchScreenshots
'
,
'
tvScreenshots
'
,
'
wearScreenshots
'
].
forEach
(
assets
=>
app
.
localized
[
key
][
assets
].
forEach
((
asset
,
index
)
=>
{
[
'
phoneScreenshots
'
,
'
sevenInchScreenshots
'
,
'
tenInchScreenshots
'
,
'
tvScreenshots
'
,
'
wearScreenshots
'
,
].
forEach
(
assets
=>
app
.
localized
[
key
][
assets
].
forEach
((
asset
,
index
)
=>
{
app
.
localized
[
key
][
assets
][
index
]
=
`
${
url
}${
app
.
packageName
}
/
${
key
}
/
${
assets
}
/
${
asset
}
`
;
}));
});
...
...
@@ -60,8 +66,8 @@ export function fetchSource(url, server, age = 6) {
};
if
(
Device
.
cordova
)
{
window
.
resolveLocalFileSystemURL
(
cordova
.
file
.
dataDirectory
,
dataDirectory
=>
{
dataDirectory
.
getDirectory
(
'
sources
'
,
{
create
:
true
,
exclusive
:
false
},
dataSourcesDirectory
=>
{
window
.
resolveLocalFileSystemURL
(
cordova
.
file
.
dataDirectory
,
dataDirectory
=>
{
dataDirectory
.
getDirectory
(
'
sources
'
,
{
create
:
true
,
exclusive
:
false
},
dataSourcesDirectory
=>
{
ablota
.
store
.
file
.
hashName
(
url
,
data
=>
{
const
fetchIndex
=
()
=>
{
ablota
.
store
.
file
.
download
(
`
${
url
}
index-v1.jar`
,
`
${
cordova
.
file
.
dataDirectory
}
sources/
${
data
.
hash
}
.jar`
,
{},
{},
data
=>
{
...
...
@@ -79,7 +85,7 @@ export function fetchSource(url, server, age = 6) {
},
()
=>
reject
(
'
request
'
));
};
dataSourcesDirectory
.
getFile
(
`
${
data
.
hash
}
.jar`
,
{
create
:
false
},
sourceFile
=>
{
dataSourcesDirectory
.
getFile
(
`
${
data
.
hash
}
.jar`
,
{
create
:
false
},
sourceFile
=>
{
sourceFile
.
file
(
file
=>
{
if
(
file
.
lastModified
<
new
Date
().
getTime
()
-
age
*
60
*
60
*
1000
)
{
fetchIndex
();
...
...
@@ -130,8 +136,8 @@ export function fetchAsset(url, server, age = 24) {
};
window
.
resolveLocalFileSystemURL
(
cordova
.
file
.
cacheDirectory
,
cacheDirectory
=>
{
cacheDirectory
.
getDirectory
(
'
assets
'
,
{
create
:
true
,
exclusive
:
false
},
cacheAssetsDirectory
=>
{
cacheAssetsDirectory
.
getFile
(
data
.
hash
,
{
create
:
false
},
assetFile
=>
{
cacheDirectory
.
getDirectory
(
'
assets
'
,
{
create
:
true
,
exclusive
:
false
},
cacheAssetsDirectory
=>
{
cacheAssetsDirectory
.
getFile
(
data
.
hash
,
{
create
:
false
},
assetFile
=>
{
assetFile
.
file
(
file
=>
{
if
(
file
.
lastModified
<
new
Date
().
getTime
()
-
age
*
60
*
60
*
1000
)
{
downloadAsset
();
...
...
@@ -154,7 +160,7 @@ export function fetchAsset(url, server, age = 24) {
}
else
{
resolve
({
originalUrl
:
url
,
localUrl
:
`
${
server
.
url
}
v1/proxy/asset?url=
${
url
}
`
localUrl
:
`
${
server
.
url
}
v1/proxy/asset?url=
${
url
}
`
,
});
}
});
...
...
@@ -323,7 +329,7 @@ export function downloadPackage(app, appPackage, updateCallback) {
};
window
.
resolveLocalFileSystemURL
(
cordova
.
file
.
cacheDirectory
,
cacheDirectory
=>
{
cacheDirectory
.
getDirectory
(
'
packages
'
,
{
create
:
true
,
exclusive
:
false
},
packagesDirectory
=>
{
cacheDirectory
.
getDirectory
(
'
packages
'
,
{
create
:
true
,
exclusive
:
false
},
packagesDirectory
=>
{
ablota
.
store
.
file
.
download
(
appPackage
.
apkName
,
packageFilePath
,
{},
{},
data
=>
{
if
(
data
.
status
===
'
success
'
)
{
ablota
.
store
.
file
.
hash
(
packageFilePath
,
data
=>
{
...
...
@@ -331,7 +337,7 @@ export function downloadPackage(app, appPackage, updateCallback) {
if
(
data
.
hash
.
toLowerCase
()
===
appPackage
.
hash
)
{
finish
(
'
package
'
);
}
else
{
packagesDirectory
.
getFile
(
packageFilePath
,
{
create
:
false
},
packageFileEntry
=>
{
packagesDirectory
.
getFile
(
packageFilePath
,
{
create
:
false
},
packageFileEntry
=>
{
packageFileEntry
.
remove
();
});
...
...
@@ -360,9 +366,9 @@ export function downloadPackage(app, appPackage, updateCallback) {
if
(
appPackage
[
obbFile
]
&&
appPackage
[
`
${
obbFile
}
Sha256`
])
{
window
.
resolveLocalFileSystemURL
(
cordova
.
file
.
externalRootDirectory
,
externalRootDirectory
=>
{
externalRootDirectory
.
getDirectory
(
'
Android
'
,
{
create
:
true
,
exclusive
:
false
},
androidDirectory
=>
{
androidDirectory
.
getDirectory
(
'
obb
'
,
{
create
:
true
,
exclusive
:
false
},
obbDirectory
=>
{
obbDirectory
.
getDirectory
(
appPackage
.
packageName
,
{
create
:
true
,
exclusive
:
false
},
appPackageDirectory
=>
{
externalRootDirectory
.
getDirectory
(
'
Android
'
,
{
create
:
true
,
exclusive
:
false
},
androidDirectory
=>
{
androidDirectory
.
getDirectory
(
'
obb
'
,
{
create
:
true
,
exclusive
:
false
},
obbDirectory
=>
{
obbDirectory
.
getDirectory
(
appPackage
.
packageName
,
{
create
:
true
,
exclusive
:
false
},
appPackageDirectory
=>
{
const
obbFilename
=
appPackage
[
obbFile
].
substring
(
appPackage
[
obbFile
].
lastIndexOf
(
'
/
'
)
+
1
);
const
obbFilePath
=
`
${
cordova
.
file
.
externalCacheDirectory
}
/
${
obbFilename
}
`
;
const
downloadObbFile
=
()
=>
{
...
...
@@ -374,14 +380,14 @@ export function downloadPackage(app, appPackage, updateCallback) {
if
(
data
.
status
===
'
success
'
)
{
if
(
data
.
hash
.
toLowerCase
()
===
appPackage
[
`
${
obbFile
}
Sha256`
])
{
window
.
resolveLocalFileSystemURL
(
cordova
.
file
.
externalCacheDirectory
,
externalCacheDirectory
=>
{
externalCacheDirectory
.
getFile
(
obbFilename
,
{
create
:
false
},
obbFileEntry
=>
{
externalCacheDirectory
.
getFile
(
obbFilename
,
{
create
:
false
},
obbFileEntry
=>
{
obbFileEntry
.
moveTo
(
appPackageDirectory
,
obbFilename
,
()
=>
{
finish
(
obbName
);
},
()
=>
reject
(
'
utils.downloadPackage.directory
'
));
},
()
=>
reject
(
'
utils.downloadPackage.directory
'
));
},
()
=>
reject
(
'
utils.downloadPackage.directory
'
));
}
else
{
appPackageDirectory
.
getFile
(
obbFilename
,
{
create
:
false
},
obbFileEntry
=>
{
appPackageDirectory
.
getFile
(
obbFilename
,
{
create
:
false
},
obbFileEntry
=>
{
obbFileEntry
.
remove
();
});
...
...
@@ -403,7 +409,7 @@ export function downloadPackage(app, appPackage, updateCallback) {
};
finished
[
obbName
]
=
false
;
appPackageDirectory
.
getFile
(
obbFilename
,
{
create
:
false
},
()
=>
{
appPackageDirectory
.
getFile
(
obbFilename
,
{
create
:
false
},
()
=>
{
ablota
.
store
.
file
.
hash
(
`
${
cordova
.
file
.
externalRootDirectory
}
Android/obb/
${
appPackage
.
packageName
}
/
${
obbFilename
}
`
,
data
=>
{
if
(
data
.
status
===
'
success
'
)
{
if
(
data
.
hash
.
toLowerCase
()
===
appPackage
[
`
${
obbFile
}
Sha256`
])
{
...
...
src/manifest.json
View file @
316bc7b2
{
"name"
:
"Ablota Store"
,
"short_name"
:
"Ablota Store"
,
"description"
:
"The universal, decentralized and open source app store."
,
"lang"
:
"en-US"
,
"start_url"
:
"/"
,
"display"
:
"standalone"
,
"background_color"
:
"#ffffff"
,
"theme_color"
:
"#007aff"
,
"icons"
:
[
{
"src"
:
"/static/icons/128x128.png"
,
"sizes"
:
"128x128"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/144x144.png"
,
"sizes"
:
"144x144"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/152x152.png"
,
"sizes"
:
"152x152"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/192x192.png"
,
"sizes"
:
"192x192"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/256x256.png"
,
"sizes"
:
"256x256"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/512x512.png"
,
"sizes"
:
"512x512"
,
"type"
:
"image/png"
}
]
"name"
:
"Ablota Store"
,
"short_name"
:
"Ablota Store"
,
"description"
:
"The universal, decentralized and open source app store."
,
"lang"
:
"en-US"
,
"start_url"
:
"/"
,
"display"
:
"standalone"
,
"background_color"
:
"#ffffff"
,
"theme_color"
:
"#007aff"
,
"icons"
:
[
{
"src"
:
"/static/icons/128x128.png"
,
"sizes"
:
"128x128"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/144x144.png"
,
"sizes"
:
"144x144"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/152x152.png"
,
"sizes"
:
"152x152"
,
"type"
:
"image/png"
},
{
"src"
:
"/static/icons/192x192.png"
,
"sizes"
:
"192x192"
,
"type"
:
"image/png"
},
{