pipa: clean up for official builds

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
This commit is contained in:
Abdulwahab Isam
2025-03-26 12:22:47 +03:00
parent 1bd780c5ee
commit 6bcd4574f5
2 changed files with 1 additions and 98 deletions

View File

@@ -39,8 +39,5 @@ TARGET_PREBUILT_BCR := false
TARGET_INCLUDE_MATLOG := true
PRODUCT_NO_CAMERA := false
# Build Type
LINEAGE_BUILDTYPE := IQ
PRODUCT_BUILD_PROP_OVERRIDES += \
BuildFingerprint=Xiaomi/pipa_global/pipa:13/RKQ1.211001.001/V816.0.7.0.UMZMIXM:user/release-keys

View File

@@ -154,88 +154,6 @@ apply_split_notifications_fix() {
return 0
}
# Function to update the Updater repository URL
apply_updater_repo_fix() {
local root_dir=$(pwd)
local target_dir="packages/apps/Updater"
local strings_file="app/src/main/res/values/strings.xml"
echo "==== Applying updater repository URL fix ===="
# Enter target directory
echo "Navigating to ${target_dir}..."
if ! cd "$target_dir"; then
echo "Error: Could not change to $target_dir directory"
cd "$root_dir"
return 1
fi
# Check if the file exists
if [ -f "$strings_file" ]; then
echo "Updating repository URL in ${strings_file}..."
# Replace the repository URL without creating a backup file
if grep -q "AxionAOSP/official_devices" "$strings_file"; then
echo "Changing AxionAOSP/official_devices to ai94iq/axion_official_devices"
sed -i 's#AxionAOSP/official_devices#ai94iq/axion_official_devices#g' "$strings_file"
# Commit the changes
git add .
git commit -m "Updated Updater repository URL to ai94iq/axion_official_devices"
echo "✓ Updater repository URL fix applied successfully"
else
echo "Repository URL pattern not found in $strings_file"
fi
else
echo "Strings file doesn't exist at $strings_file"
fi
# Return to root directory
cd "$root_dir"
return 0
}
# Function to update generate_json.sh to add IQ
modify_generate_json() {
local root_dir=$(pwd)
local target_dir="vendor/lineage"
local script_file="build/tools/generate_json.sh"
echo "==== Modifying generate_json.sh to add IQ tag ===="
# Enter target directory
echo "Navigating to ${target_dir}..."
if ! cd "$target_dir"; then
echo "Error: Could not change to $target_dir directory"
cd "$root_dir"
return 1
fi
# Check if the file exists
if [ -f "$script_file" ]; then
echo "Updating regex in ${script_file}..."
# Check if the file contains the pattern we want to modify
if grep -q "(COMMUNITY|OFFICIAL|UNOFFICIAL)" "$script_file"; then
echo "Adding IQ tag to the build type regex..."
sed -i 's#(COMMUNITY|OFFICIAL|UNOFFICIAL)#(COMMUNITY|IQ|OFFICIAL|UNOFFICIAL)#g' "$script_file"
# Commit the changes
git add .
git commit -m "Added IQ tag to generate_json.sh build type regex"
echo "✓ generate_json.sh modification applied successfully"
else
echo "Expected pattern not found in $script_file"
fi
else
echo "Script file doesn't exist at $script_file"
fi
# Return to root directory
cd "$root_dir"
return 0
}
# Main script execution starts here
ROOT_DIR=$(pwd)
DEVICE_PATH="${ROOT_DIR}/device/xiaomi/pipa"
@@ -266,16 +184,4 @@ apply_split_notifications_fix
# Make sure we're in the root directory
cd "$ROOT_DIR"
# Apply updater repository URL fix
apply_updater_repo_fix
# Make sure we're in the root directory
cd "$ROOT_DIR"
# Apply generate_json.sh modification
modify_generate_json
# Make sure we're in the root directory
cd "$ROOT_DIR"
echo "==== Patch application complete ===="
echo "==== Patch application complete ===="