[Samsung Galaxy A70 ROMs, Kernels, Recoveries, & Ot] kirbyNx:
Universal ROM One UI for any Galaxy A:

Hello guys, this time I bring you something different... it is a zip to convert stock to rom, this project is based on Dynamic Installer.

I am not responsible for damaged phones, install at your own risk.

Dynamic Installer: https://xdaforums.com/t/zip-dual-in...1-android-10-or-earlier.4279541/post-85046055

Features:

Spoiler content hidden.

Installation:

This zip is meant to install from stock, if you have any problems please send it to me Universal_ROM_v2.x.log and recovery.log too, If it's a problem with the debloat send me too:

/sdcard/blacklist.txt

/Sdcard/packages.txt

Have stock One UI installed

Make a backup of the partitions (optional)

Just flash via recovery (TWRP recommended)

Format data

Reboot system

Downloads:

Version 2.1.1:

MD5: aa4e1555a5911b38687acd87568ce0af

AndroidFileHost: Download

Version 2.1.2:

MD5: 70607d913bd219018bea53321be43c5c

AndroidFileHost: Download

Version 2.1.3:

MD5: 4c24c7c2a0c22eb3678af6664ae02108

AndroidFileHost: Download

Version 2.1.4:

MD5: 83c658902ef14b675da9c61223fcca88

AndroidFileHost: Download

Version 2.1.5:

MD5: 8a91a604a7a3079571e7d25d93f8c38a

AndroidFileHost: Download

Version 2.2:

MD5: c4b8a62e229733b47ab73206e773ca36

AndroidFileHost: Download

Version 2.2.1:

MD5: 98696b8a42b7c02880891ec60c783c34

AndroidFileHost: Download

Version 2.2.1-b:

MD5: dbe0fd10d866ca8e2839de72cb7c1629

AndroidFileHost: Download

Credits:

@Gollo99 - Help and tips

@Nico04 - Help and tips

@3arthur6 - Fixed bluetooth pairing

@ShaDisNX255 - Mods

@BlassGO - Dynamic installer.

Thanks to all the users who tested

Paypal:

Paypal.me ...

if you want to support the project 👼

Telegram:

Channel: t.me/Swx...

XDA:

DevDB Information

Universal, ROM for any Samsung Galaxy A

ROM OS Version: Android 11

Based on: ONE UI

Version Information

Status: Stable

Current Stable Versionl: 2.2.1-b

Stable Release Date: 2021-11-30

Edit the zip

Something I like about using this zip is that you can edit it according to your tastes or needs. I will show you how (Dynamic Installer Based Script Codes)

- Debloat:

You just have to add or delete the name of the apks that you want to be deleted during the installation in:

Apk name: "Universal ROM One UI v2.x.zip/META-INF/addons/blacklist.txt"

Apk package name: "Universal ROM One UI v2.x.zip/META-INF/addons/blacklist_packages.txt"

Script code:

#Debloat normal
setdefault debloat_paths "

/system/app
/system/priv-app
/product/app
/product/priv-app

"

#Check IF AAPT WORKS
if ! can_run aapt; then
savelog "AAPT: FAIL"
else
savelog "AAPT: WORKS"
fi

#Start
apps=0
bloat=0

delete "$TMP/userlist.txt"
delete "$TMP/packages.txt"

for search in $debloat_paths; do
for userlist in $(find $search -type f -name "*.apk"); do
package=$(apk_package "$userlist")
echo "$userlist" >> "$TMP/userlist.txt"
echo "$(basename "$userlist")=$package" >> "$TMP/packages.txt"
export apps=$(($apps + 1))
done
done

#CAt debloat list
cat "$TMP/userlist.txt" > /sdcard/userlist.txt
cat "$TMP/packages.txt" > /sdcard/packages.txt

