@@ -11,7 +11,7 @@ import {
1111 SourceImage ,
1212 sourceImages ,
1313} from "../helpers" ;
14- import { Platform , uniformIconOptions } from "./base" ;
14+ import { OptionalMixin , Platform , uniformIconOptions } from "./base" ;
1515
1616interface Icon {
1717 readonly src : string ;
@@ -27,7 +27,7 @@ interface Shortcut {
2727 readonly icons ?: Icon [ ] ;
2828}
2929
30- const ICONS_OPTIONS : NamedIconOptions [ ] = [
30+ const ICONS_OPTIONS : ( NamedIconOptions & OptionalMixin ) [ ] = [
3131 { name : "android-chrome-36x36.png" , ...transparentIcon ( 36 ) } ,
3232 { name : "android-chrome-48x48.png" , ...transparentIcon ( 48 ) } ,
3333 { name : "android-chrome-72x72.png" , ...transparentIcon ( 72 ) } ,
@@ -37,6 +37,7 @@ const ICONS_OPTIONS: NamedIconOptions[] = [
3737 { name : "android-chrome-256x256.png" , ...transparentIcon ( 256 ) } ,
3838 { name : "android-chrome-384x384.png" , ...transparentIcon ( 384 ) } ,
3939 { name : "android-chrome-512x512.png" , ...transparentIcon ( 512 ) } ,
40+ { name : "android-chrome.svg" , ...transparentIcon ( 1024 ) , optional : true } ,
4041] ;
4142
4243const ICONS_OPTIONS_MASKABLE : NamedIconOptions [ ] = [
@@ -243,14 +244,16 @@ export class AndroidPlatform extends Platform {
243244 options . manifestMaskable === true ? "any maskable" : "any" ;
244245
245246 properties . icons = icons . map ( ( iconOptions ) => {
246- const { width, height } = iconOptions . sizes [ 0 ] ;
247+ const src = this . cacheBusting ( relativeTo ( basePath , iconOptions . name ) ) ;
248+ const purpose = iconOptions . purpose ?? defaultPurpose ;
247249
248- return {
249- src : this . cacheBusting ( relativeTo ( basePath , iconOptions . name ) ) ,
250- sizes : `${ width } x${ height } ` ,
251- type : "image/png" ,
252- purpose : iconOptions . purpose ?? defaultPurpose ,
253- } ;
250+ if ( iconOptions . name . endsWith ( ".svg" ) ) {
251+ return { src, sizes : "any" , type : "image/svg+xml" , purpose } ;
252+ } else {
253+ // png
254+ const { width, height } = iconOptions . sizes [ 0 ] ;
255+ return { src, sizes : `${ width } x${ height } ` , type : "image/png" , purpose } ;
256+ }
254257 } ) ;
255258
256259 if ( Array . isArray ( options . shortcuts ) && options . shortcuts . length > 0 ) {
0 commit comments