Skip to content

Commit

Permalink
New structure and instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Juhyung Park <[email protected]>
  • Loading branch information
arter97 committed Jan 3, 2024
1 parent 0af1497 commit ee5ca43
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Upload release assets
uses: ncipollo/release-action@v1
with:
artifacts: out/*.zip*
artifacts: out/*.7z*
artifactErrorsFailBuild: true
body: ${{ steps.dump.outputs.body }}
tag: ${{ steps.dump.outputs.tag }}_${{ github.event.inputs.name }}
Expand Down
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,38 @@
* Unmodified Nothing Phone 2 OTA images archive

## Downloads
Downloads are tagged with `POST_OTA_VERSION`, NothingOS version and region, [here](https://github.com/arter97/nothing_archive/releases).
Downloads are tagged with `POST_OTA_VERSION`, NothingOS version,
[here](https://github.com/arter97/nothing_archive/releases).

Logical partition images are uploaded separately, marked `-logical`,
so that other images can be downloaded quickly if needed.

## Usage
While this is a collection of unmodified images, you still need to have the bootloader unlocked.

Please download and use the latest fastboot [directly from Google](https://developer.android.com/tools/releases/platform-tools).

* **Magisk**
You can re-lock the bootloader after flashing images.

If you're interested in just rooting your device, download `boot.img.zip` and `vbmeta.img.zip`. After extracting both zip files, push `boot.img` to your device and proceed with Magisk installation. Optionally, if you want to disable `dm-verity`, use fastboot to flash a modified vbmeta:

``` bash
fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img
```
Please download and use the latest fastboot [directly from Google](https://developer.android.com/tools/releases/platform-tools).

* **fastboot**

To flash the stock, unmodified images with fastboot, extract the `*.zst` files using zstd and extract the split zip files using 7z, and supply the final `fastboot-*-image.zip` to fastboot.
To flash the stock, unmodified images with fastboot, extract the files using 7z and
use [Pong_fastboot_flasher](https://github.com/HELLBOY017/Pong_fastboot_flasher).

If you optionally want to have `dm-verity` disabled, perform:

``` bash
fastboot update /path/to/fastboot-*-image.zip
fastboot update --disable-verity --disable-verification vbmeta.img
```

or if you want to have `dm-verity` disabled:
* **NothingMuchROM**

``` bash
fastboot update --disable-verity --disable-verification /path/to/fastboot-*-image.zip
```
You can use this repository to flash non-super partitions to the latest stock to be
used with [NothingMuchROM](https://xdaforums.com/t/nothingmuchrom-for-nothing-phone-2.4623411).

Skip downloading `-logical` files, and follow the above steps but answer "N" to
`Flash logical partition images?` during [Pong_fastboot_flasher](https://github.com/HELLBOY017/Pong_fastboot_flasher)'s
installation.

### Thanks to
[luk1337](https://github.com/luk1337/oplus_archive)
[luk1337](https://github.com/luk1337/oplus_archive)
24 changes: 11 additions & 13 deletions dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ aria2c -x5 $1 -o ota.zip
unzip ota.zip payload.bin
mv payload.bin payload_working.bin
TAG="`unzip -p ota.zip payload_properties.txt | grep ^POST_OTA_VERSION= | cut -b 18-`"
BODY="`unzip -p ota.zip META-INF/com/android/metadata | grep ^post-build= | cut -b 12-`"
BODY="[$TAG]($1) (full)"
rm ota.zip
mkdir ota
(
Expand All @@ -21,7 +21,7 @@ for i in ${@:2}; do
wait
mv payload.bin payload_working.bin
TAG="`unzip -p ota.zip payload_properties.txt | grep ^POST_OTA_VERSION= | cut -b 18-`"
BODY="`unzip -p ota.zip META-INF/com/android/metadata | grep ^post-build= | cut -b 12-`"
BODY="$BODY -> [$TAG]($i)"
rm ota.zip

(
Expand All @@ -36,21 +36,19 @@ for i in ${@:2}; do
done
wait

# Create a pseudo fastboot zip (split 2G, each separately compressed with zstd)
echo "board=taro" > ota/android-info.txt
cp prebuilt/super_empty.img ota/
# Create a split 7z image
mkdir out
mkdir dyn
cd ota
7z a -mx9 ../out/boot.img.zip boot.img &
7z a -mx9 ../out/vbmeta.img.zip vbmeta.img &
7z a -mx0 ../out/fastboot-${TAG}-image.zip *
for f in system system_ext product vendor vendor_dlkm odm; do
mv ${f}.img ../dyn
done
7z a -mx6 ../out/${TAG}-image.7z * &
cd ../dyn
7z a -mx6 -v1g ../out/${TAG}-image-logical.7z *
wait
cd ..
rm -rf ota
cd out
7z a -v2G -mx0 fastboot-${TAG}-image-split.zip *-image.zip
rm *-image.zip
zstd --rm -T0 *-split.zip*
rm -rf ota dyn

# Echo tag name and release body
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
Expand Down
28 changes: 0 additions & 28 deletions prebuilt/command

This file was deleted.

Binary file removed prebuilt/super_empty.img
Binary file not shown.

0 comments on commit ee5ca43

Please sign in to comment.