#Debloat blacklist.txt
for blacklist in $(cat "$addons/blacklist.txt"); do
black=$(grep -m1 "$blacklist" "$TMP/userlist.txt")
if defined black && exist "$black"; then
delete_recursive "$black"
if ! exist "$black"; then
export bloat=$(($bloat + 1))
package=$(get_file_prop $TMP/packages.txt "$(basename "$black")")
savelog " removed:blacklist:$bloat: package=$package path=$black"
huh=$(string escape "$(basename "$black")")
sed -i "/$huh/d" "$TMP/userlist.txt"
sed -i "/$huh/d" "$TMP/packages.txt"
else
savelog " -- CANT DELETE: $(basename "$black") "
fi
fi
done

#Debloat blacklist_packages.txt
for blackpack in $(cat "$addons/blacklist_packages.txt"); do
black=$(grep -m1 "$blackpack" "$TMP/packages.txt" | cut -d '=' -f1)
[ -z "$black" ] && continue
black=$(grep -m1 "$black" $TMP/userlist.txt)
if defined black && exist "$black"; then
delete_recursive "$black"
if ! exist "$black"; then
export bloat=$(($bloat + 1))
package=$(get_file_prop $TMP/packages.txt "$(basename "$black")")
savelog " removed:blacklist:$bloat: package=$package path=$black"
huh=$(string escape "$(basename "$black")")
sed -i "/$huh/d" "$TMP/userlist.txt"
sed -i "/$huh/d" "$TMP/packages.txt"
else
savelog " -- CANT DELETE: $(basename "$black") "
fi
fi
done

#end of debloat
ui_print " -- Removed $bloat of $apps applications"

- Decode OMC and csc features

Edit the following .xml files which are the features that will be added

cscfeatures.xml: "Universal ROM One UI v2.x.zip/omc/cscfeatures.xml"

cscfeatures_network.xml: "Universal ROM One UI v2.x.zip/omc/cscfeatures_network.xml"

Script code:

#OMC
try_mount -e -rw /odm

#Check if dalvikvm work
run_jar_addon omc-decoder.jar > /dev/null || abort " CANT USE: run_jar: dalvikvm not available"

#Getting OMC type
if exist /system_root/optics/configs /system_root/prism/etc; then ported=true
elif exist /optics /prism; then newdevice=true
elif exist "$(find /product -type d -name "omc")" || exist "$(find /odm -type d -name "omc")"; then partdevice=true
elif exist "$(find /system -type d -name "omc")" || exist /system/csc; then olddevice=true
fi

#Getting OMC path
if defined newdevice; then
try_mount -rw -e /optics || abort " CANT MOUNT: /optics "
omc_path=/optics
elif defined partdevice; then
for omc in /product /odm; do
tryomc=$(find "$omc" -type f -name "cscfeature.xml" | head -n1)
if defined tryomc; then
if is_substring "/conf/" "$tryomc"; then
conf=true
omc_path=$(dirname "$(dirname "$(dirname "$tryomc")")")
else
omc_path=$(dirname "$(dirname "$tryomc")")
fi
fi
done
elif defined olddevice; then
if exist /system/csc; then
omc_path=/system/csc
else
tryomc=$(find /system -type f -name "cscfeature.xml" | head -n1)
if defined tryomc; then
omc_path=$(dirname "$(dirname "$tryomc")")
fi
fi
fi

#Decode All cscfeature.xml cscfeature_network.xml
error=0
ui_print " -- Decoding: $omc_path"
while read csc; do
if undefined csc; then abort "CANT FIND VALID PATH"; fi
if ! run_jar_addon omc-decoder.jar -d -i "$csc" -o "$csc"; then echo2 "CANT DECODE: $csc" && error=$(calc $error + 1); fi
done <<< $(find "$omc_path" -type f -name cscfeature.xml -o -name cscfeature_network.xml)

#Check results
if [[ "$error" != "0" ]]; then
abort " -- The installation had: $error ERRORs "
fi

#CSC Features
ui_print " -- Adding csc features... "
package_extract_dir omc "$TMP/omc"

#Get custom cscfeature.xml cscfeature_network.xml
base_csc=$(cat "$TMP/omc/cscfeature.xml")
base_network=$(cat "$TMP/omc/cscfeature_network.xml")

