{"id":21113080,"url":"https://github.com/lapwat/nfcscreenoffpie","last_synced_at":"2025-12-29T20:05:02.240Z","repository":{"id":138971031,"uuid":"207909527","full_name":"lapwat/NfcScreenOffPie","owner":"lapwat","description":null,"archived":false,"fork":false,"pushed_at":"2019-09-15T18:32:13.000Z","size":44,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T04:27:27.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Smali","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lapwat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-11T21:25:22.000Z","updated_at":"2024-03-30T09:04:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4e1a518-2846-454e-8294-f7a9bd1e16d2","html_url":"https://github.com/lapwat/NfcScreenOffPie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapwat%2FNfcScreenOffPie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapwat%2FNfcScreenOffPie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapwat%2FNfcScreenOffPie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapwat%2FNfcScreenOffPie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lapwat","download_url":"https://codeload.github.com/lapwat/NfcScreenOffPie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243558484,"owners_count":20310574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T01:38:15.399Z","updated_at":"2025-12-29T20:05:02.161Z","avatar_url":"https://github.com/lapwat.png","language":"Smali","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tools\n- adb\n- apktool\n- smali / baksmali v2.3+\n- zip / unzip\n- zipalign\n- jarsigner\n\nEnable ADB on phone in developper options.\n\n# Decompile process\n\n```sh\n# copy original sources\n$ adb pull /system/app/NfcNci/NfcNci.apk\n$ adb pull /system/framework/framework-res.apk\n\n# create a backup for recovery\n$ cp NfcNci.apk NfcNci_bak.apk\n\n# decompile\n$ apktool d -f NfcNci.apk -o NfcNci/\n```\n# Modding\n\nThis is the part where you reverse engineer the source code of the app by modifying smali files.\n\nFor NfcNci, apply [those changes](https://github.com/lapwat/NfcScreenOffPie/commit/42df7a757535490f6219ded761f42e0120031033).\n\nFiles to edit are located at:\n- NfcNci/smali/com/android/nfc/NfcService.smali\n- NfcNci/smali/com/android/nfc/ScreenStateHelper.smali\n\n\n# Compile process\n\n```sh\n# load framework\n$ apktool if framework-res.apk\n\n# compile\n$ apktool b -f NfcNci/ -o NfcNci_mod.apk\n\n# sign\n$ keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000\n$ jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore ~/.android/debug.keystore -storepass android NfcNci_mod.apk androiddebugkey\n\n# align\nzipalign -v 4 NfcNci_mod.apk NfcNci_align.apk\n```\n\n# Load modded APK on your phone\n\n```sh\nadb push NfcNci_align.apk /sdcard/\nadb shell\n\n# android shell\nsu\ncd /system/app/NfcNci\nbusybox mount -o remount,rw $PWD\ncp /sdcard/NfcNci_align.apk NfcNci.apk\nchmod 644 NfcNci.apk\n```\n\n# Something went wrong?\n\nYou can restore the original APK file at any time with those commands.\n\n```sh\nadb push NfcNci_bak.apk /sdcard/\nadb shell\n\n# android shell\nsu\ncd /system/app/NfcNci\nbusybox mount -o remount,rw $PWD\ncp /sdcard/NfcNci_bak.apk NfcNci.apk\nchmod 644 NfcNci.apk\n```\n\n# Sources\n\nJava versions of smali files for reverse engineering\n\nhttps://android.googlesource.com/platform/packages/apps/Nfc/+/refs/tags/android-9.0.0_r48/src/com/android/nfc/\n\nBig up to Lasse Hyldahl Jensen for his version for Android N\n\nhttps://lasse-it.dk/2017/01/how-to-modifying-nfcnci-apk-to-run-when-screen-is-turned-off-on-android-nougat/\n\nUnderstanding the signing process\n\nhttps://reverseengineering.stackexchange.com/a/9185","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapwat%2Fnfcscreenoffpie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flapwat%2Fnfcscreenoffpie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapwat%2Fnfcscreenoffpie/lists"}