Skip to content

Commit

Permalink
Allow overriding product brand and device
Browse files Browse the repository at this point in the history
Change-Id: Ie7df167a5390d02e76a968cd780a04f69b9486dc
  • Loading branch information
mikeNG authored and luk1337 committed Feb 28, 2023
1 parent ec2e09f commit 1199fa0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ int main(int argc, char *argv[]) {
const auto build_version_release_or_codename = config.find("BUILD_VERSION_RELEASE_OR_CODENAME");
const auto debuggable = config.find("DEBUGGABLE");
const auto manufacturer_name = config.find("MANUFACTURER_NAME");
const auto product_brand = config.find("PRODUCT_BRAND");
const auto product_device = config.find("PRODUCT_DEVICE");
const auto product_model = config.find("PRODUCT_MODEL");
const auto product_name = config.find("PRODUCT_NAME");

Expand Down Expand Up @@ -128,6 +130,14 @@ int main(int argc, char *argv[]) {
manufacturer_name->second.c_str());
}

if (is_init_stage && product_brand != config.end()) {
property_override(property_list("ro.product.", "brand"), product_brand->second.c_str());
}

if (is_init_stage && product_device != config.end()) {
property_override(property_list("ro.product.", "device"), product_device->second.c_str());
}

if (is_init_stage && product_model != config.end()) {
property_override(property_list("ro.product.", "model"), product_model->second.c_str());
}
Expand Down
2 changes: 2 additions & 0 deletions system/etc/ih8sn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
# BUILD_VERSION_RELEASE_OR_CODENAME=10
# DEBUGGABLE=0
# MANUFACTURER_NAME=OnePlus
# PRODUCT_BRAND=OnePlus
# PRODUCT_DEVICE=OnePlus7Pro
# PRODUCT_MODEL=GM1913
# PRODUCT_NAME=OnePlus7Pro

0 comments on commit 1199fa0

Please sign in to comment.