#Editing cscfeature.xml
for csc in $(find $omc_path -type f -name cscfeature.xml); do
content=$(string -f "$csc" extract '<FeatureSet>' '</FeatureSet>')
if defined content; then
replace "$content" "$base_csc" "$csc"
else
echo2 "CANT GET CONTENT: $csc"
fi
done

#Editing cscfeature_network.xml
for csc in $(find $omc_path -type f -name cscfeature_network.xml); do
content=$(string -f "$csc" extract '<FeatureSet>' '</FeatureSet>')
if defined content; then
replace "$content" "$base_network" "$csc"
else
echo2 "CANT GET CONTENT: $csc"
fi
done

#Remove enforcedeletepackage.txt enforceskippingpackages.txt
find $omc_path -type f -name enforcedeletepackage.txt -delete
find $omc_path -type f -name enforceskippingpackages.txt -delete

- Floating Features

Edit the following file to add the features to floating features (It does not matter if the line already exists in the stock file, it will be omitted)

Floating_Features.xml: "Universal ROM One UI v2.x.zip/META-INF/addons/floating.txt"

Script code:

#Floating features
ui_print " -- Adding Features... "
update_file_string '<SEC_FLOATING_FEATURE_FRAMEWORK_CONFIG_AOD_ITEM>aodversion=7,clearcoveroff,clocktransition</SEC_FLOATING_FEATURE_FRAMEWORK_CONFIG_AOD_ITEM>' /vendor/etc/floating_feature.xml
force_update_file_addon floating.txt /vendor/etc/floating_feature.xml

- Tweaks build.prop

You can add or remove tweaks in the following files (in the same way as floating, if the line already exists it will be omitted)

/system/build.prop: "Universal ROM One UI v2.x.zip/META-INF/addons/newprops.txt"

/vendor/build.prop: "Universal ROM One UI v2.x.zip/META-INF/addons/vendorprops.txt"

Script code:

#Define common files
if exist /system/build.prop; then
system_build="/system/build.prop"
else
abort "FATAL ERROR: Failed to find system partition "
fi

if exist /vendor/build.prop; then
vendor_build="/vendor/build.prop"
else
abort "FATAL ERROR: Failed to find vendor partition "
fi

#build.prop
update_file_string 'ro.build.display.id=Universal ROM One UI v2.2.1-b' $system_build
replace "ro.config.tima=1" "ro.config.tima=0" $system_build
update_file_string 'ro.config.dmverity=false' $system_build
force_update_file_addon newprops.txt $system_build
force_update_file_addon vendorprops.txt $vendor_build
update_file_string 'restore.feature.use_samsung_smart_switch_flow=0' /system/etc/prop.default

- Extra script codes

Flag Secure

ui_print " "
ui_print " You want the patch for Flag Secure? "
press
if $yes; then
ui_print " -- Flag secure will be disabled"
flag=true
else
ui_print " -- Flag secure will not be disabled"
fi

#Flag secure
disable='
.locals 1

const/4 v0, 0x0

return v0
'

if defined flag; then
stock_services="/system/framework/services.jar"
mod_services="/system/framework/services.jar"
if ! unzip -l "$stock_services" | grep classes.dex >/dev/null; then
abort " You need a deodexed services.jar"
fi
ui_print " -- Decompiling services.jar... "
apktool -f d "$stock_services" -o "$TMP/services"
ui_print " -- Disabling Flag Secure... "
smali_kit -c -m "isSecureLocked()Z" -re "$disable" -d "$TMP/services"
smali_kit -c -m "preventTakingScreenshotToTargetWindow" -re "$disable" -d "$TMP/services"
ui_print " -- Recompiling services.jar (Please wait)..."
apktool --copy-original -f b "$TMP/services" -o "$mod_services"
if [ ! -e "$mod_services" ]; then
abort " -- Some ERROR occurred during the recompilation of services.jar ! "
elif ! unzip -l "$mod_services" | grep classes.dex >/dev/null; then
abort " -- Invalid file: services.jar "
fi
fi

Outdoor mode

