Giter VIP home page Giter VIP logo

revanced-build-template's Introduction

Revanced Build

This repo template will allow you to build ReVanced using Github Actions. This will helps people who don't want to setup build environments on their machines.

Notes

  • The script will download the selected compatible version(see here) of Youtube on APKMirror, NOT latest official version on Google Play.
  • Under NO CIRCUMSTANCES any APKs will be uploaded to this repository to avoid DMCA.

How to setup

  1. Fork or create a new repository using this repository as a template (Guide). DO NOT FORK if you need to set the new repo to private.
  2. That's it! You can now build ReVanced using Github Actions.

Customize your build

If you wish to continue with the default settings, you may skip this step.

All supported ReVanced apps are built by default by the script. If you wish to modify this behaviour and build only the apps that you specify, edit the 'build.targets' file with your preferred text editor. For the apps that you wish to be built, set the value of variable associated with the app to "true". Any variable with a value that is not "true" will be skip the associated app from being built.

For example, if you wish to skip TikTok ReVanced from being built, change the value of TIKTOK_NONROOT to "false".

By default this will build ReVanced apps with ALL available patches. Follow this guide to exclude/customizing patches for your build.

The script also supports using patches from Inotia00's ReVanced Extended project. To enable support for this, set "EXTENDED_SUPPORT" to "true" in build.config. Bear in mind that this will also disable builds for apps other than YouTube and YouTube Music regardless of what value you've assigned. This is due to the fact that ReVanced Extended does not (yet) support apps other than the ones specified above.

How to build

  1. Go to Actions -> All workflows -> ReVanced Build (Example)
  2. Run the build workflow (try to use experimental_build if the logs show not all patches applied correctly while revanced is not yet released)
  3. Download the APKs from the draft releases (Example)

revanced-build-template's People

Contributors

caio99br avatar chicos123 avatar koenhendriks avatar lyceris-chan avatar manorsailor avatar matadorprobr avatar n0k0m3 avatar ronin08 avatar sawankumarbundelkhandi avatar seefood avatar serph91p avatar taalojarvi avatar what-zit-tooya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

revanced-build-template's Issues

Update to new changes of ReVanced

ReVanced had quite a lot of changes in the past couple of days. You will probably need to update the script. See the official docs for information about the changes.

fork vs. template

I have cloned thsi repo as template, then if there in an update from you, how to update to my repo?
Usually i can update it if i fork the repo
Or can i fork but without contribution? Im new on github and coding

Spotify

Since revanced group is also doing spotify would you mind adding the spotify to your code? So that we can build revanced spotify.

Explicit include and exclude patches

Revanced patcher now has both including and excluding patches. Some patches are included by default but there are some that needs to be included explicitly.

We need to modify the script to read from patches.txt in a way that can do both exclude and include in a same file

Running locally, script needs to assert JDK v17 minimum

java -jar revanced-cli.jar -m revanced-integrations.apk -b revanced-patches.jar --mount \

check jkava --version and warn the user if JDK is too old.
on my home Ubuntu, for instance, I had to upgrade to JDK17 and the headless version is not enough, it looks for AWT so it needs the full JDK.

if you want me to fork and PR, I can do it too, and fix up a pre-commit config on the way. LMK.

?

I'm not sure if it's just me, but whenever I fork this project now I have to set up permissions for read and write to the actions, otherwise I get this: Resource not accessible by integration. (Before I didn't need to, maybe it would be good to create a tutorial on how to set up permissions. I'm not sure.)

Error: Resource not accessible by integration

Run marvinpinto/action-automatic-releases@latest

Initializing the Automatic Releases action
Determining release tags
Retrieving commit history
Determining state of the previous release
Searching for SHA corresponding to previous "tags/latest" release tag
Could not find SHA corresponding to tag "tags/latest" (Not Found). Assuming this is the first release.
Retrieving commits between HEAD and 1217f8393b7e3ef402e00d56f7a4ba5d173eae1a
Successfully retrieved 0 commits between HEAD and 1217f8393b7e3ef402e00d56f7a4ba5d173eae1a
Generating changelog
Generating release tag
Attempting to create or update release tag "latest"
Could not create new tag "refs/tags/latest" (Resource not accessible by integration) therefore updating existing tag "tags/latest"
Error: Resource not accessible by integration
(node:2048) UnhandledPromiseRejectionWarning: HttpError: Resource not accessible by integration
at /home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:361954
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:2048) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2048) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Update patches and their descriptions

The ReVanced team has added some new patches and modified the description of a couple older patches, I went ahead and updated them to match revanced/revanced-patches v2.9.2.

See #24

Other download sources

Add other download sources other then uptodown as uptodown has not the updated version of YouTube. Or add something so that we can manually add and upload original YouTube apk then we can run actions to generate revanced apk

Build failed

It says 'invalid URL' while downloading from uptodown.

Getting some warnings while the app is being built

WARNING: Skipping music-video-ads: Incompatible with com.google.android.youtube. This patch is only compatible with com.google.android.apps.youtube.music
WARNING: Skipping exclusive-audio-playback: Incompatible with com.google.android.youtube. This patch is only compatible with com.google.android.apps.youtube.music
WARNING: Skipping codecs-unlock: Incompatible with com.google.android.youtube. This patch is only compatible with com.google.android.apps.youtube.music
WARNING: Skipping background-play: Incompatible with com.google.android.youtube. This patch is only compatible with com.google.android.apps.youtube.music
WARNING: Skipping tasteBuilder-remover: Incompatible with com.google.android.youtube. This patch is only compatible with com.google.android.apps.youtube.music
WARNING: Skipping upgrade-button-remover: Incompatible with com.google.android.youtube. This patch is only compatible with com.google.android.apps.youtube.music

