JoaoBoll / eatventure-bot

eatventure-bot
1 stars 0 forks source link

java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission #1

Open onedollar7 opened 1 month ago

onedollar7 commented 1 month ago

Hi, I'm trying to use this but when I execute the last command I get this error in the terminal, do you know why?

py eatventure_bot.py Eatventure foi aberto com sucesso. ./images/xiaomi_poco_x5_pro/x.png ./images/xiaomi_poco_x5_pro/shops_x.png ./images/xiaomi_poco_x5_pro/open.png ./images/xiaomi_poco_x5_pro/investor.png ./images/xiaomi_poco_x5_pro/box.png ./images/xiaomi_poco_x5_pro/box_2.png ./images/xiaomi_poco_x5_pro/upgrades_arrow.png ./images/xiaomi_poco_x5_pro/food_upgrade_arrow.png

Exception occurred while executing 'swipe': java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission at com.android.server.input.InputManagerService.injectInputEventInternal(InputManagerService.java:909) at com.android.server.input.InputManagerService.injectInputEvent(InputManagerService.java:861) at android.hardware.input.InputManager.injectInputEvent(InputManager.java:1091) at com.android.server.input.InputShellCommand.injectMotionEvent(InputShellCommand.java:138) at com.android.server.input.InputShellCommand.sendSwipe(InputShellCommand.java:370) at com.android.server.input.InputShellCommand.runSwipe(InputShellCommand.java:354) at com.android.server.input.InputShellCommand.onCommand(InputShellCommand.java:194) at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97) at android.os.ShellCommand.exec(ShellCommand.java:38) at com.android.server.input.InputManagerService.onShellCommand(InputManagerService.java:3525) at android.os.Binder.shellCommand(Binder.java:950) at android.os.Binder.onTransact(Binder.java:834) at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:1125) at android.os.Binder.execTransactInternal(Binder.java:1184) at android.os.Binder.execTransact(Binder.java:1143) Erro ao pressionar e segurar: Command 'adb shell input swipe 10 300 10 300 300' returned non-zero exit status 255.

JoaoBoll commented 1 month ago

Hello!

I haven't used the bot for a while, but I'll take a look at it as soon as I have some free time.

The Bot itself is not finished, I ended up not continuing the project because I didn't have much time to study, work, and still develop some projects like this.

Could you give me more information?? Mainly about your device, such as:

What is the Android version and brand/model of your device?

The bot is available for Android only. So I don't guarantee any operation on other operating systems.

I based all the images on the resolution of the xiaomi poco x5, so the images they must contain must be "printed" and cropped like the ones you already have, but based on the resolution of your device.

Indeed!! I'm not sure, but I think you need permission or developer mode (On Device) for the project to work perfectly.

I'm not very good with English yet, most of this text was generated by translators.