-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc1064b
commit b3a8bd3
Showing
13 changed files
with
149 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,61 @@ | ||
import 'package:yuno/app/interactor/models/embeds/player.dart'; | ||
|
||
import '../models/embeds/game.dart'; | ||
import 'platform_action.dart'; | ||
|
||
typedef IntentFunction = PlayerIntent Function(Player, Game); | ||
|
||
PlayerIntent? getAppIntent(Game game, Player player) { | ||
return _defaultAppIntent[player.app.package]?.parse(player, game); | ||
return _defaultAppIntent[player.app.package]?.call(player, game); | ||
} | ||
|
||
final _defaultAppIntent = <String, PlayerIntent>{ | ||
'xyz.aethersx2.android': PlayerIntent( | ||
action: 'android.intent.action.VIEW', | ||
package: 'xyz.aethersx2.android', | ||
componentName: 'xyz.aethersx2.android.EmulationActivity', | ||
arguments: { | ||
'bootPath': r'${fileGame}', | ||
}, | ||
), | ||
'com.retroarch.aarch64': PlayerIntent( | ||
action: 'android.intent.action.MAIN', | ||
package: 'com.retroarch.aarch64', | ||
componentName: 'com.retroarch.browser.retroactivity.RetroActivityFuture', | ||
arguments: { | ||
'ROM': r'${fileGame}', | ||
'LIBRETRO': | ||
r'/data/data/com.retroarch.aarch64/cores/${extra}_libretro_android.so', | ||
}, | ||
), | ||
'com.yuzu.android': PlayerIntent( | ||
action: 'android.nfc.action.TECH_DISCOVERED', | ||
package: 'com.yuzu.android', | ||
componentName: 'com.yuzu.android.EmulationActivity', | ||
data: r'${fileGame}', | ||
), | ||
'org.yuzu.yuzu_emu_ea': PlayerIntent( | ||
action: 'android.nfc.action.TECH_DISCOVERED', | ||
package: 'org.yuzu.yuzu_emu_ea', | ||
componentName: 'com.yuzu.android.EmulationActivity', | ||
data: r'${fileGame}', | ||
), | ||
'switch.skyline.emu': PlayerIntent( | ||
action: 'android.intent.action.VIEW', | ||
package: 'switch.skyline.emu', | ||
componentName: 'switch.skyline.emu.EmulationActivity', | ||
data: r'${fileGame}', | ||
), | ||
final _defaultAppIntent = <String, IntentFunction>{ | ||
'xyz.aethersx2.android': (p, g) { | ||
return PlayerIntent( | ||
action: 'android.intent.action.VIEW', | ||
package: 'xyz.aethersx2.android', | ||
componentName: 'xyz.aethersx2.android.EmulationActivity', | ||
arguments: { | ||
'bootPath': g.path, | ||
}, | ||
); | ||
}, | ||
'com.retroarch.aarch64': (p, g) { | ||
return PlayerIntent( | ||
action: 'android.intent.action.MAIN', | ||
package: 'com.retroarch.aarch64', | ||
componentName: 'com.retroarch.browser.retroactivity.RetroActivityFuture', | ||
arguments: { | ||
'ROM': convertContentUriToFilePath(g.path), | ||
'LIBRETRO': | ||
'/data/data/com.retroarch.aarch64/cores/${p.extra}_libretro_android.so', | ||
}, | ||
); | ||
}, | ||
'org.yuzu.yuzu_emu': (p, g) { | ||
return PlayerIntent( | ||
action: 'android.nfc.action.TECH_DISCOVERED', | ||
package: 'org.yuzu.yuzu_emu', | ||
type: 'application/octet-stream', | ||
componentName: 'org.yuzu.yuzu_emu.activities.EmulationActivity', | ||
data: g.path, | ||
); | ||
}, | ||
'org.yuzu.yuzu_emu.ea': (p, g) { | ||
return PlayerIntent( | ||
action: 'android.nfc.action.TECH_DISCOVERED', | ||
package: 'org.yuzu.yuzu_emu.ea', | ||
type: 'application/octet-stream', | ||
componentName: 'org.yuzu.yuzu_emu.activities.EmulationActivity', | ||
data: g.path, | ||
); | ||
}, | ||
'switch.skyline.emu': (p, g) { | ||
return PlayerIntent( | ||
action: 'android.intent.action.VIEW', | ||
package: 'switch.skyline.emu', | ||
componentName: 'switch.skyline.emu.EmulationActivity', | ||
data: g.path, | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.