@@ -99,11 +99,11 @@ public static Win32AppInfo Get()
99
99
if ( IsAlphaBitmap ( bmp , out var bmpData ) )
100
100
{
101
101
var alphaBitmap = GetAlphaBitmapFromBitmapData ( bmpData ) ;
102
- iconPath = SaveIconToAppPath ( alphaBitmap , appId ) ;
102
+ iconPath = SaveIconToAppPath ( alphaBitmap , aumid ) ;
103
103
}
104
104
else
105
105
{
106
- iconPath = SaveIconToAppPath ( bmp , appId ) ;
106
+ iconPath = SaveIconToAppPath ( bmp , aumid ) ;
107
107
}
108
108
}
109
109
catch
@@ -129,7 +129,7 @@ public static Win32AppInfo Get()
129
129
if ( string . IsNullOrWhiteSpace ( iconPath ) )
130
130
{
131
131
// We use the one from the process
132
- iconPath = ExtractAndObtainIconFromCurrentProcess ( process , appId ) ;
132
+ iconPath = ExtractAndObtainIconFromCurrentProcess ( process , aumid ) ;
133
133
}
134
134
135
135
return new Win32AppInfo ( )
@@ -163,12 +163,12 @@ private static string GetDisplayNameFromCurrentProcess(Process process)
163
163
return process . ProcessName ;
164
164
}
165
165
166
- private static string ExtractAndObtainIconFromCurrentProcess ( Process process , string appId )
166
+ private static string ExtractAndObtainIconFromCurrentProcess ( Process process , string aumid )
167
167
{
168
- return ExtractAndObtainIconFromPath ( process . MainModule . FileName , appId ) ;
168
+ return ExtractAndObtainIconFromPath ( process . MainModule . FileName , aumid ) ;
169
169
}
170
170
171
- private static string ExtractAndObtainIconFromPath ( string pathToExtract , string appId )
171
+ private static string ExtractAndObtainIconFromPath ( string pathToExtract , string aumid )
172
172
{
173
173
try
174
174
{
@@ -177,7 +177,7 @@ private static string ExtractAndObtainIconFromPath(string pathToExtract, string
177
177
178
178
using ( var bmp = icon . ToBitmap ( ) )
179
179
{
180
- return SaveIconToAppPath ( bmp , appId ) ;
180
+ return SaveIconToAppPath ( bmp , aumid ) ;
181
181
}
182
182
}
183
183
catch
@@ -186,11 +186,11 @@ private static string ExtractAndObtainIconFromPath(string pathToExtract, string
186
186
}
187
187
}
188
188
189
- private static string SaveIconToAppPath ( Bitmap bitmap , string appId )
189
+ private static string SaveIconToAppPath ( Bitmap bitmap , string aumid )
190
190
{
191
191
try
192
192
{
193
- var path = Path . Combine ( GetAppDataFolderPath ( appId ) , "Icon.png" ) ;
193
+ var path = Path . Combine ( GetAppDataFolderPath ( aumid ) , "Icon.png" ) ;
194
194
195
195
// Ensure the directories exist
196
196
Directory . CreateDirectory ( Path . GetDirectoryName ( path ) ) ;
@@ -209,9 +209,9 @@ private static string SaveIconToAppPath(Bitmap bitmap, string appId)
209
209
/// Gets the app data folder path within the ToastNotificationManagerCompat folder, used for storing icon assets and any additional data.
210
210
/// </summary>
211
211
/// <returns>Returns a string of the absolute folder path.</returns>
212
- public static string GetAppDataFolderPath ( string appId )
212
+ public static string GetAppDataFolderPath ( string aumid )
213
213
{
214
- string conciseAumid = appId . Contains ( " \\ " ) ? GenerateGuid ( appId ) : appId ;
214
+ string conciseAumid = aumid . Contains ( ' \\ ' ) || aumid . Contains ( '/' ) ? GenerateGuid ( aumid ) : aumid ;
215
215
216
216
return Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "ToastNotificationManagerCompat" , "Apps" , conciseAumid ) ;
217
217
}
0 commit comments