ui_print " "
ui_print " -- You want mod of Outdoor mode? "
press
if $yes; then
outdoor=true
ui_print " -- Outdoor mode will be enabled"
else
ui_print " -- Outdoor mod will not apply"
fi

#Outdoor mode
enable='
.locals 1

const/4 v0, 0x1

return v0
'

if defined outdoor; then
ui_print " -- Finding SecSettings.apk"
SecSettings=$(find_apk com.android.settings /system)
if undefined SecSettings; then
abort " CANT FIND: SecSettings.apk"
fi
ui_print " -- Decompiling SecSettings.apk"
dynamic_apktool -decompile "$SecSettings" -output "$TMP/Settings"
ui_print " -- Enabling outdoor mode..."
smali_kit -c -m "isAvailable" -remake "$enable" -dir "$TMP/Settings" -name "SecOutDoorModePreferenceController"
ui_print " -- Recompiling SecSettings.apk (Please wait)..."
dynamic_apktool -preserve-signature -recompile "$TMP/Settings" -output "$SecSettings"
if ! is_valid "$SecSettings"; then
abort "Some error in the SecSettings.apk recompilation"
fi
fi

ThemeCenter Patch

ui_print " "
ui_print " -- You want mod of ThemeCenter Patch? "
press
if $yes; then
themes=true
ui_print " -- The mod will be applied"
else
ui_print " -- Mod will not apply"
fi

#ThemesCenter mod
dummy='
.registers 5
return-void
'

if defined themes; then
ui_print " -- Finding ThemeCenter.apk"
ThemesCenter=$(find_apk com.samsung.android.themecenter /system)
if undefined ThemesCenter; then
abort " CANT FIND: ThemesCenter.apk"
fi
ui_print " -- Decompiling ThemeCenter.apk"
dynamic_apktool -decompile "$ThemesCenter" -output "$TMP/Center"
ui_print " -- Patching ThemeCenter.apk..."
smali_kit -c -m "setTrialExpiredPackage" -remake "$dummy" -d "$TMP/Center"
smali_kit -c -m "setAlarm" -remake "$dummy" -d "$TMP/Center"
ui_print " -- Recompiling ThemeCenter.apk (Please wait)..."
dynamic_apktool -preserve-signature -recompile "$TMP/Center" -output "$ThemesCenter"
if ! is_valid "$ThemesCenter"; then
abort "Some error in the ThemesCenter.apk recompilation"
fi
fi

permission when installing apps

ui_print " "
ui_print " -- You want remove permission when installing apps? "
press
if $yes; then
permission=true
ui_print " -- The mod will be applied"
else
ui_print " -- Mod will not apply"
fi

#permission when installing apps
disabledd='
.registers 6

invoke-direct {p0}, Lcom/android/packageinstaller/PackageInstallerActivity;->initiateInstall()V

return-void
'

if defined permission; then
ui_print " -- Finding GooglePackageInstaller.apk "
googleinstaller=$(find_apk com.google.android.packageinstaller /system)
if undefined googleinstaller; then
abort " CANT FIND: GooglePackageInstaller.apk"
fi
ui_print " -- Decompiling GooglePackageInstaller.apk"
dynamic_apktool -decompile "$googleinstaller" -output "$TMP/googleinstaller"
ui_print " -- Removing permission when installing apps..."
smali_kit -c -m "checkIfAllowedAndInitiateInstall" -remake "$disabledd" -dir "$TMP/googleinstaller" -name "PackageInstallerActivity"
ui_print " -- Recompiling GooglePackageInstaller.apk (Please wait)..."
dynamic_apktool -preserve-signature -recompile "$TMP/googleinstaller" -output "$googleinstaller"
if ! is_valid "$googleinstaller"; then
abort "Some error in the GooglePackageInstaller.apk recompilation"
fi
fi

fstab file (encryption storage)

#fstab
for fstab in $(find /vendor/etc -type f -name "fstab.*"); do
if $(cat "$fstab" | grep -q "encryptable=ice"); then
savelog "device no encrypt"
else
ui_print " -- Patching $fstab... "
replace "fileencryption" "encryptable" $fstab
fi
done