Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Install UV
run: |
UV_VERSION=$(cat ./requirement-uv.txt | awk -F'==' '{print $2}' | tr -d ' \n')
UV_VERSION=$(cat ./uv-version.txt | tr -d ' \n')
curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh

- name: Record original PATH
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

- name: Install UV
run: |
UV_VERSION=$(cat ./requirement-uv.txt | awk -F'==' '{print $2}' | tr -d ' \n')
UV_VERSION=$(cat ./uv-version.txt | tr -d ' \n')
curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh

- name: Get Current Version
Expand Down
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# basic
# general
__pycache__
/dist
.venv
Expand All @@ -8,15 +8,18 @@ __pycache__
.ruff_cache
.ropeproject

# git subrepos
# misc
.DS_Store

# subrepos
/android_*
/*_kernel_*
/clang*
/rtl8812au
/AnyKernel3
/KernelSU

# misc local artifacts
# local artifacts
/*.log
/kernel
/assets
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ job-build:
- docker:dind
script:
- apk update && apk add python3 py3-pip
- python3 -m pip install -r requirement-uv.txt --break-system-packages
- python3 -m pip install uv==$(cat ./uv-version.txt | tr -d ' \n') --break-system-packages
- uv sync --frozen --no-install-project
- source .venv/bin/activate
- export PYTHONPATH=$(pwd)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN \
# This significantly reduces the total build time, as each time we make a build call for a device,
# only device-specific kernel source is being downloaded into the container.
#
RUN curl -LsSf https://astral.sh/uv/$(cat ./requirement-uv.txt | awk -F'==' '{print $2}' | tr -d ' \n')/install.sh | sh && \
RUN curl -LsSf https://astral.sh/uv/$(cat ./uv-version.txt | tr -d ' \n')/install.sh | sh && \
. $HOME/.local/bin/env && \
uv sync --frozen --no-install-project && \
uv run ${WDIR}/zkb/utils/bridge.py --shared
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# zero_kernel
# zero-kernel

An advanced Android kernel builder with assets collection and Kali NetHunter support.

## Contents

- [zero\_kernel](#zero_kernel)
- [zero-kernel](#zero-kernel)
- [Contents](#contents)
- [**Important**](#important)
- [Description](#description)
Expand Down Expand Up @@ -123,7 +123,7 @@ To run this tool in a `local` environment, you will need:

```sh
# install uv version from project file
python3 -m pip install -r requirement-uv.txt
python3 -m pip install uv==$(cat ./uv-version.txt | tr -d ' \n')
# make zkb/ internal imports visible to itself
export PYTHONPATH=$(pwd)
# prepare and activate dev environment
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ZeroKernelConan(ConanFile):
author = "seppzer0"
url = "https://gitlab.com/api/v4/projects/40803264/packages/conan"
description = "An advanced Android kernel builder with Kali NetHunter support."
topics = ("zero_kernel", "kali-nethunter", "nethunter")
topics = ("zero-kernel", "kali-nethunter", "nethunter")
settings = None
options = {
"base": {"los", "pa", "x", "aosp"},
Expand Down
8 changes: 6 additions & 2 deletions docs/FLASHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Before doing anything, please ensure that you have:
- open NetHunter app (if seeing a Busybox-related error, press "OK" and re-open the app);
- navigate to the `Kali Chroot Manager` submenu and install the chroot (if you downloaded it beforehand, use the "restore" option);
- make sure that your NetHunter and NetHunter Terminal apps are properly configured to see the installed chroot directory (by default it may be `/data/local/nhsystem/kalifs`; if you see it anywhere, change it to `/data/local/nhsystem/kali-arm64`);
- in NetHunter Terminal app open `Kali` shell (if it opens properly, then congratulations, you have a working Kali NetHunter on your device).
- in NetHunter Terminal app open `Kali` shell (if it opens properly, then congratulations, you have a working Kali NetHunter on your device);
- unlock Developer Options in Settings;
- toggle "Wi-Fi non-persistent MAC randomisation" option or similar.

#### For KernelSU users

Expand All @@ -77,7 +79,9 @@ Before doing anything, please ensure that you have:
- open the NetHunter app (if seeing a Busybox-related error, press "OK" and re-open the app);
- navigate to the `Kali Chroot Manager` submenu and install the chroot (if you downloaded it beforehand, use the "restore" option);
- make sure that your NetHunter and NetHunter Terminal apps are properly configured to see the installed chroot directory (by default it may be `/data/local/nhsystem/kalifs`; if you see it anywhere, change it to `/data/local/nhsystem/kali-arm64`);
- in NetHunter Terminal app open `Kali` shell (if it opens properly, then congratulations, you have a working Kali NetHunter on your device).
- in NetHunter Terminal app open `Kali` shell (if it opens properly, then congratulations, you have a working Kali NetHunter on your device);
- unlock Developer Options in Settings;
- toggle "Wi-Fi non-persistent MAC randomisation" option or similar.

#### For x_kernel-based kernel + ParanoidAndroid users

Expand Down
8 changes: 3 additions & 5 deletions docs/architecture/clients/classes.puml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
@startuml classes
set namespaceSeparator none
class "GithubApiClient" as clients.github.GithubApiClient {
direct_url : str
endpoint : str
file_filter : Optional[str]
project : str
run() -> str | None
}
class "LineageOsApiClient" as clients.los.LineageOsApiClient {
endpoint : str
json_key : str
rom_name : str
rom_name
}
class "ParanoidAndroidApiClient" as clients.pa.ParanoidAndroidApiClient {
endpoint : str
json_key : str
rom_name : str
rom_name
map_codename() -> str
}
class "RomApiClient" as clients.rom_api.RomApiClient {
codename : str
endpoint : str
json_key : str
rom_name : str
rom_name
rom_only : bool
map_codename() -> str
run() -> str
Expand Down
14 changes: 7 additions & 7 deletions docs/architecture/commands/classes.puml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
@startuml classes
set namespaceSeparator none
class "AssetsCommand" as commands.assets.AssetsCommand {
assets_collector : AssetsCollector
assets_collector
execute() -> None
}
class "BundleCommand" as commands.bundle.BundleCommand {
assets_collector : AssetsCollector
assets_collector
base : str
kernel_builder : KernelBuilder
package_type : str
build_kernel(rom_name: str, clean_only: Optional[bool]) -> None
collect_assets(rom_name: str, chroot: Literal['full', 'minimal']) -> None
kernel_builder
package_type : Iterable[EnumPackageType]
build_kernel(clean_only: Optional[bool]) -> None
collect_assets() -> None
conan_options(json_file: str) -> dict
conan_package(options: tuple[str, ...], reference: str) -> None
conan_sources() -> None
conan_upload(reference: str) -> None
execute() -> None
}
class "KernelCommand" as commands.kernel.KernelCommand {
kernel_builder : KernelBuilder
kernel_builder
execute() -> None
}
@enduml
9 changes: 6 additions & 3 deletions docs/architecture/configs/classes.puml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
set namespaceSeparator none
class "ArgumentConfig" as configs.argument.ArgumentConfig {
base : str
benv : Literal['docker', 'podman', 'local']
benv
chroot : Optional[str]
clean_assets : Optional[bool]
clean_image : Optional[bool]
clean_kernel : Optional[bool]
codename : str
command : Literal['kernel', 'assets', 'bundle']
command
conan_upload : Optional[bool]
defconfig : Optional[Path]
ksu : Optional[bool]
lkv : Optional[str]
package_type : Optional[str]
package_type : Optional[EnumPackageType]
rom_only : Optional[bool]
check_settings() -> None
}
Expand All @@ -23,4 +23,7 @@ class "DirectoryConfig" as configs.directory.DirectoryConfig {
kernel : Path
root : Path
}
class "ModelConfig" as configs.model.ModelConfig {
model_config
}
@enduml
3 changes: 3 additions & 0 deletions docs/architecture/configs/packages.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ package "configs.argument" as configs.argument {
}
package "configs.directory" as configs.directory {
}
package "configs.model" as configs.model {
}
configs --> configs.argument
configs --> configs.directory
configs --> configs.model
@enduml
4 changes: 2 additions & 2 deletions docs/architecture/core/classes.puml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set namespaceSeparator none
class "AssetsCollector" as core.assets_collector.AssetsCollector {
assets : list
base : str
chroot : Optional[Literal['full', 'minimal']]
chroot : Optional[EnumChroot]
clean_assets : bool
codename : str
ksu : bool
Expand All @@ -20,7 +20,7 @@ class "KernelBuilder" as core.kernel_builder.KernelBuilder {
ksu : bool
lkv : str
lkv_src : str
rmanager : ResourceManager
rmanager
build() -> None
clean_build() -> None
create_zip() -> None
Expand Down
6 changes: 3 additions & 3 deletions docs/architecture/engines/classes.puml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
set namespaceSeparator none
class "GenericContainerEngine" as engines.generic_container.GenericContainerEngine {
base : str
benv : Literal['docker', 'podman']
benv
builder_cmd : str
chroot : Optional[Literal['full', 'minimal']]
chroot : Optional[EnumChroot]
clean_assets : Optional[bool]
clean_image : Optional[bool]
clean_kernel : Optional[bool]
codename : str
command : Literal['kernel', 'assets', 'bundle']
command
conan_upload : Optional[bool]
container_options : list[str]
defconfig : Optional[Path]
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[project]
name = "zero-kernel-builder"
version = "0.6.4"
version = "0.6.5"
description = "Advanced Android kernel builder with Kali NetHunter support."
authors = [{name = "seppzer0"}]
readme = "README.md"
requires-python = ">=3.12"

[project.urls]
Repository = "https://github.com/seppzer0/zero_kernel"
Documentation = "https://github.com/seppzer0/zero_kernel/blob/main/README.md"
Repository = "https://github.com/seppzer0/zero-kernel"
Documentation = "https://github.com/seppzer0/zero-kernel/blob/main/README.md"

[project.scripts]
zkb = "zkb.__main__:main"
Expand Down
1 change: 0 additions & 1 deletion requirement-uv.txt

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/multi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def parse_args() -> argparse.Namespace:
def rmove(src: Path, dst: Path) -> None:
"""Recursively move files from one directory to another.

:param Path src: Source path.
:param Path dst: Destination path.
:param pathlib.Path src: Source path.
:param pathlib.Path dst: Destination path.
:return: None
"""
# for a directory
Expand Down
1 change: 1 addition & 0 deletions uv-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.10.7
Loading