#!/bin/bash

set -e;
source "build/envsetup.sh";

### ASB
repopick -f 387527 # ASB SPL Uprev
repopick -f -t R_asb_2024-03
repopick -f -t R_asb_2024-04
repopick -f -t R_asb_2024-05

repopick 392333 # OOR static disable

wait

### Personal

## build/make
changes=(
288657 # Sorry bro: 6 -> 3
)
repopick -f -P build/make ${changes[@]}&

## frameworks/base
changes=(
354065 # Alter model name to avoid SafetyNet HW attestation enforcement
354066 # keystore: Block key attestation for SafetyNet
354067 # AttestationHooks: Set shipping level to 32 for devices >=33
354068 # Limit SafetyNet workarounds to unstable GMS process
354069 # gmscompat: Apply the SafetyNet workaround to Play Store aswell
354070 # gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
354071 # gmscompat: Make CTS/Play Integrity pass again
373894 # gmscompat: Use new info
)
repopick -f -P frameworks/base ${changes[@]}&

## frameworks/native
changes=(
331403 # Revert "Vulkan: remove the fallback path to load Vulkan driver"
)
repopick -f -P frameworks/native ${changes[@]}&

## hardware/interfaces
changes=(
325305 # composer: hwc2on1: Resolve fence leak
)
repopick -f -P hardware/interfaces ${changes[@]}&

## vendor/lineage
changes=(
289513 # lineage: Moar fontz
286826 # adb insecure by default
)
repopick -f -P vendor/lineage ${changes[@]}&

### Devices

## addison/albus (moto_msm8953)
## shipped

## bacon
## Shipped

## debx/flox
## Shipped

## ether
## Shipped

## fugu
## Broken asf

## griffin
## Shipped

## {h,k}lte* (samsung_msms8974)
## Shipped

## j{activelte,f*}
repopick -f 391107 # oor: Enable CRC_PERMISSIVE
## Shipped

## loki
#repopick -f -t loki-49-r
#repopick -f 349895 # [DNM] Drop neverallow rules
## TODO: 4.9 stuff

## m8{,d}
## TODO: Recovery won't boot

## molly
## Needs to be brought up

## shamu
## Shipped

## victara
## Shipped

## yellowstone
## TODO: Finish shims, test, sepolicy, camera

wait

#cd build/make && git cherry-pick f9f623973feb8cfe31a0e66d87f7490e1a219836 && croot
