├── LICENSE
├── README.en.md
├── README.jp.md
├── README.md
├── assets
├── image1.en.png
├── image1.jp.png
├── image1.zh.png
├── image2.en.png
├── image2.jp.png
└── image2.zh.png
├── build
├── .gitignore
├── nsis
│ ├── favicon.ico
│ ├── setup.nsi
│ └── tools
│ │ ├── plugins
│ │ ├── System.dll
│ │ └── nsExec.dll
│ │ └── stubs
│ │ ├── uninst
│ │ ├── zlib
│ │ └── zlib_solid
└── nsis_build.bat
└── src
├── .gitignore
├── GenshinFishingToy.sln
├── GenshinFishingToy
├── .editorconfig
├── .gitignore
├── App.xaml
├── App.xaml.cs
├── Core
│ ├── GenshinRegedit.cs
│ ├── GenshinWindow.cs
│ ├── HotKey
│ │ ├── Hotkey.cs
│ │ ├── HotkeyHolder.cs
│ │ └── HotkeyHook.cs
│ ├── ImageCapture.cs
│ ├── ImageExtension.cs
│ ├── ImageJigging.cs
│ ├── ImageRecognition.cs
│ ├── LaunchCtrl.cs
│ ├── Logger.cs
│ ├── NativeMethods.cs
│ ├── Settings
│ │ ├── SettingsCache.cs
│ │ ├── SettingsDefinition{T}.cs
│ │ ├── SettingsManager.cs
│ │ └── SettingsSerializer.cs
│ ├── SpecialPathProvider.cs
│ ├── UIElement
│ │ ├── AssemblyUtils.cs
│ │ ├── BrushAnimation.cs
│ │ ├── BrushConverterX.cs
│ │ ├── DpiUtils.cs
│ │ ├── FluentSymbol.cs
│ │ ├── LanguageManager.cs
│ │ ├── NoticeService.cs
│ │ ├── ResourceUtils.cs
│ │ ├── StoryboardUtils.cs
│ │ └── SvgViewboxExtension.cs
│ └── UsageManager.cs
├── FodyWeavers.xml
├── FodyWeavers.xsd
├── GenshinFishingToy.csproj
├── GlobalUsing.cs
├── Models
│ └── Settings.cs
├── Pack.cs
├── Properties
│ └── PublishProfiles
│ │ └── FolderProfile.pubxml
├── Resources
│ ├── Languages
│ │ ├── en-us.xaml
│ │ ├── jp.xaml
│ │ └── zh-cn.xaml
│ ├── demo.gif
│ ├── demo.png
│ ├── favicon.ico
│ ├── favicon.png
│ ├── hydro.png
│ ├── hydro.svg
│ ├── segoe-fluent-icons.ttf
│ └── squircle.svg
├── ViewModels
│ ├── MainViewModel.cs
│ └── NotifyIconViewModel.cs
├── Views
│ ├── Behaviors
│ │ ├── BorderWindowBehavior.cs
│ │ ├── LeftContextMenuBehavior.cs
│ │ ├── ToolWindowBehavior.cs
│ │ └── UIElementDragMoveBehavior.cs
│ ├── Converters
│ │ ├── AddConverter.cs
│ │ └── LanguageToBoolConverter.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── MotionAreaWindow.xaml
│ ├── MotionAreaWindow.xaml.cs
│ ├── PreviewForm.Designer.cs
│ ├── PreviewForm.cs
│ ├── UIElement
│ │ ├── DialogWindow.xaml
│ │ ├── DialogWindow.xaml.cs
│ │ ├── MessageDialog.xaml
│ │ ├── MessageDialog.xaml.cs
│ │ └── ObservableWindow.cs
│ ├── UsageContent.xaml
│ └── UsageContent.xaml.cs
└── app.manifest
├── GenshinFishingToySetup
├── .gitignore
├── GenshinFishingToySetup.assets.cache
├── GenshinFishingToySetup.wapproj
├── GenshinFishingToySetup_TemporaryKey.pfx
├── Images
│ ├── BadgeLogo.scale-100.png
│ ├── BadgeLogo.scale-125.png
│ ├── BadgeLogo.scale-150.png
│ ├── BadgeLogo.scale-200.png
│ ├── BadgeLogo.scale-400.png
│ ├── LargeTile.scale-100.png
│ ├── LargeTile.scale-125.png
│ ├── LargeTile.scale-150.png
│ ├── LargeTile.scale-200.png
│ ├── LargeTile.scale-400.png
│ ├── SmallTile.scale-100.png
│ ├── SmallTile.scale-125.png
│ ├── SmallTile.scale-150.png
│ ├── SmallTile.scale-200.png
│ ├── SmallTile.scale-400.png
│ ├── SplashScreen.scale-100.png
│ ├── SplashScreen.scale-125.png
│ ├── SplashScreen.scale-150.png
│ ├── SplashScreen.scale-200.png
│ ├── SplashScreen.scale-400.png
│ ├── Square150x150Logo.scale-100.png
│ ├── Square150x150Logo.scale-125.png
│ ├── Square150x150Logo.scale-150.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square150x150Logo.scale-400.png
│ ├── Square44x44Logo.altform-lightunplated_targetsize-16.png
│ ├── Square44x44Logo.altform-lightunplated_targetsize-24.png
│ ├── Square44x44Logo.altform-lightunplated_targetsize-256.png
│ ├── Square44x44Logo.altform-lightunplated_targetsize-32.png
│ ├── Square44x44Logo.altform-lightunplated_targetsize-48.png
│ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ ├── Square44x44Logo.altform-unplated_targetsize-256.png
│ ├── Square44x44Logo.altform-unplated_targetsize-32.png
│ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ ├── Square44x44Logo.scale-100.png
│ ├── Square44x44Logo.scale-125.png
│ ├── Square44x44Logo.scale-150.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.scale-400.png
│ ├── Square44x44Logo.targetsize-16.png
│ ├── Square44x44Logo.targetsize-24.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Square44x44Logo.targetsize-256.png
│ ├── Square44x44Logo.targetsize-32.png
│ ├── Square44x44Logo.targetsize-48.png
│ ├── StoreLogo.scale-100.png
│ ├── StoreLogo.scale-125.png
│ ├── StoreLogo.scale-150.png
│ ├── StoreLogo.scale-200.png
│ ├── StoreLogo.scale-400.png
│ ├── Wide310x150Logo.scale-100.png
│ ├── Wide310x150Logo.scale-125.png
│ ├── Wide310x150Logo.scale-150.png
│ ├── Wide310x150Logo.scale-200.png
│ └── Wide310x150Logo.scale-400.png
└── Package.appxmanifest
├── WindowsGraphicsCapture
├── .gitattributes
├── .gitignore
├── CaptureSampleCore
│ ├── BasicCapture.cs
│ ├── BasicSampleApplication.cs
│ └── CaptureSampleCore.csproj
├── Composition.WindowsRuntimeHelpers
│ ├── CaptureHelper.cs
│ ├── Composition.WindowsRuntimeHelpers.csproj
│ ├── CompositionHelper.cs
│ ├── CoreMessagingHelper.cs
│ └── Direct3D11Helper.cs
├── LICENSE
├── README.md
├── ScreenCapture.sln
└── ScreenCapture
│ ├── AssemblyInfo.cs
│ ├── GraphicsCapture.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── MonitorEnumerationHelper.cs
│ ├── ScreenCapture.csproj
│ └── WindowEnumerationHelper.cs
└── app_workspace.cmd
/README.en.md:
--------------------------------------------------------------------------------
1 | ・[English](README.en.md) ・[中文](README.md) ・[日本語](README.jp.md)
2 |
3 | [](https://github.com/emako/genshin-fishing-toy/releases)
4 | [](https://github.com/emako/genshin-fishing-toy/releases)
5 |
6 | # 🐟 Genshin Fishing Toy
7 |
8 | > Genshin Fishing Toy [(Original Repository)](https://github.com/babalae/genshin-fishing-toy)
9 |
10 | PC Genshin Impact auto fishing machine (Supports different game window sizes).
11 |
12 | `"You just need to be responsible for the rod swing, and then all will be handled!"`
13 |
14 | The simplest automatic fishing machine has its own GUI. Select the fishing box and start fishing. It is easy to use and hands free.
15 |
16 | * Work with visual recognition.
17 | * Delay 0~1s to auto lift the rod after the fish is hooked.
18 |
19 | ## ScreenShot
20 |
21 |
22 |
23 | 
24 |
25 | 
26 |
27 | ## Usage
28 |
29 |
30 |
31 | 1. First, move the jigging region to select the recognition region, and you also can resize the region. Just frame the fishing progress bar. Don't frame the fishing progress circle below.
32 |
33 | 2. After confirming that the region position is correct, you can start auto fishing (ShortcutF11).
34 |
35 | > - After the rod is thrown, just waiting for the fish to hook up. The program will auto control mouse according to the image recognition results and complete the fishing progress.
36 | >
37 | > - If you can't auto simulate the key, please try to add this program to the anti-virus software white list, or turn off anti-virus software firstly.
38 |
39 | ## FAQs
40 | - If you are not fishing, you'd better stop the fishing function.
41 | - If the Auto Lifting does not work, please try to increase the height of the fishing region frame.
42 | - When the setup can't be installed. Please ensure that your system has installed the Microsoft Store. The setup depends on the store architecture (MSIX).
43 |
44 | - Runtime environment isnet6.0-windows10.0.18362.0.
45 |
46 | - The fullscreen mode user is recommended to use the windowed in the whole process instead of full screen (shortcut key in the gameAlt+Enter).
47 |
--------------------------------------------------------------------------------
/README.jp.md:
--------------------------------------------------------------------------------
1 | ・[English](README.en.md) ・[中文](README.md) ・[日本語](README.jp.md)
2 |
3 | [](https://github.com/emako/genshin-fishing-toy/releases)
4 | [](https://github.com/emako/genshin-fishing-toy/releases)
5 |
6 | # 🐟原神釣り師
7 |
8 | > Genshin Fishing Toy [(元のリポジトリ)](https://github.com/babalae/genshin-fishing-toy)
9 |
10 | PC版の原神自動釣りマシン(ゲームウィンドウサイズ別対応)。
11 |
12 | 「竿を振るだけで、あとは任せときぃ!」
13 |
14 | 最も簡単な自動釣魚機を操作し、釣り枠を選択してから釣りをスタートし、簡単で使いやすく。
15 |
16 | * 視覚識別による自動操作。
17 | * 魚がヒットしてから0~1sの遅延後に自動的に竿をリフティング。
18 |
19 | ## スクショ
20 |
21 |
22 |
23 | 
24 |
25 | 
26 |
27 | ## 使い方
28 |
29 |
30 |
31 | 1. まずは半透明長方形の釣り枠を移動して識別区域を囲むこと、釣り枠のサイズは調整できる、釣りのプログレスバーを枠に入れるだけでいいので、 下の丸い釣りプログレスを枠に入れないこと。
32 | 2. 釣り枠が正しい位置を囲んだ後、「スタート」してください(ショートカットF11)。
33 |
34 | > - 魚竿を振った後、魚が釣れるのを待つだけ、プログラムは自動的に画像識別に基づいて対応、マウスを任せて釣りを行う。
35 | >
36 | > - もし正常にキーボードなどのシミュレーションが出来ない場合は、本プログラムをアンチウィルスソフトにホワイトリストに追加し、もしくはアンチウィルスソフトを終了後にお使いください。
37 |
38 | ## FAQs
39 | - 釣りをしていない時は釣り機能をストップしたほうがいいのである。
40 | - 自動リフティングができない場合は釣り枠の高さを上げてみてください。
41 | - もしセットアップがインストールできない場合は、システムにアプリストアが実装されているかどうかをご確認ください。セットアップはアプリストアに依存している (MSIX)。
42 | - 実行環境はnet6.0-windows10.0.18362.0。
43 |
44 | - フルスクリーンで利用する方はフルスクリーンではなくウィンドウの表示モードを利用することをお勧めする(ゲーム内のショートカットキーはAlt+Enter)。
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ・[English](README.en.md) ・[中文](README.md) ・[日本語](README.jp.md)
2 |
3 | [](https://github.com/emako/genshin-fishing-toy/releases)
4 | [](https://github.com/emako/genshin-fishing-toy/releases)
5 |
6 | # 🐟原神钓鱼姬
7 |
8 | > Genshin Fishing Toy [(原始仓库)](https://github.com/babalae/genshin-fishing-toy)
9 |
10 | PC原神自动钓鱼机(支持不同游戏窗口大小)。
11 |
12 | 『你只需负责甩竿,后面的放着我来!』
13 |
14 | 操作最简单的自动钓鱼机,选钓鱼框后启动钓鱼,简单易用,解放双手。
15 |
16 | - [x] 采用视觉识别。
17 | - [x] 鱼儿上钩后延迟0~1s自动提竿。
18 |
19 | ## 程序界面
20 |
21 |
22 |
23 | 
24 |
25 | 
26 |
27 | ## 使用方法
28 |
29 |
30 |
31 | 1. 首先移动半透明矩形钓鱼框选择识别范围,钓鱼框可调整大小,只需要框住钓鱼进度条就可以了, 不要框住下方的钓鱼总进度圈 。
32 |
33 | 2. 确认选框位置正确后,就直接启动进行自动钓鱼啦(快捷键F11)。
34 |
35 | > - 甩竿后直接等待鱼儿上钩即可,程序会自动根据当前图像识别的结果发送对应鼠标操作,自动化提竿、完成钓鱼进度。
36 | >
37 | > - 如果无法正常自动模拟按键,请尝试将本程序添加至杀软白名单,或关闭杀软后使用。
38 |
39 | ## 常见问题
40 | - 如果不在钓鱼的时候最好还是停止钓鱼功能。
41 | - 无法自动提竿的话请尝试调高条框的高度。
42 |
43 | - 若安装包无法安装,请确保你的系统已安装应用商店,安装包依赖商店架构 (MSIX)。
44 |
45 | - 运行环境是net6.0-windows10.0.18362.0。
46 |
47 | - 独占模式建议全程使用窗口模式使用(游戏内快捷键Alt+Enter)。
48 |
49 | - 独占模式下的可正常操作流程:
50 |
51 | > - 启动游戏进程->启动钓鱼姬->退出钓鱼姬->退出游戏进程
52 |
53 | - 独占模式下存在问题的流程:
54 |
55 | > - 启动钓鱼姬->启动游戏进程->退出钓鱼姬->退出游戏进程(无法恢复钓鱼框位置并变成类似-30000多的值)
56 | >
57 | > - 启动游戏进程->启动钓鱼姬->退出游戏进程->退出钓鱼姬(游戏退出瞬间可能会误识别为窗口模式)
58 |
59 |
--------------------------------------------------------------------------------
/assets/image1.en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/assets/image1.en.png
--------------------------------------------------------------------------------
/assets/image1.jp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/assets/image1.jp.png
--------------------------------------------------------------------------------
/assets/image1.zh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/assets/image1.zh.png
--------------------------------------------------------------------------------
/assets/image2.en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/assets/image2.en.png
--------------------------------------------------------------------------------
/assets/image2.jp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/assets/image2.jp.png
--------------------------------------------------------------------------------
/assets/image2.zh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/assets/image2.zh.png
--------------------------------------------------------------------------------
/build/.gitignore:
--------------------------------------------------------------------------------
1 | *.cer
2 | *.msix
3 | *.msixbundle
4 | *.exe
5 | *.7z
6 |
--------------------------------------------------------------------------------
/build/nsis/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/build/nsis/favicon.ico
--------------------------------------------------------------------------------
/build/nsis/setup.nsi:
--------------------------------------------------------------------------------
1 | !define PRODUCT_NAME "GenshinFishingToy"
2 | !define PRODUCT_VERSION "1.4.0.0"
3 | !define PRODUCT_PUBLISHER "GenshinMatrix"
4 | !define PRODUCT_WEB_SITE "https://github.com/genshin-matrix"
5 | !define PRODUCT_LEGAL "Licensed under MIT"
6 |
7 | VIProductVersion "${PRODUCT_VERSION}"
8 | VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
9 | VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
10 | VIAddVersionKey "CompanyName" "${PRODUCT_PUBLISHER}"
11 | VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
12 | VIAddVersionKey "InternalName" "${PRODUCT_NAME}"
13 | VIAddVersionKey "FileDescription" "${PRODUCT_NAME}_Setup"
14 | VIAddVersionKey "Comments" "${PRODUCT_WEB_SITE}"
15 | VIAddVersionKey "LegalCopyright" "${PRODUCT_LEGAL}"
16 |
17 | !addplugindir plugins
18 |
19 | Icon "favicon.ico"
20 | Name "${PRODUCT_NAME}"
21 | OutFile "..\${PRODUCT_NAME}_Setup.exe"
22 | RequestExecutionLevel admin
23 | Page custom MsixSetup
24 |
25 | Function MsixSetup
26 | Call CheckMutex
27 | InitPluginsDir
28 | SetOutPath "$PLUGINSDIR"
29 | File "tools\certmgr.exe"
30 | File "..\app.cer"
31 | nsExec::ExecToLog 'certmgr.exe -add app.cer -s -r localMachine AuthRoot'
32 | File "tools\msixexec.exe"
33 | File "..\app.msixbundle"
34 | nsExec::ExecToLog 'msixexec.exe app.msixbundle'
35 | FunctionEnd
36 |
37 | Function CheckMutex
38 | System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${PRODUCT_NAME}_SetupMutex") i .r1 ?e'
39 | Pop $R0
40 | StrCmp $R0 0 +3
41 | MessageBox MB_OK|MB_ICONEXCLAMATION "Setup is already running."
42 | Abort
43 | FunctionEnd
44 |
45 | Section
46 | SectionEnd
47 |
--------------------------------------------------------------------------------
/build/nsis/tools/plugins/System.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/build/nsis/tools/plugins/System.dll
--------------------------------------------------------------------------------
/build/nsis/tools/plugins/nsExec.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/build/nsis/tools/plugins/nsExec.dll
--------------------------------------------------------------------------------
/build/nsis/tools/stubs/uninst:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/build/nsis/tools/stubs/uninst
--------------------------------------------------------------------------------
/build/nsis/tools/stubs/zlib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/build/nsis/tools/stubs/zlib
--------------------------------------------------------------------------------
/build/nsis/tools/stubs/zlib_solid:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GenshinMatrix/genshin-fishing-toy/ccb0fc8a1171eaa6ef4a134984c0482725835f2b/build/nsis/tools/stubs/zlib_solid
--------------------------------------------------------------------------------
/build/nsis_build.bat:
--------------------------------------------------------------------------------
1 | cd /d %~dp0
2 | rename GenshinFishingToySetup_*_x64.cer App.cer
3 | rename GenshinFishingToySetup_*_x64.msixbundle App.msixbundle
4 | del App_Setup.exe
5 | nsis\tools\makensis .\nsis\setup.nsi
6 | del GenshinFishingToySetup.exe
7 | rename App_Setup.exe GenshinFishingToySetup.exe
8 | @pause
9 |
--------------------------------------------------------------------------------
/src/.gitignore:
--------------------------------------------------------------------------------
1 | # User-specific files
2 | *.suo
3 | *.user
4 | *.userosscache
5 | *.sln.docstates
6 | .vs/
7 |
8 | # User-specific files (MonoDevelop/Xamarin Studio)
9 | *.userprefs
10 |
11 | # Build results
12 | [Dd]ebug/
13 | [Dd]ebugPublic/
14 | [Rr]elease/
15 | [Rr]eleases/
16 | x64/
17 | x86/
18 | bld/
19 | [Bb]in/
20 | [Oo]bj/
21 | [Ll]og/
22 |
23 | # Mine
24 | Tmp/
25 | /packages/
26 | node_modules/
--------------------------------------------------------------------------------
/src/GenshinFishingToy.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.3.32819.101
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenshinFishingToy", "GenshinFishingToy\GenshinFishingToy.csproj", "{F17BE4C5-926C-456D-9CC0-606DAE304ED8}"
7 | EndProject
8 | Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "GenshinFishingToySetup", "GenshinFishingToySetup\GenshinFishingToySetup.wapproj", "{A80A34DD-ACBC-4D67-A22D-156A0FFC32A8}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WindowsGraphicsCapture", "WindowsGraphicsCapture", "{61B278E1-2049-475B-B200-3F0C3DDA87C2}"
11 | EndProject
12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScreenCapture", "WindowsGraphicsCapture\ScreenCapture\ScreenCapture.csproj", "{AB145A23-0897-4517-8EA6-BEB87CB9D26A}"
13 | EndProject
14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CaptureSampleCore", "WindowsGraphicsCapture\CaptureSampleCore\CaptureSampleCore.csproj", "{D8154C31-38C2-49E2-96A0-69EB76567461}"
15 | EndProject
16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Composition.WindowsRuntimeHelpers", "WindowsGraphicsCapture\Composition.WindowsRuntimeHelpers\Composition.WindowsRuntimeHelpers.csproj", "{AE6F99F5-AFD5-467E-A082-D4003E3EEECF}"
17 | EndProject
18 | Global
19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 | Debug|x64 = Debug|x64
21 | Release|x64 = Release|x64
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {F17BE4C5-926C-456D-9CC0-606DAE304ED8}.Debug|x64.ActiveCfg = Debug|x64
25 | {F17BE4C5-926C-456D-9CC0-606DAE304ED8}.Debug|x64.Build.0 = Debug|x64
26 | {F17BE4C5-926C-456D-9CC0-606DAE304ED8}.Release|x64.ActiveCfg = Release|x64
27 | {F17BE4C5-926C-456D-9CC0-606DAE304ED8}.Release|x64.Build.0 = Release|x64
28 | {A80A34DD-ACBC-4D67-A22D-156A0FFC32A8}.Debug|x64.ActiveCfg = Debug|x64
29 | {A80A34DD-ACBC-4D67-A22D-156A0FFC32A8}.Debug|x64.Build.0 = Debug|x64
30 | {A80A34DD-ACBC-4D67-A22D-156A0FFC32A8}.Debug|x64.Deploy.0 = Debug|x64
31 | {A80A34DD-ACBC-4D67-A22D-156A0FFC32A8}.Release|x64.ActiveCfg = Release|x64
32 | {A80A34DD-ACBC-4D67-A22D-156A0FFC32A8}.Release|x64.Build.0 = Release|x64
33 | {A80A34DD-ACBC-4D67-A22D-156A0FFC32A8}.Release|x64.Deploy.0 = Release|x64
34 | {AB145A23-0897-4517-8EA6-BEB87CB9D26A}.Debug|x64.ActiveCfg = Debug|x64
35 | {AB145A23-0897-4517-8EA6-BEB87CB9D26A}.Debug|x64.Build.0 = Debug|x64
36 | {AB145A23-0897-4517-8EA6-BEB87CB9D26A}.Release|x64.ActiveCfg = Release|x64
37 | {AB145A23-0897-4517-8EA6-BEB87CB9D26A}.Release|x64.Build.0 = Release|x64
38 | {D8154C31-38C2-49E2-96A0-69EB76567461}.Debug|x64.ActiveCfg = Debug|x64
39 | {D8154C31-38C2-49E2-96A0-69EB76567461}.Debug|x64.Build.0 = Debug|x64
40 | {D8154C31-38C2-49E2-96A0-69EB76567461}.Release|x64.ActiveCfg = Release|x64
41 | {D8154C31-38C2-49E2-96A0-69EB76567461}.Release|x64.Build.0 = Release|x64
42 | {AE6F99F5-AFD5-467E-A082-D4003E3EEECF}.Debug|x64.ActiveCfg = Debug|x64
43 | {AE6F99F5-AFD5-467E-A082-D4003E3EEECF}.Debug|x64.Build.0 = Debug|x64
44 | {AE6F99F5-AFD5-467E-A082-D4003E3EEECF}.Release|x64.ActiveCfg = Release|x64
45 | {AE6F99F5-AFD5-467E-A082-D4003E3EEECF}.Release|x64.Build.0 = Release|x64
46 | EndGlobalSection
47 | GlobalSection(SolutionProperties) = preSolution
48 | HideSolutionNode = FALSE
49 | EndGlobalSection
50 | GlobalSection(NestedProjects) = preSolution
51 | {AB145A23-0897-4517-8EA6-BEB87CB9D26A} = {61B278E1-2049-475B-B200-3F0C3DDA87C2}
52 | {D8154C31-38C2-49E2-96A0-69EB76567461} = {61B278E1-2049-475B-B200-3F0C3DDA87C2}
53 | {AE6F99F5-AFD5-467E-A082-D4003E3EEECF} = {61B278E1-2049-475B-B200-3F0C3DDA87C2}
54 | EndGlobalSection
55 | GlobalSection(ExtensibilityGlobals) = postSolution
56 | SolutionGuid = {DFA8F1CD-513D-45D7-856D-378146C4D367}
57 | EndGlobalSection
58 | EndGlobal
59 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # IDE0055: Fix formatting
4 | dotnet_diagnostic.IDE0055.severity = none
5 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/.gitignore:
--------------------------------------------------------------------------------
1 | *.7z
2 | .vs/*
3 | bin/*
4 | obj/*
5 | *.user
6 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/App.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | /Resources/segoe-fluent-icons.ttf#Segoe Fluent Icons
25 |
29 |
30 |
31 |
32 |
33 |
34 |
44 |
49 |
50 |
55 |
56 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Composition.WindowsRuntimeHelpers;
2 | using GenshinFishingToy.Core;
3 | using GenshinFishingToy.ViewModels;
4 | using Hardcodet.Wpf.TaskbarNotification;
5 | using Microsoft.Toolkit.Uwp.Notifications;
6 | using System;
7 | using System.ComponentModel;
8 | using System.Diagnostics;
9 | using System.Security.Principal;
10 | using System.Threading;
11 | using System.Threading.Tasks;
12 | using System.Windows;
13 | using Windows.System;
14 |
15 | namespace GenshinFishingToy;
16 |
17 | public partial class App : Application
18 | {
19 | private DispatcherQueueController _controller;
20 | public static new App? Current { get; protected set; } = null!;
21 | public TaskbarIcon Taskbar { get; protected set; } = null!;
22 | public static bool IsElevated { get; } = GetElevated();
23 |
24 | public App()
25 | {
26 | Logger.Info("Startup");
27 | Current = this;
28 | Current.DispatcherUnhandledException += (_, e) => e.Handled = true;
29 | _controller = CoreMessagingHelper.CreateDispatcherQueueControllerForCurrentThread();
30 | AppDomain.CurrentDomain.UnhandledException += (s, e) => Logger.Error(e);
31 | ToastNotificationManagerCompat.OnActivated += NotifyIconViewModel.OnNotificationActivated;
32 | NoticeService.ClearNotice();
33 | if (!EnsureElevated()) return;
34 | CheckSingleInstance();
35 | InitializeComponent();
36 | SetupLanguage();
37 | SettingsManager.Setup();
38 | CheckOSVersion();
39 | }
40 |
41 | protected override void OnStartup(StartupEventArgs e)
42 | {
43 | Taskbar = (TaskbarIcon)FindResource("PART_Taskbar");
44 | base.OnStartup(e);
45 | }
46 |
47 | protected override void OnExit(ExitEventArgs e)
48 | {
49 | NoticeService.ClearNotice();
50 | base.OnExit(e);
51 | }
52 |
53 | protected void CheckOSVersion()
54 | {
55 | if (!Pack.IsSupported)
56 | {
57 | NoticeService.AddNotice(Mui("Tips"), Mui("SupportedOSVersionTips", Pack.SupportedOSVersion, Pack.CurrentOSVersion), string.Empty, ToastDuration.Short);
58 | }
59 | }
60 |
61 | public bool EnsureElevated()
62 | {
63 | if (!IsElevated)
64 | {
65 | RestartAsElevated('r' + 'u' + 'n' + 'a' + 's');
66 | return false;
67 | }
68 | return true;
69 | }
70 |
71 | public static void RestartAsElevated(int? exitCode = null)
72 | {
73 | try
74 | {
75 | _ = Process.Start(new ProcessStartInfo()
76 | {
77 | Verb = "runas",
78 | UseShellExecute = true,
79 | FileName = Process.GetCurrentProcess().MainModule!.FileName,
80 | WorkingDirectory = Environment.CurrentDirectory,
81 | });
82 | }
83 | catch (Win32Exception)
84 | {
85 | return;
86 | }
87 | Current!.Shutdown();
88 | if (exitCode != null) Environment.Exit(exitCode.Value);
89 | }
90 |
91 | private static bool GetElevated()
92 | {
93 | using WindowsIdentity identity = WindowsIdentity.GetCurrent();
94 | WindowsPrincipal principal = new(identity);
95 | return principal.IsInRole(WindowsBuiltInRole.Administrator);
96 | }
97 |
98 | public void CheckSingleInstance()
99 | {
100 | EventWaitHandle? handle;
101 |
102 | try
103 | {
104 | handle = EventWaitHandle.OpenExisting(Pack.Alias);
105 | handle.Set();
106 | Shutdown();
107 | }
108 | catch (WaitHandleCannotBeOpenedException)
109 | {
110 | handle = new EventWaitHandle(false, EventResetMode.AutoReset, Pack.Alias);
111 | }
112 | GC.KeepAlive(handle);
113 | _ = Task.Run(() =>
114 | {
115 | while (handle.WaitOne())
116 | {
117 | Dispatcher.Invoke(() =>
118 | {
119 | MainWindow?.Activate();
120 | MainWindow?.Focus();
121 | MainWindow?.Show();
122 | });
123 | }
124 | });
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/Core/GenshinRegedit.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace GenshinFishingToy.Core;
5 |
6 | internal class GenshinRegedit
7 | {
8 | public static string InstallPath
9 | {
10 | get
11 | {
12 | try
13 | {
14 | using RegistryKey hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
15 | RegistryKey? key = hklm.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\原神");
16 |
17 | if (key == null)
18 | {
19 | key = hklm.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Genshin Impact");
20 |
21 | if (key == null)
22 | {
23 | return null!;
24 | }
25 | }
26 |
27 | object installLocation = key.GetValue("InstallPath")!;
28 | key?.Dispose();
29 |
30 | if (installLocation != null && !string.IsNullOrEmpty(installLocation.ToString()))
31 | {
32 | return installLocation.ToString()!;
33 | }
34 | }
35 | catch (Exception e)
36 | {
37 | NoticeService.AddNotice(Mui("Tips"), "Failed", e.Message);
38 | }
39 | return null!;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/Core/GenshinWindow.cs:
--------------------------------------------------------------------------------
1 | using GenshinFishingToy.Models;
2 | using GenshinFishingToy.Views;
3 | using System;
4 | using System.Threading.Tasks;
5 |
6 | namespace GenshinFishingToy.Core;
7 |
8 | public class GenshinWindow
9 | {
10 | protected IntPtr hwnd;
11 | public IntPtr Hwnd => hwnd;
12 |
13 | public bool IsSetupClient { get; protected set; } = false;
14 |
15 | internal MotionAreaWindow MotionArea = new();
16 |
17 | public GenshinWindow()
18 | {
19 | if (LaunchCtrl.TryGetHwnd(out hwnd))
20 | {
21 | MotionArea.rectGameLatest = NativeMethods.GetWindowRECT(hwnd);
22 | }
23 | }
24 |
25 | public async Task Start()
26 | {
27 | await HasHwnd();
28 | MotionArea.rectGameLatest = NativeMethods.GetWindowRECT(hwnd);
29 | }
30 |
31 | public async Task HasHwnd()
32 | {
33 | return await LaunchCtrl.IsRunning(async p =>
34 | {
35 | hwnd = p?.MainWindowHandle ?? IntPtr.Zero;
36 | });
37 | }
38 |
39 | public void MouseLeftButtonDown()
40 | {
41 | NativeMethods.Focus(hwnd);
42 | NativeMethods.PostMessage(hwnd, NativeMethods.WM_LBUTTONDOWN, 0, (0 << 16) | 0);
43 | }
44 |
45 | public void MouseLeftButtonUp()
46 | {
47 | NativeMethods.Focus(hwnd);
48 | NativeMethods.PostMessage(hwnd, NativeMethods.WM_LBUTTONUP, 0, (0 << 16) | 0);
49 | }
50 |
51 | public async Task MouseClick(int x, int y)
52 | {
53 | NativeMethods.Focus(hwnd);
54 | NativeMethods.PostMessage(hwnd, NativeMethods.WM_LBUTTONDOWN, 0, (y << 16) | x);
55 | await Task.Delay(80);
56 | NativeMethods.PostMessage(hwnd, NativeMethods.WM_LBUTTONUP, 0, (y << 16) | x);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/Core/HotKey/Hotkey.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace GenshinFishingToy.Core;
5 |
6 | public class Hotkey
7 | {
8 | public bool Alt { get; set; }
9 | public bool Control { get; set; }
10 | public bool Shift { get; set; }
11 | public bool Windows { get; set; }
12 |
13 | private Keys key;
14 | public Keys Key
15 | {
16 | get => key;
17 | set
18 | {
19 | if (value != Keys.ControlKey && value != Keys.Alt && value != Keys.Menu && value != Keys.ShiftKey)
20 | {
21 | key = value;
22 | }
23 | else
24 | {
25 | key = Keys.None;
26 | }
27 | }
28 | }
29 |
30 | public ModifierKeys ModifierKey =>
31 | (Windows ? ModifierKeys.Win : 0) |
32 | (Control ? ModifierKeys.Control : 0) |
33 | (Shift ? ModifierKeys.Shift : 0) |
34 | (Alt ? ModifierKeys.Alt : 0);
35 |
36 | public Hotkey()
37 | {
38 | Reset();
39 | }
40 |
41 | public Hotkey(string hotkeyStr)
42 | {
43 | try
44 | {
45 | string[] keyStrs = hotkeyStr.Replace(" ", "").Split('+');
46 | foreach (string keyStr in keyStrs)
47 | {
48 | string k = keyStr.ToLower();
49 | if (k == "win")
50 | Windows = true;
51 | else if (k == "ctrl")
52 | Control = true;
53 | else if (k == "shift")
54 | Shift = true;
55 | else if (k == "alt")
56 | Alt = true;
57 | else
58 | Key = (Keys)Enum.Parse(typeof(Keys), keyStr);
59 | }
60 | }
61 | catch
62 | {
63 | throw new ArgumentException("Invalid Hotkey");
64 | }
65 | }
66 |
67 | public override string ToString()
68 | {
69 | string str = string.Empty;
70 | if (Key != Keys.None)
71 | {
72 | str = string.Format("{0}{1}{2}{3}{4}",
73 | Windows ? "Win + " : string.Empty,
74 | Control ? "Ctrl + " : string.Empty,
75 | Shift ? "Shift + " : string.Empty,
76 | Alt ? "Alt + " : string.Empty,
77 | Key);
78 | }
79 | return str;
80 | }
81 |
82 | public void Reset()
83 | {
84 | Alt = false;
85 | Control = false;
86 | Shift = false;
87 | Windows = false;
88 | Key = Keys.None;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/GenshinFishingToy/Core/HotKey/HotkeyHolder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace GenshinFishingToy.Core;
4 |
5 | internal class HotkeyHolder
6 | {
7 | private static Hotkey? hotkey;
8 | private static HotkeyHook? hotkeyHook;
9 | private static Action