|
| 1 | +# DragoonOS |
| 2 | +A fork of GrapheneOS, designed for power users who want more control and possible play integrity API bypass. |
| 3 | + |
| 4 | +## What's changed? |
| 5 | +* Optional root access via KernelSU |
| 6 | +* Spoofed build fingerprint to pass cts profile check |
| 7 | +* Give user the ability to block any user app from discovering another app (a.k.a. AppFilter) |
| 8 | +* Give user the ability to screenshot/screenrecord any app regardless of app's settings (a.k.a. disable_flag_secure) |
| 9 | + |
| 10 | +## Why make this? |
| 11 | +I switched from iPhone to Pixel half a year ago, only to be extremely disappointed by the built-in Google bullshit. The Play Store, GMail, Google Maps, Pixel Launcher, and Chrome, all reek of Google's ad bullshit and filth (like news in Chrome's new page). Google has fallen from grace years ago, so I switched to GrapheneOS to find sanctuary, only to be F IN THE A by Google's play integrity API again. Usually I would just install KernelSU and use TrickyStore to bypass it, but GrapheneOS has done something to verify the kernel integrity so simply patching the init_boot.img won't work. Also LSPosed is broken on GrapheneOS so I can't block applist detection or screenshot any app which should be the right of an end user. So I made this fork just to please myself with a clean yet highly customizable OS. |
| 12 | + |
| 13 | +## How to use it? |
| 14 | +Currently this is my hobby project and given the highly experimental nature, no binary files will be provided for now. If you would like this to change, please open an issue and once it's popular enough, I'll start to release binaries. |
| 15 | + |
| 16 | +If you're a power user who would like to try it now, a detailed build instruction is available as follows: |
| 17 | +### Build environment setup |
| 18 | +Install these dependencies on a x86_64 Debian Linux distro |
| 19 | +``` |
| 20 | +apt install repo yarnpkg zip rsync |
| 21 | +``` |
| 22 | + |
| 23 | +Setup build folder, you might get rate limited by Google when downloading some parts of AOSP code, see [this](https://source.android.com/docs/setup/download/troubleshoot-sync) to setup authenticated access. |
| 24 | +``` |
| 25 | +mkdir grapheneos-16 |
| 26 | +cd grapheneos-16 |
| 27 | +repo init -u https://github.com/DragoonOS/platform_manifest.git -b 16 |
| 28 | +repo sync -j8 |
| 29 | +``` |
| 30 | +### Build a custom kernel with root access |
| 31 | +If you want root access with KernelSU and is currently using a pixel model other than "tokay", "caiman" or "komodo", you'll need to build your own kernel. Read [this](https://grapheneos.org/build#kernel-6th-through-9th-generation-pixels) for reference. |
| 32 | + |
| 33 | +Acquire the official kernel version string and build time from your stock OS |
| 34 | +``` |
| 35 | +adb shell |
| 36 | +uname -r |
| 37 | +uname -v |
| 38 | +exit |
| 39 | +``` |
| 40 | +Then modify your kernel build script like [this commit](https://github.com/DragoonOS/kernel_common-6.1/commit/00cf81985fce217400c0190c92857e19fb11e940), but with your own version string |
| 41 | + |
| 42 | +Then apply the KernelSU patch by running the following line in your kernel folder |
| 43 | +``` |
| 44 | +cd aosp |
| 45 | +curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - |
| 46 | +cd .. |
| 47 | +``` |
| 48 | +Then continue to follow the official GrapheneOS kernel build instructions and copy the build outputs to your kernel prebuilt folder, remember don't overwrite the entire folder but merge instead, as you will still need the kernel-headers folder. |
| 49 | + |
| 50 | +### Acquire device specific vendor files |
| 51 | +You do this once to get device specific vendor files for your pixel, replace PIXEL_CODENAME with Pixel device codename (such as komodo for Pixel 9 Pro XL) |
| 52 | +``` |
| 53 | +yarnpkg install --cwd vendor/adevtool/ |
| 54 | +source build/envsetup.sh |
| 55 | +lunch sdk_phone64_x86_64-cur-user |
| 56 | +m arsclib |
| 57 | +adevtool generate-all -d PIXEL_CODENAME |
| 58 | +``` |
| 59 | + |
| 60 | +### Acquire the BUILD_NUMBER |
| 61 | +For spoofing reasons first acquire a valid BUILD NUMBER, this has to match the version of vendor files you've downloaded in the previous step |
| 62 | + |
| 63 | +You can either acquire this from Google's [site](https://developers.google.com/android/images) |
| 64 | +Find the section for your device model and the correct version matching the vendor files you've downloaded previously, then copy the flash link and extract the BUILD NUMBER from it. |
| 65 | + |
| 66 | +For example, the version of vendor files I've downloaded for my device is BP2A.250805.005, I got this flash link ```https://flash.android.com/build/13691446?target=tegu-user&signed``` and the BUILD NUMBER is 13691446. |
| 67 | + |
| 68 | +Alternatively if you're still using the stock pixel OS, you can extract this BUILD NUMBER and also BUILD DATETIME from your system, just make sure your're running the same version of OS as the vendor files you've downloaded previously. |
| 69 | + |
| 70 | +Connect your phone to PC, then run |
| 71 | +``` |
| 72 | +adb shell |
| 73 | +getprop | grep "ro.build" |
| 74 | +exit |
| 75 | +``` |
| 76 | + |
| 77 | +The BUILD NUMBER would be in ```ro.build.version.incremental```, and the BUILD DATETIME would be in ```ro.build.date.utc```, it isn't necessary to spoof BUILD DATETIME, but it's good to do it nevertheless. Again make sure you have the same ro.build.id as in your downloaded vendor files. |
| 78 | + |
| 79 | +Now to start building stuff (remember to replace the BUILD_DATETIME and BUILD_NUMBER with your own value, if you acquired BUILD_NUMBER from Google's site just skip the BUILD_DATETIME line) |
| 80 | +``` |
| 81 | +export OFFICIAL_BUILD=false |
| 82 | +export BUILD_NUMBER=13691446 |
| 83 | +export BUILD_DATETIME=1750803747 |
| 84 | +source build/envsetup.sh |
| 85 | +``` |
| 86 | +### Build the OS |
| 87 | +Replace komodo with your own pixel model |
| 88 | +``` |
| 89 | +lunch komodo-cur-user |
| 90 | +m vendorbootimage vendorkernelbootimage target-files-package |
| 91 | +``` |
| 92 | +For the Pixel 6, Pixel 6 Pro and Pixel 6a you need this instead |
| 93 | +``` |
| 94 | +m vendorbootimage target-files-package |
| 95 | +``` |
| 96 | +### Sign the OS |
| 97 | +After a long long build time, sign your build with your own key, don't forget to replace komodo with your own pixel model |
| 98 | +``` |
| 99 | +mkdir -p keys/komodo |
| 100 | +cd keys/komodo |
| 101 | +ssh-keygen -t ed25519 -f ./id_ed25519 |
| 102 | +CN=GrapheneOS |
| 103 | +../../development/tools/make_key releasekey "/CN=$CN/" |
| 104 | +../../development/tools/make_key platform "/CN=$CN/" |
| 105 | +../../development/tools/make_key shared "/CN=$CN/" |
| 106 | +../../development/tools/make_key media "/CN=$CN/" |
| 107 | +../../development/tools/make_key networkstack "/CN=$CN/" |
| 108 | +../../development/tools/make_key sdk_sandbox "/CN=$CN/" |
| 109 | +../../development/tools/make_key bluetooth "/CN=$CN/" |
| 110 | +openssl genrsa 4096 | openssl pkcs8 -topk8 -scrypt -out avb.pem |
| 111 | +../../external/avb/avbtool.py extract_public_key --key avb.pem --output avb_pkmd.bin |
| 112 | +cd ../.. |
| 113 | +``` |
| 114 | + |
| 115 | +Now finialize your build, don't forget to replace komodo and BUILD NUMBER with your own |
| 116 | +``` |
| 117 | +m otatools-package |
| 118 | +script/finalize.sh |
| 119 | +script/generate-release.sh komodo 13691446 |
| 120 | +``` |
| 121 | + |
| 122 | +Now find your factory/ota image in the releases/BUILD_NUMBER/ANOTHER_FOLDER folder, and flash it on your own terms, I recommend re-lock the bootloader after flashing. |
| 123 | +If you have any questions, read the [official GrapheneOS build instruction](https://grapheneos.org/build) for reference. |
| 124 | + |
| 125 | +## How to fuck play integrity up? |
| 126 | +* First find a valid keybox.xml on your own |
| 127 | + |
| 128 | +* Install [KernelSU manager](https://github.com/tiann/KernelSU/releases/) |
| 129 | + |
| 130 | +* Install any root file manager, I recommend [this](https://f-droid.org/en/packages/me.zhanghai.android.files/) |
| 131 | + |
| 132 | +* Install the TrickyStore module, yeah I know it's closed source now, but nothing bad is in it. For security related details, read [here](TS_SECURITY.md) |
| 133 | + |
| 134 | +* Move your keybox.xml to /data/adb/tricky_store |
| 135 | + |
| 136 | +* Install [PIF Fork](https://github.com/osm0sis/PlayIntegrityFork), create this file ```/data/adb/modules/playintegrityfix/scripts-only-mode``` (and the missing folders) first, then flash the module. This helps by setting the ```ro.boot.verifiedbootstate``` system property to "green" instead of "yellow". You can also make your own module to do this. |
| 137 | + |
| 138 | +* Enjoy strong integrity! Alas, google pay and RCS message use a different integrity check (called droidguard) which won't work and is much harder to fix on GrapheneOS. |
| 139 | + |
| 140 | +* To make Revolut work with ksu manager, use your root file manager to edit ```/data/system/ApplicationFilterUser.txt``` and add the following line, reboot to apply changes |
| 141 | +``` |
| 142 | +com.revolut.revolut me.weishu.kernelsu |
| 143 | +``` |
| 144 | + |
| 145 | + |
| 146 | +* You can also block play store from auto updating youtube revanced by adding this line |
| 147 | +``` |
| 148 | +com.android.vending com.google.android.youtube |
| 149 | +``` |
| 150 | + |
| 151 | +## Credits |
| 152 | + |
| 153 | +* [GrapheneOS](https://grapheneos.org) |
| 154 | + |
| 155 | +* [KernelSU](https://kernelsu.org) |
| 156 | + |
| 157 | +* [Hide my applist](https://github.com/Dr-TSNG/Hide-My-Applist) |
| 158 | + |
| 159 | +* [DisableFlagSecure](https://github.com/LSPosed/DisableFlagSecure) |
0 commit comments