How to keep 'forked'/template-based clone of repo up to date?

I have a question on how this template works.

It seems that once I create a repo off the template, my private project is based on your old codebase and is not considered an fork where I can pull the latest changes from. From what I see in the code, the versions it grabs are based on the versions.json from my cloned copy of your project, not yours. Am I correct?

I tried experimenting with a Github bot called Pull. Sadly my clone is not considered a fork anymore so it cannot pull from your changes. Also does this rely on you manually updating the recommended versions by hand or does this scrape that info via the actions and shell scripts on activation?

Keystore file

Can somebody please explain how to use the same keystore and not produce a new one everytime.

Root version doesn't work

Whenever I install root version apk, the parsing problem error is thrown.

Could you please support for root version?

Excluded Patches are applying anyways

I edited my patches.txt file to exclude some patches but they are applying as shown on the workflow log
Its something wrong with my file or the script?
I tried both, Build and Experimental

imagen

imagen

imagen

Support for revance extended patches

would be cool to have support for the extended version of revance, this could be theoretically by adding an optional setting on build.targets something like EXTENDED_SUPPORT="false"

Choosing app & variant before building

Hey @n0k0m3 . I have been working on a feature to allow user the ability to choose which app they want to build (Yt ot ytm) & also which variant they want to build (root or non root). You can see the progress here. I am opening this issue to understand how this feature can be better implemented and also to receive your feedback on stuff you would like to see changed. If you feel like it's alright, I will open a PR

Let me know what you think.

Can't compile Revance APK

once i click on the actions build i get this error org.jf.dexlib2.dexbacked.DexBackedDexFile$NotADexFile: Not a valid dex magic value: 3c 21 44 4f 43 54 59 50

Does this always pull the latest revanced patch ?

Hi,
I am sort of new and i don't actually understand how this script always get the latest revanced patch from their repo

get_artifact_download_url() {
    # Usage: get_download_url <repo_name> <artifact_name> <file_type>
    local api_url result
    api_url="https://api.github.com/repos/$1/releases/latest"
    # shellcheck disable=SC2086
    result=$(curl -s $api_url | jq ".assets[] | select(.name | contains(\"$2\") and contains(\"$3\") and (contains(\".sig\") | not)) | .browser_download_url")
    echo "${result:1:-1}"
}

When i run this in actions, It would be helpful to display the version of the artifacts being downloaded instead of showing

Downloading revanced-patches.jar
Downloading revanced-integrations.apk
Downloading revanced-cli.jar

Better show

Downloading revanced-patches-(2.42.0).jar
Downloading revanced-integrations-(0.36.0).apk
Downloading revanced-cli-(2.9.3).jar

in the Runtime

Download from APKMirror

Saw the issue about cloudflare rate limiting #14

Try this apkmirror download script.
Looks like they solved the problem.
https://github.com/j-hc/revanced-magisk-module/blob/main/utils.sh

The code below is simply copied

[Source from - https://github.com/j-hc/revanced-magisk-module]

WGET_HEADER="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"

req() { wget -nv -O "$2" --header="$WGET_HEADER" "$1"; }

get_apk_vers() { req "$1" - | sed -n 's;.*Version:</span><span class="infoSlide-value">\(.*\) </span>.*;\1;p'; }

get_largest_ver() {
	local max=0
	while read -r v || [ -n "$v" ]; do
		if [[ ${v//[!0-9]/} -gt ${max//[!0-9]/} ]]; then max=$v; fi
	done
	if [[ $max = 0 ]]; then echo ""; else echo "$max"; fi
}

dl_apk() {
	local url=$1 regexp=$2 output=$3
	url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n "s/href=\"/@/g; s;.*${regexp}.*;\1;p")"
	echo "$url"
	url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
	url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
	req "$url" "$output"
}

dl_youtube() {
	echo "Downloading YouTube"
	local last_ver
	last_ver="17.29.34"
	last_ver="${last_ver:-$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=youtube" | get_largest_ver)}"

	echo "Choosing version '${last_ver}'"
	local base_apk="com.google.android.youtube.apk"
	if [ ! -f "$base_apk" ]; then
		declare -r dl_url=$(dl_apk "https://www.apkmirror.com/apk/google-inc/youtube/youtube-${last_ver//./-}-release/" \
			"APK</span>[^@]*@\([^#]*\)" \
			"$base_apk")
		echo "YouTube version: ${last_ver}"
		echo "downloaded from: [APKMirror - YouTube]($dl_url)"
	fi
}

Workflow ReVanced Test Build runs
https://github.com/Chicos123/revanced-build-template/runs/7743417099

change package name

if we build manually from revanced patches then the package name is different, but with this tool, package name is set to the original one. And it is impossible to update the app on non rooted device. Please tell me how can i change package name to app.revanced.android.youtube.

feature request

can u make the process of apk (yt, yt music) downloading from apk mirror & uploading to github automated? it'll be much faster to build.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.