Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: bypass emulator detection #198

Open
F8RZD opened this issue Nov 29, 2024 · 6 comments
Open

FEATURE: bypass emulator detection #198

F8RZD opened this issue Nov 29, 2024 · 6 comments

Comments

@F8RZD
Copy link

F8RZD commented Nov 29, 2024

there are some games that do not allow being played on emulators.
I'm mostly concerned about Hayday a Supercell game.

There are some reddit threads that previously had mentioned changing some data such as manufacturer, brand and device model had solved the issue and they were able to play it fine for a short amount of time.
https://www.reddit.com/r/HayDay/comments/12yy6hq/is_anyone_playing_hay_day_on_bluestacks_and/
https://www.reddit.com/r/BlueStacks/comments/12ycpvr/hay_day_is_broken_in_the_new_update_for_me_on/
https://www.reddit.com/r/HayDay/comments/z7kqz3/hayday_wont_open_on_emulator_after_update/

These are pretty old so none work but there is some idea into how these detections work

Getting back to the main point:
Are there any ways to make An android emulator indistinguishable from a normal day to day device ?

@YogSottot
Copy link

YogSottot commented Nov 29, 2024

Try this script.
https://github.com/YogSottot/waydroid_stuff/blob/master/weston/spoof-device.sh
Run with sudo.

It works in some cases. For example, for konosuba.
But the solution is not universal, for example, wuthering waves still detects emulator.

@F8RZD
Copy link
Author

F8RZD commented Nov 30, 2024

I would try it but suddenly my waydroid is not working anymore
similar issue to:
waydroid/waydroid#183

also on the HayDay part
I have decompiled it and to my surprise it's emulator detection code is not obfuscated.
maybe I could get a grasp on how it manages to detect the emulator if I could run my waydroid again.
so far nothing seems to work

@YogSottot
Copy link

I would try it but suddenly my waydroid is not working anymore

Doesn't work after running the script? You can always manually delete the lines added by the script in waydroid.cfg and restart the upgrade command.

If it didn't work before running the script, you can do a full reset
https://docs.waydro.id/debugging/troubleshooting

@F8RZD
Copy link
Author

F8RZD commented Dec 8, 2024

I finally got my waydroid back working
Though your spoofing method does not seem to do the job

@F8RZD
Copy link
Author

F8RZD commented Dec 8, 2024

I have access to this code from apk relevant to emulator detection:

private void checkEmulator() {
    this.emulatorDetectorThread = EmulatorDetector.with(this).setCheckTelephony(false).setDebug(false).detect(new f());
}

and also

public void run() {
            boolean detect = EmulatorDetector.this.detect();
            EmulatorDetector emulatorDetector = EmulatorDetector.this;
            StringBuilder sb = new StringBuilder();
            char[] cArr = {(char) (cArr[4] ^ 't'), (char) (cArr[6] ^ 17), (char) (cArr[13] ^ 26), (char) (cArr[4] ^ 'S'), (char) (cArr[16] ^ 'M'), (char) (cArr[3] ^ ' '), (char) (cArr[15] ^ Typography.less), (char) (cArr[11] ^ 'S'), (char) (cArr[13] ^ 7), (char) (cArr[4] ^ 'E'), (char) (cArr[5] ^ Typography.greater), (char) (cArr[8] ^ 'T'), (char) (cArr[13] ^ 26), (char) (cArr[15] ^ '6'), (char) (cArr[4] ^ 0), (char) ((-29490) ^ (-29557)), (char) (cArr[12] ^ 4), (char) (cArr[23] ^ 'O'), (char) (cArr[21] ^ 3), (char) (cArr[2] ^ '\b'), (char) (cArr[4] ^ 'T'), (char) (cArr[12] ^ 6), (char) (cArr[15] ^ '7'), (char) (cArr[15] ^ 127), (char) (cArr[10] ^ 'M')};
            sb.append(new String(cArr).intern());
            sb.append(detect);
            emulatorDetector.log(sb.toString());
            OnEmulatorDetectorListener onEmulatorDetectorListener = this.f12052a;
            if (onEmulatorDetectorListener != null) {
                onEmulatorDetectorListener.onResult(detect);
            }
        }

and much much other obfuscated data so I guess no easy way to spoof this one

@F8RZD
Copy link
Author

F8RZD commented Dec 8, 2024

12-08 22:56:53.016  2461  2461 W upercell.hayda: Unexpected CPU variant for X86 using defaults: x86_64
12-08 22:56:53.017  2461  2461 D houdini : [2461] Initialize library(version: 11.0.1b_z.38765.m RELEASE)... successfully.
12-08 22:56:53.017  2461  2461 E upercell.hayda: Not starting debugger since process cannot load the jdwp agent.

I also found these in logcat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants