lineageos4microg / docker-lineage-cicd

Docker microservice for LineageOS Continuous Integration and Continous Deployment
https://hub.docker.com/r/lineageos4microg/docker-lineage-cicd
GNU General Public License v3.0
480 stars 189 forks source link

Nns v21 spoofing patches #612

Closed petefoth closed 2 months ago

petefoth commented 2 months ago

These changes are intended to fix #614 , but thy need to be tested further before they can be merged to master branch.

The changes have apparently been used to make a user build. They need to be tested to ensure that they do not affect other build types, in particular the userdebug builds that are the default

Please add details of what testing has been done in comments

gwstorm commented 2 months ago

I'm giving this a go now, however, this is the only thing I use docker for, so I'm not well versed in it at all. Is it just a simple as changing the image to image: lineageos4microg/docker-lineage-cicd:nns-v21-spoofing-patches?

petefoth commented 2 months ago

Is it just a simple as changing the image to image: lineageos4microg/docker-lineage-cicd:nns-v21-spoofing-patches?

Yes. Just change the last statement in the docker run command to lineageos4microg/docker-lineage-cicd:nns-v21-spoofing-patches' instead of ``lineageos4microg/docker-lineage-cicd

gwstorm commented 2 months ago

Okay, I did that yesterday when I posted my first response and this is what I got -

API Error > The failing command was run inside an sbox sandbox in temporary directory > out/soong/.temp/sbox/dcabbf69fbe8e32ae16e786d21b129ef1759ab95 > The failing command line can be found in > out/soong/.temp/sbox/dcabbf69fbe8e32ae16e786d21b129ef1759ab95/sbox_command.0.bash > out/srcjars/android/Manifest.java:2770: error: New API must be flagged with @FlaggedApi: field android.Manifest.permission.FAKE_PACKAGE_SIGNATURE [UnflaggedApi] > out/srcjars/android/Manifest.java:6391: error: New API must be flagged with @FlaggedApi: field android.Manifest.permission_group.FAKE_PACKAGE [UnflaggedApi] > Error: metalava detected the following problems: > out/srcjars/android/Manifest.java:2770: error: New API must be flagged with @FlaggedApi: field android.Manifest.permission.FAKE_PACKAGE_SIGNATURE [UnflaggedApi] > out/srcjars/android/Manifest.java:6391: error: New API must be flagged with @FlaggedApi: field android.Manifest.permission_group.FAKE_PACKAGE [UnflaggedApi] > metalava wrote updated baseline to /srv/src/LINEAGE_21_0/out/soong/.temp/sbox/dcabbf69fbe8e32ae16e786d21b129ef1759ab95/./out/api_lint_baseline.txt > metalava wrote updated baseline to /srv/src/LINEAGE_21_0/out/soong/.temp/sbox/dcabbf69fbe8e32ae16e786d21b129ef1759ab95/./out/last_released_baseline.txt > ************************************************************ > Your API changes are triggering API Lint warnings or errors. > To make these errors go away, fix the code according to the > error and/or warning messages above. > > If it is not possible to do so, there are workarounds: > > 1. You can suppress the errors with @SuppressLint("") > where the is given in brackets in the error message above. > 2. You can update the baseline by executing the following > command: > (cd $ANDROID_BUILD_TOP && cp \ > "out/soong/.intermediates/frameworks/base/api/api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt" \ > "frameworks/base/core/api/lint-baseline.txt") > To submit the revised baseline.txt to the main Android > repository, you will need approval. > ************************************************************ > exit status 255

Here's my compose configuration just to make sure I'm doing what you want -

version: '3.9'
services:
    docker-lineage-cicd:
        environment:
            - BRANCH_NAME=lineage-21.0
            - DEVICE_LIST=lemonadep
            - SIGN_BUILDS=true
            - SIGNATURE_SPOOFING=restricted
            - WITH_GMS=true
            - INCLUDE_PROPRIETARY=true
            - OTA_URL=[redacted]
            - DELETE_OLD_ZIPS=2
        volumes:
            - '/mnt/cache/lineage/src:/srv/src'
            - '/mnt/cache/lineage/zips:/srv/zips'
            - '/mnt/cache/lineage/logs:/srv/logs'
            - '/mnt/cache/lineage/ccache:/srv/ccache'
            - '/mnt/cache/lineage/keys:/srv/keys'
            - '/mnt/cache/lineage/local_manifests:/srv/local_manifests'
        image: lineageos4microg/docker-lineage-cicd:nns-v21-spoofing-patches
FintasticMan commented 2 months ago

Not sure how that happened, that error shouldn't be possible on this branch. You should get the warning WARNING: Signature spoofing patches requested, but branch (lineage-21.0) does not support microG patches, but no errors. All I can imagine is that somehow it's still using the master docker image. Can you run docker images and see what images you have pulled? If you don't have the nns-v21-spoofing-patches one, run docker pull lineageos4microg/docker-lineage-cicd:nns-v21-spoofing-patches, and if you do see the latest one, maybe try docker rmi lineageos4microg/docker-lineage-cicd:latest.

gwstorm commented 2 months ago

Got it, I did have a lingering image that I've now removed. After removing that, I was getting this response from docker -

docker-lineage-cicd-1  | Set cache size limit to 50.0 GB
docker-lineage-cicd-1  | >> [Mon Apr 22 17:24:55 UTC 2024] Branch:  lineage-21.0
docker-lineage-cicd-1  | >> [Mon Apr 22 17:24:55 UTC 2024] Devices: lemonadep,
docker-lineage-cicd-1  | >> [Mon Apr 22 17:24:56 UTC 2024] (Re)initializing branch repository
docker-lineage-cicd-1  | >> [Mon Apr 22 17:24:57 UTC 2024] Copying '/srv/local_manifests/*.xml' to '.repo/local_manifests/'
docker-lineage-cicd-1  | >> [Mon Apr 22 17:24:57 UTC 2024] Syncing branch repository
docker-lineage-cicd-1  | >> [Mon Apr 22 17:26:27 UTC 2024] Calling git lfs pull disabled
docker-lineage-cicd-1  | /root/build.sh: line 299: frameworks_base_patch: unbound variable
docker-lineage-cicd-1 exited with code 1

Which does seem to reference signature spoofing

I doubt it will do anything, but in the mean time, I've just removed the src folder so I can make sure everything is fresh on my current attempt.

FintasticMan commented 2 months ago

ah ok, then we'll need to explicitly set the variable. usually it's not necessary, but i think we've got some options set in bash that don't allow using variables that are undeclared.

petefoth commented 2 months ago

They need to be tested to ensure that they do not affect other build types, in particular the userdebug builds that are the default

Please add details of what testing has been done in comments

Has anyone done any testing with this change (i.e. using the lineageos4microg/docker-lineage-cicd:nns-v21-spoofing-patches to make userdebug builds? I don't want to merge to master until that is done

gwstorm commented 2 months ago

Has anyone done any testing with this change (i.e. using the lineageos4microg/docker-lineage-cicd:nns-v21-spoofing-patches to make userdebug builds? I don't want to merge to master until that is done

I just finished a successful build and install. Everything is working here!

petefoth commented 2 months ago

I just finished a successful build and install. Everything is working here!

Thanks @gwstorm @FintasticMan @nnsee for your efforts in getting this one sorted.

Merged