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

[Wontfix] Solution to bypass property modified detection of some banking apps #79

Closed
HuskyDG opened this issue Nov 22, 2023 · 16 comments
Closed

Comments

@HuskyDG
Copy link
Contributor

HuskyDG commented Nov 22, 2023

More and more apps detect property modified which is caused by Magisk resetprop. Not many banking apps need to pass Play Integrity. We want to use these apps and also GPay (or any other apps that require Play Integrity), but to pass Play Integrity on stock ROM, we need resetprop to set some properties to a “safe” state. However, this will trigger the detection as mentioned.

Here is possibly way to bypass this problem temporarily:

  • Important! Use resetprop from Magisk with this commit. You can get test build here
  • Delete system.prop (optionally)
  • Modify service.sh to use resetprop with -n flag:
# Sensitive properties

check_resetprop() {
  local NAME=$1
  local EXPECTED=$2
  local VALUE=$(resetprop $NAME)
  [ -z $VALUE ] || [ $VALUE = $EXPECTED ] || resetprop -n $NAME $EXPECTED
}

maybe_set_prop() {
    local prop="$1"
    local contains="$2"
    local value="$3"

    if [[ "$(getprop "$prop")" == *"$contains"* ]]; then
        resetprop -n "$prop" "$value"
    fi
}

# Magisk recovery mode
maybe_set_prop ro.bootmode recovery unknown
maybe_set_prop ro.boot.mode recovery unknown
maybe_set_prop vendor.boot.mode recovery unknown

# Reset props after boot completed to avoid breaking some weird devices/ROMs...
{
    until [[ "$(getprop sys.boot_completed)" == "1" ]]; do
        sleep 1
    done

    # SafetyNet/Play Integrity | Avoid breaking Realme fingerprint scanners
    check_resetprop ro.boot.flash.locked 1

    # SafetyNet/Play Integrity | Avoid breaking Oppo fingerprint scanners
    check_resetprop ro.boot.vbmeta.device_state locked

    # SafetyNet/Play Integrity | Avoid breaking OnePlus display modes/fingerprint scanners
    check_resetprop vendor.boot.verifiedbootstate green

    # SafetyNet/Play Integrity | Avoid breaking OnePlus display modes/fingerprint scanners on OOS 12
    check_resetprop ro.boot.verifiedbootstate green
    check_resetprop ro.boot.veritymode enforcing
    check_resetprop vendor.boot.vbmeta.device_state locked

    # RootBeer, Microsoft
    check_resetprop ro.build.tags release-keys

    # Samsung
    check_resetprop ro.boot.warranty_bit 0
    check_resetprop ro.vendor.boot.warranty_bit 0
    check_resetprop ro.vendor.warranty_bit 0
    check_resetprop ro.warranty_bit 0

    # OnePlus
    check_resetprop ro.is_ever_orange 0

    # Other
    check_resetprop ro.build.type user
    check_resetprop ro.debuggable 0
    check_resetprop ro.secure 1

}&

However, resetprop can still be detected if we set the new expected value that is longer than the previous one, set ro. props without -n flag, delete read-only properties, or set the new properties which previously does not exist (check line 148)

@HuskyDG HuskyDG changed the title How to fix resetprop How to fix resetprop detection of some banking apps Nov 22, 2023
@HuskyDG HuskyDG changed the title How to fix resetprop detection of some banking apps How to partially fix resetprop detection of some banking apps Nov 22, 2023
@HuskyDG HuskyDG closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2023
@abdo1074
Copy link

you can make video how to do it

@HuskyDG HuskyDG reopened this Nov 22, 2023
@chiteroman
Copy link
Owner

Nice, I will modify that file!

@HuskyDG
Copy link
Contributor Author

HuskyDG commented Nov 22, 2023

Don't need to use Magisk build, just use custom resetprop with patch:

https://github.com/HuskyDG/Magisk/actions/runs/6960008306

@HuskyDG
Copy link
Contributor Author

HuskyDG commented Nov 22, 2023

PlayIntegrityFix_v13.4-test.zip

@HuskyDG HuskyDG changed the title How to partially fix resetprop detection of some banking apps How to partially fix property modified detection of some banking apps Nov 23, 2023
@osm0sis
Copy link
Contributor

