(SHIFTphone 8) crDroid 13.1 Unofficial (Android 17)

Ene

Active member
Original poster
21 Oktober 2020
215
Germany / Bavaria

crDroid 13.1 (Unofficial)​


crdroid.png

General​

I compiled crDroid for the SHIFTphone 8!
The Under Display Fingerprint Sensor (UDFPS) should now work with an unlocked bootloader without requiring workarounds.
Because I found the "moving around" of the Navigation Bar Buttons (burn-in protection) very annoying, I disabled it in this build before compiling:
sed -i 's/offsetNavBar(Offset offset) {/offsetNavBar(Offset offset) {\nif (true) return;/' ./frameworks/base/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBarView.java

Prerequisites​

  • unlocked bootloader (using this guide)
  • (for the initial installation, a PC with fastboot configured according to this guide)

Download​

https://drive.google.com/file/d/1YtRVLYQUkAAWF-WwVxrnC2mkmTTKhLoW/view?usp=sharing

Installation​

Extract Payload​

  1. extract the payload.bin file form the downloaded crDroidAndroid-[...]-otter-v13.[...].zip
  2. download payload-dumper-go from here
  3. put the payload-dumper-go executable in the same folder as the payload.bin
  4. execute payload-dumper-go payload.bin

Flash Partitions​

  1. reboot the device into bootloader mode
  2. check if the driver is correctly installed and the device is detected using fastboot devices
  3. ⚠️ this will wipe all your data ⚠️
    inside the folder where the extracted images reside, execute these commands
    Code:
    fastboot flash super super_empty.img
    
    fastboot flash abl_a abl.img
    fastboot flash aop_a aop.img
    fastboot flash bluetooth_a bluetooth.img
    fastboot flash boot_a boot.img
    fastboot flash cpucp_a cpucp.img
    fastboot flash devcfg_a devcfg.img
    fastboot flash dsp_a dsp.img
    fastboot flash dtbo_a dtbo.img
    fastboot flash featenabler_a featenabler.img
    fastboot flash hyp_a hyp.img
    fastboot flash imagefv_a imagefv.img
    fastboot flash keymaster_a keymaster.img
    fastboot flash modem_a modem.img
    fastboot flash multiimgoem_a multiimgoem.img
    fastboot flash qupfw_a qupfw.img
    fastboot flash qweslicstore_a qweslicstore.img
    fastboot flash shrm_a shrm.img
    fastboot flash tz_a tz.img
    fastboot flash uefisecapp_a uefisecapp.img
    fastboot flash vbmeta_a vbmeta.img
    fastboot flash vbmeta_system_a vbmeta_system.img
    fastboot flash vendor_boot_a vendor_boot.img
    fastboot flash xbl_config_a xbl_config.img
    fastboot flash xbl_a xbl.img
    
    fastboot flash abl_b abl.img
    fastboot flash aop_b aop.img
    fastboot flash bluetooth_b bluetooth.img
    fastboot flash boot_b boot.img
    fastboot flash cpucp_b cpucp.img
    fastboot flash devcfg_b devcfg.img
    fastboot flash dsp_b dsp.img
    fastboot flash dtbo_b dtbo.img
    fastboot flash featenabler_b featenabler.img
    fastboot flash hyp_b hyp.img
    fastboot flash imagefv_b imagefv.img
    fastboot flash keymaster_b keymaster.img
    fastboot flash modem_b modem.img
    fastboot flash multiimgoem_b multiimgoem.img
    fastboot flash qupfw_b qupfw.img
    fastboot flash qweslicstore_b qweslicstore.img
    fastboot flash shrm_b shrm.img
    fastboot flash tz_b tz.img
    fastboot flash uefisecapp_b uefisecapp.img
    fastboot flash vbmeta_b vbmeta.img
    fastboot flash vbmeta_system_b vbmeta_system.img
    fastboot flash vendor_boot_b vendor_boot.img
    fastboot flash xbl_config_b xbl_config.img
    fastboot flash xbl_b xbl.img
    
    fastboot format:ext4 metadata
    fastboot format:f2fs userdata
    fastboot --set-active=a
    fastboot reboot recovery
    pause

Update​

Just flash the OTA ZIP in the recovery

Source​


Building​

To compile it yourself you just have to follow these simple steps (and need a beefy PC)

  1. install Ubuntu (you can use Windows On Linux 2)
  2. execute the following commands
    1. install programs
      Code:
      sudo apt install repo bc bison build-essential ccache curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick lib32ncurses-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses6 libncurses-dev libsdl1.2-dev libssl-dev libwxgtk3.2-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev -y
    2. configure git
      Code:
      git config --global user.email "you@example.com"
      git config --global user.name "Your Name"
      
      git lfs install
      git config --global trailer.changeid.key "Change-Id"
    3. configure ccache
      Code:
      rm ~/.cache/ccache
      mkdir -p ~/.cache/ccache/tmp
      echo export USE_CCACHE=1 >> ~/.bashrc
      echo export CCACHE_EXEC=/usr/bin/ccache >> ~/.bashrc
      echo export CPU_SSE42=false >> ~/.bashrc
      
      ccache -M 50G
    4. configure working directory (note that mine residents in the folder /home/android/shift8, change accordingly)
      Code:
      mkdir -p /home/android/shift8/crdroid
      cd /home/android/shift8/crdroid
      
      repo init -u https://github.com/crdroidandroid/android.git -b 17.0 --git-lfs --no-clone-bundle
      
      mkdir -p /home/android/shift8/crdroid/.repo/local_manifests
      cat <<EOF >>/home/android/shift8/crdroid/.repo/local_manifests/otter.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <manifest>
        <project path="device/shift/otter" remote="github" name="LineageOS/android_device_shift_otter" revision="lineage-24.0" />
        <project path="kernel/shift/qcm6490" remote="github" name="LineageOS/android_kernel_shift_qcm6490" revision="lineage-24.0" />
        <project path="vendor/shift/otter" remote="github" name="TheMuppets/proprietary_vendor_shift_otter" revision="lineage-24.0" />
      </manifest>
      EOF
      
      repo sync  --current-branch -j8 --force-sync --force-checkout --force-remove-dirty --prune --auto-gc
    5. optional - increase SWAP size (to 80GB) to prevent out of memory crashes
      Code:
      sudo -s
      swapoff -a
      rm /swapfile
      fallocate -l 80G /swapfile
      chmod 600 /swapfile
      mkswap /swapfile
      swapon /swapfile
  3. build! (and fix the incorrect ARCH_VARIANT in before)
    Code:
    git -C ./device/shift/otter reset --hard HEAD
    git -C ./device/shift/otter clean -d --force
    sed -i 's/TARGET_2ND_ARCH_VARIANT := armv8-a/TARGET_2ND_ARCH_VARIANT := armv8-2a/' "./device/shift/otter/BoardConfig.mk"
    source build/envsetup.sh
    brunch otter
This will take about an hour and about 350GB of Disk space [tested with 28 cores and 120GB Memory (40GB RAM + 80GB SWAP]. The build process sometimes crashes because it runs of memory (exit code 137), increase the SWAP size and run the brunch command again. The flashable ZIP can be found in /out/target/product/otter