#191 Nekogram X app folder
This commit is contained in:
parent
aad3fce030
commit
365ddc0f92
1 changed files with 12 additions and 8 deletions
|
@ -34,20 +34,24 @@ abstract class AndroidAppService {
|
||||||
class PlatformAndroidAppService implements AndroidAppService {
|
class PlatformAndroidAppService implements AndroidAppService {
|
||||||
static const platform = MethodChannel('deckers.thibault/aves/app');
|
static const platform = MethodChannel('deckers.thibault/aves/app');
|
||||||
|
|
||||||
|
static final knownAppDirs = {
|
||||||
|
'com.kakao.talk': {'KakaoTalkDownload'},
|
||||||
|
'com.sony.playmemories.mobile': {'Imaging Edge Mobile'},
|
||||||
|
'nekox.messenger': {'NekoX'},
|
||||||
|
};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Set<Package>> getPackages() async {
|
Future<Set<Package>> getPackages() async {
|
||||||
try {
|
try {
|
||||||
final result = await platform.invokeMethod('getPackages');
|
final result = await platform.invokeMethod('getPackages');
|
||||||
final packages = (result as List).cast<Map>().map(Package.fromMap).toSet();
|
final packages = (result as List).cast<Map>().map(Package.fromMap).toSet();
|
||||||
// additional info for known directories
|
// additional info for known directories
|
||||||
final kakaoTalk = packages.firstWhereOrNull((package) => package.packageName == 'com.kakao.talk');
|
knownAppDirs.forEach((packageName, dirs) {
|
||||||
if (kakaoTalk != null) {
|
final package = packages.firstWhereOrNull((package) => package.packageName == packageName);
|
||||||
kakaoTalk.ownedDirs.add('KakaoTalkDownload');
|
if (package != null) {
|
||||||
}
|
package.ownedDirs.addAll(dirs);
|
||||||
final imagingEdge = packages.firstWhereOrNull((package) => package.packageName == 'com.sony.playmemories.mobile');
|
}
|
||||||
if (imagingEdge != null) {
|
});
|
||||||
imagingEdge.ownedDirs.add('Imaging Edge Mobile');
|
|
||||||
}
|
|
||||||
return packages;
|
return packages;
|
||||||
} on PlatformException catch (e, stack) {
|
} on PlatformException catch (e, stack) {
|
||||||
await reportService.recordError(e, stack);
|
await reportService.recordError(e, stack);
|
||||||
|
|
Loading…
Reference in a new issue