Skip to content

Commit

Permalink
Merge branch 'master' into fp-redirect-to-sell
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurKun21 authored Apr 4, 2024
2 parents a22a72a + 0b119cf commit 4e5e9d8
Show file tree
Hide file tree
Showing 53 changed files with 1,202 additions and 62 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '*.md'
- 'LICENSE'
- 'custom-game-area/**'
- 'wiki/**'
push:
branches:
- master
Expand All @@ -23,15 +24,21 @@ on:
- 'renovate.json'
- 'custom-game-area/**'
- 'FUNDING.yml'
- 'wiki/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
JAVA_VERSION: 17
JAVA_DISTRO: 'temurin'
VERSION_CODE: '${{ github.run_number }}'

jobs:
build:
runs-on: ubuntu-latest
runs-on: macos-14
if: github.ref != 'refs/heads/master'
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -65,7 +72,7 @@ jobs:
path: app/build/outputs/mapping/ci/mapping.txt

play_store:
runs-on: ubuntu-latest
runs-on: macos-14
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -95,7 +102,7 @@ jobs:
bundler-cache: true

- name: Deploy to Play Store
uses: maierj/fastlane-action@v3.0.0
uses: maierj/fastlane-action@v3.1.0
with:
lane: 'deploy'
env:
Expand Down Expand Up @@ -126,7 +133,7 @@ jobs:
ruby-version: '3.2'
bundler-cache: true
- name: Download Universal APK
uses: maierj/fastlane-action@v3.0.0
uses: maierj/fastlane-action@v3.1.0
with:
lane: 'download_apk'
options: '{ "version_code": "$VERSION_CODE" }'
Expand All @@ -135,15 +142,15 @@ jobs:
- name: zip APK
run: zip FGA-apk-${VERSION_CODE}.zip *.apk
- name: Create tag
uses: mathieudutour/github-tag-action@v6.1
uses: mathieudutour/github-tag-action@v6.2
with:
custom_tag: ${{ env.VERSION_CODE }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: ncipollo/release-action@v1.13.0
uses: ncipollo/release-action@v1.14.0
with:
generateReleaseNotes: true
artifacts: 'FGA-apk-${{ env.VERSION_CODE }}.zip'
tag: ${{ env.VERSION_CODE }}
tag: 'v${{ env.VERSION_CODE }}'
name: 'FGA ${{ env.VERSION_CODE }}'
prerelease: true
22 changes: 22 additions & 0 deletions .github/workflows/publish-wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish wiki

on:
push:
branches:
- master
paths:
- 'wiki/**'
- '.github/workflows/publish-wiki.yml'
workflow_dispatch:

concurrency:
group: publish-wiki
cancel-in-progress: true
permissions:
contents: write
jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Andrew-Chen-Wang/github-wiki-action@v4
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ GEM
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
arm64-darwin
x64-mingw-ucrt
x86_64-linux

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Discord Banner 2](https://discordapp.com/api/guilds/1117873862500163684/widget.png?style=banner2)](https://discord.gg/H99eUMYuH7)

Auto-battle app for F/GO (Android 7 or later, no need for root on phones).
Auto-battle app for FGO (Android 7 or later, no need for root on phones).

Download from our [website](https://fate-grand-automata.github.io)

Expand Down
Binary file added app/src/main/assets/En/Gold5StarXP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/En/lottery_transition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ImageLoader @Inject constructor(
Images.Withdraw -> "withdraw.png"
Images.LotteryBoxFinished -> "lottery.png"
Images.LotteryLineupUpdated -> "lottery_lineup_updated.png"
Images.LotteryTransition -> "lottery_transition.png"
Images.PresentBoxFull -> "StopGifts.png"
Images.MasterExp -> "master_exp.png"
Images.MasterLevelUp -> "master_lvl_up.png"
Expand All @@ -89,6 +90,7 @@ class ImageLoader @Inject constructor(
Images.SelectedParty -> "selected_party.png"
Images.SilverXP -> "SilverXP.png"
Images.GoldXP -> "GoldXP.png"
Images.Gold5StarXP -> "Gold5StarXP.png"
Images.GiftBoxCheck -> "gift_box_check.png"
Images.GiftBoxScrollEnd -> "gift_box_scroll_end.png"
Images.DropCE -> "drop_ce.png"
Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Don't give up on your life grinding F/GO. Automate your farming battles with this app. This app doesn't tamper with the game in any way and just looks at the screen to decide what to tap on just like what a real user would do.
Don't give up on your life grinding FGO. Automate your farming battles with this app. This app doesn't tamper with the game in any way and just looks at the screen to decide what to tap on just like what a real user would do.

This app uses an Android Accessibility Service to simulate touch screen inputs for the Fate/Grand Order app. Please only install the app if you're okay with that.

Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/short_description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Auto-battle app for F/GO
Auto-battle app for FGO
41 changes: 22 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[versions]
appcompat_version = "1.6.1"
assertk_version = "0.26.1"
assertk_version = "0.28.0"
constraintlayout_version = "2.1.4"
core_ktx_version = "1.12.0"
documentfile_version = "1.0.1"
flow_preferences_version = "1.9.1"
hilt_navigation_compose_version = "1.1.0"
kotlinx_coroutines_core_version = "1.7.3"
lifecycle_version = "2.6.2"
kotlin_version = "1.9.21"
hilt_version = "2.48.1"
hilt_navigation_compose_version = "1.2.0"
kotlinx_coroutines_core_version = "1.8.0"
lifecycle_version = "2.7.0"
kotlin_version = "1.9.23"
hilt_version = "2.51.1"
gson_version = "2.10.1"

gradle_version = "8.2.0"
gradle_version = "8.3.1"

ben-manes_versions = "0.47.0"
accompanist_version = "0.32.0"
ben-manes_versions = "0.51.0"
accompanist_version = "0.34.0"

google_android_play_version = "2.1.0"

activity_version = "1.8.1"
mockk_version = "1.13.8"
navigation_compose_version = "2.7.5"
opencv_android_version = "4.5.1"
activity_version = "1.8.2"
mockk_version = "1.13.10"
navigation_compose_version = "2.7.7"
opencv_android_version = "4.8.1r2"
recyclerview_version = "1.3.2"
tesseract4android_version = "4.5.0"
tesseract4android_version = "4.7.0"

timber_version = "5.0.1"

compose_bom_version = "2023.10.01"
compose_bom_version = "2024.03.00"

kotlinCompilerExtensionVersion = "1.5.7"
ksp_version = "1.9.21-1.0.16"
kotlinCompilerExtensionVersion = "1.5.11"
ksp_version = "1.9.23-1.0.19"

junit_bom_version = "5.9.3"
junit_bom_version = "5.10.2"


[libraries]
Expand All @@ -42,6 +42,9 @@ kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-p
hilt-android-gradle-plugin = { group = "com.google.dagger", name = "hilt-android-gradle-plugin", version.ref = "hilt_version" }
ksp-gradlePlugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp_version" }

# Workaround so renovate updates the version of the compiler extension
android-compose-compiler = {module="androidx.compose.compiler:compiler", version.ref ="kotlinCompilerExtensionVersion"}

kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin_version" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx_coroutines_core_version" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" }
Expand Down Expand Up @@ -84,7 +87,7 @@ androidx-documentfile = { module = "androidx.documentfile:documentfile", version
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview_version" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout_version" }

opencv-android = { module = "com.github.iamareebjamal:opencv-android", version.ref = "opencv_android_version" }
opencv-android = { module = "com.github.animeavi:opencv-android", version.ref = "opencv_android_version" }
tesseract4android = { module = "cz.adaptech.tesseract4android:tesseract4android", version.ref = "tesseract4android_version" }

junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit_bom_version" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ interface AutomataApi {
similarity: Double? = null
): Match? = findAll(pattern, similarity).firstOrNull()

fun Region.find(
patterns: Collection<Pattern>,
similarity: Double? = null
): Match? = patterns.firstNotNullOfOrNull { find(it, similarity) }

fun Region.exists(
image: Pattern,
timeout: Duration = Duration.ZERO,
Expand Down
16 changes: 12 additions & 4 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
"enabled": true
},
"github-actions": {
"extends": ["group:all"],
"enabled": true,
"automerge": true,
"branchTopic": "github-actions",
"commitMessageTopic": "github-actions"
}
"groupName": "github-actions"
},
"packageRules": [
{
"matchPackagePatterns": [
"^org.jetbrains.kotlin",
"^com.google.devtools.ksp",
"^androidx.compose.compiler"
],
"groupName": "kotlin"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum class Images {
Withdraw,
LotteryBoxFinished,
LotteryLineupUpdated,
LotteryTransition,
PresentBoxFull,
MasterExp,
MasterLevelUp,
Expand All @@ -41,6 +42,7 @@ enum class Images {
SelectedParty,
SilverXP,
GoldXP,
Gold5StarXP,
GiftBoxCheck,
GiftBoxScrollEnd,
DropCE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ class AutoBattle @Inject constructor(
{ isInResult() } to { result() },
{ isInDropsScreen() } to { dropScreen() },
{ isInOrdealCallOutOfPodsScreen() } to { ordealCallOutOfPods() },
{ isInInterludeEndScreen() } to { locations.interludeCloseClick.click() },
{ isInQuestRewardScreen() } to { questReward() },
{ isInSupport() } to { support() },
{ isRepeatScreen() } to { repeatQuest() },
{ isInInterludeEndScreen() } to { locations.interludeCloseClick.click() },
{ withdraw.needsToWithdraw() } to { withdraw.withdraw() },
{ needsToStorySkip() } to { skipStory() },
{ isFriendRequestScreen() } to { skipFriendRequestScreen() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AutoDetect @Inject constructor(
images[Images.LotteryBoxFinished] in locations.lottery.checkRegion || images[Images.LotteryBoxFinished] in locations.lottery.finishedRegion ->
ScriptModeEnum.Lottery

listOf(images[Images.GoldXP], images[Images.SilverXP]) in emberSearchRegion ->
listOf(images[Images.GoldXP], images[Images.SilverXP], images[Images.Gold5StarXP]) in emberSearchRegion ->
ScriptModeEnum.PresentBox

locations.support.confirmSetupButtonRegion.exists(images[Images.SupportConfirmSetupButton], similarity = 0.75) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.github.fate_grand_automata.scripts.IFgoAutomataApi
import io.github.fate_grand_automata.scripts.Images
import io.github.lib_automata.EntryPoint
import io.github.lib_automata.ExitManager
import io.github.lib_automata.Location
import io.github.lib_automata.dagger.ScriptScope
import javax.inject.Inject
import kotlin.time.Duration.Companion.seconds
Expand Down Expand Up @@ -45,14 +46,14 @@ class AutoFriendGacha @Inject constructor(
}

override fun script(): Nothing {
if (images[Images.FriendSummon] in locations.fp.initialSummonCheck) {
locations.fp.initialSummonClick.click()
0.3.seconds.wait()
locations.fp.initialSummonContinueClick.click()

countNext()
val initialClickLocation: Location? = if (images[Images.FriendSummon] in locations.fp.initialSummonCheck) {
locations.fp.initialSummonClick
} else if (!isSummonButtonVisible()) {
locations.fp.first10SummonClick.click()
locations.fp.first10SummonClick
} else null

initialClickLocation?.let {
it.click()
0.3.seconds.wait()
locations.fp.okClick.click()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AutoGiftBox @Inject constructor(

override fun script(): Nothing {
var totalSelected = IterationResult()
val xpOffsetX = (locations.scriptArea.find(images[Images.GoldXP]) ?: locations.scriptArea.find(images[Images.SilverXP]))
val xpOffsetX = locations.scriptArea.find(listOf(images[Images.GoldXP], images[Images.SilverXP], images[Images.Gold5StarXP]))
?.region?.center?.x
?: throw ExitException(ExitReason.NoEmbersFound)

Expand Down
Loading

0 comments on commit 4e5e9d8

Please sign in to comment.