Skip to content

Commit 7328a69

Browse files
committed
Add icon-bg and icon-fg to fix_args
Fix the icon-bg and icon-fg arguments and also create the folder mipmap-anydpi-v26 if it doesn't exists before trying to create a file inside. https://phabricator.endlessm.com/T33593
1 parent b672ec4 commit 7328a69

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ def make_package(args):
349349
if args.icon_fg and args.icon_bg:
350350
shutil.copy(args.icon_fg, join(res_dir, 'mipmap/icon_foreground.png'))
351351
shutil.copy(args.icon_bg, join(res_dir, 'mipmap/icon_background.png'))
352-
with open(join(res_dir, 'mipmap-anydpi-v26/icon.xml'), "w") as fd:
352+
mipmap_anydpi = join(res_dir, 'mipmap-anydpi-v26')
353+
if not exists(mipmap_anydpi):
354+
os.mkdir(mipmap_anydpi)
355+
with open(join(mipmap_anydpi, 'icon.xml'), "w") as fd:
353356
fd.write("""<?xml version="1.0" encoding="utf-8"?>
354357
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
355358
<background android:drawable="@mipmap/icon_background"/>

pythonforandroid/toolchain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ def _fix_args(args):
988988

989989
fix_args = ('--dir', '--private', '--add-jar', '--add-source',
990990
'--whitelist', '--blacklist', '--presplash', '--icon',
991-
'--fileprovider-paths')
991+
'--icon-bg', '--icon-fg', '--fileprovider-paths')
992992
unknown_args = args.unknown_args
993993

994994
for asset in args.assets:

0 commit comments

Comments
 (0)