@@ -10,6 +10,7 @@ def __init__(
1010short_description = "" ,
1111long_description = "" ,
1212icon_url = "" ,
13+ icon_path = "builtin/res/mipmap-mdpi/default_icon_64x64.png" ,
1314download_url = "" ,
1415fullname = "Unknown" ,
1516version = "0.0.0" ,
@@ -32,16 +33,25 @@ def __init__(
3233self .image = None
3334self .image_dsc = None
3435self .icon_path = self ._find_icon_path ()
36+ if self .icon_path :
37+ self .icon_data = self ._load_icon_data (self .icon_path )
3538self .main_launcher_activity = self ._find_main_launcher_activity ()
3639
3740def __str__ (self ):
38- return f"App({ self .name } , v{ self .version } ,{ self .category } )"
41+ return f"App({ self .name } , version{ self .version } ,{ self .category } )"
42+
43+ def _load_icon_data (self ,icon_path ):
44+ try :
45+ f = open (icon_path ,'rb' )
46+ return f .read ()
47+ except Exception as e :
48+ print (f"open{ icon_path } got error:{ e } " )
3949
4050def _check_icon_path (self ,tocheck ):
4151try :
4252#print(f"checking {tocheck}")
4353st = os .stat (tocheck )
44- # print(f"_find_icon_pathgot {st}")
54+ print (f"_find_icon_pathfor { tocheck } found { st } " )
4555return tocheck
4656except Exception as e :
4757#print(f"No app icon found: {e}")