osm0sis commented Nov 24, 2023

Curious why this got partially reverted in v13.5 Final (no more custom resetprop) and why maybe_set_prop is still used for the recovery mode ones here.

@NBruderman
Copy link

Curious why this got partially reverted in v13.5 Final (no more custom resetprop) and why maybe_set_prop is still used for the recovery mode ones here.

Seems like the pif.prop file caused some breakage on older devices, so it's being remove now all together (in 1.3.6)

@osm0sis
Copy link
Contributor

osm0sis commented Nov 24, 2023

Seems like the pif.prop file caused some breakage on older devices, so it's being remove now all together (in 13.6)

Worked on my Nexus 7 2013, and honestly they don't get much older nowadays 😛

@NBruderman
Copy link

Seems like the pif.prop file caused some breakage on older devices, so it's being remove now all together (in 13.6)

Worked on my Nexus 7 2013, and honestly they don't get much older nowadays 😛

I mean, I'm on pixel 6 with android 14, so everything worked for me too 😅

@HuskyDG HuskyDG changed the title How to partially fix property modified detection of some banking apps Fix property modified detection of some banking apps Nov 25, 2023
@HuskyDG
Copy link
Contributor Author

HuskyDG commented Nov 26, 2023

maybe we should only use resetprop on Android 10+

@chiteroman
Copy link
Owner

chiteroman commented Nov 26, 2023

maybe we should only use resetprop on Android 10+

Something like this?:

# use our resetprop only in Android 10+
if [ "$API" -gt 28 ]; then
	mv -f "$MODPATH/bin/$ABI/resetprop" "$MODPATH"
fi

rm -rf "$MODPATH/bin"

@HuskyDG
Copy link
Contributor Author

HuskyDG commented Nov 26, 2023

All of my testers test custom resetprop works without any problem, but only one using Android 9 reported to me that custom resetprop causes bootloop issue

@osm0sis
Copy link
Contributor

osm0sis commented Nov 26, 2023

Should $RESETPROP also be used for the remaining --delete selinux ?

https://github.com/chiteroman/PlayIntegrityFix/blob/main/module/service.sh#L35

Edit: Fixed in 4641985 🎉

Edit 2: And reverted again in 4dcf53b 🤷‍♂️

@HuskyDG HuskyDG changed the title Fix property modified detection of some banking apps Solutio to bypass property modified detection of some banking apps Nov 30, 2023
@HuskyDG HuskyDG changed the title Solutio to bypass property modified detection of some banking apps Solution to bypass property modified detection of some banking apps Nov 30, 2023
@stevenking888
Copy link

I have installed latest version https://github.com/chiteroman/PlayIntegrityFix/releases/download/v14.0/PlayIntegrityFix_v14.0-resetprop.zip

I found that a bank app still not available on Play Store I think it able to check unlock bootloader. Any solution please suggest.

@Dola-Shuvi
Copy link

@HuskyDG

All of my testers test custom resetprop works without any problem, but only one using Android 9 reported to me that custom resetprop causes bootloop issue

Just wanted to report that the custom resetprop shipped in v14.0 also caused a bootloop issue for me while running this rom. Specifically after installing v14.0 with custom resetprop and rebooting my phone would first start initializing a normal boot (it indicates it by saying "kernel" in the top left of the screen), have a short black screen, and then boot into download mode. This persisted even with the module disabled and was only fixed by removing it completely and switching over to v14.0 without custom resetprop.

@amk316
Copy link

amk316 commented Dec 3, 2023

using resetprob with PIF give me "Property Modified(3)" in Native Test!!!

@Sygmstr
Copy link

Sygmstr commented Dec 6, 2023

Don't need to use Magisk build, just use custom resetprop with patch:

https://github.com/HuskyDG/Magisk/actions/runs/6960008306

Sorry I'm a idiot and have no idea how to get this to work. Since the new version of PIF doesn't have a resetprop version l want to know how to install it manually.

@HuskyDG HuskyDG changed the title Solution to bypass property modified detection of some banking apps [Wontfix] Solution to bypass property modified detection of some banking apps Dec 6, 2023
@HuskyDG HuskyDG closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
qweraqq added a commit to qweraqq/KernelSU that referenced this issue Jan 3, 2024
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

9 participants