Revert "matisse-common: update fingerprints and libinit"

This reverts commit dc654177d3.
This commit is contained in:
matteo0026 2020-05-15 21:59:37 +02:00 committed by DJABhipHop
parent dc654177d3
commit 0adbc0293b
3 changed files with 107 additions and 62 deletions

View file

@ -38,9 +38,6 @@ TARGET_BOOTLOADER_BOARD_NAME := MSM8226
# Build # Build
BLOCK_BASED_OTA := true BLOCK_BASED_OTA := true
# Build Fingerprint
BUILD_FINGERPRINT := samsung/matissewifixx/matissewifi:5.0.2/LRX22G/T530XXS1BRH1:user/release-keys
# Extended Filesystem Support # Extended Filesystem Support
TARGET_EXFAT_DRIVER := sdfat TARGET_EXFAT_DRIVER := sdfat

View file

@ -1,27 +1,26 @@
/* //
Copyright (C) 2019 The LineageOS Project // Copyright (C) 2019 The LineageOS Project
//
Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
You may obtain a copy of the License at // You may obtain a copy of the License at
//
http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
//
Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
limitations under the License. // limitations under the License.
*/ //
cc_library_static { cc_library_static {
name: "libinit_matisse", name: "libinit_matisse",
recovery_available: true, recovery_available: true,
srcs: ["init_matisse.cpp"], srcs: ["init_matisse.cpp"],
whole_static_libs: ["libbase"],
include_dirs: [ include_dirs: [
"device/samsung/msm8226-common/init",
"system/core/base/include", "system/core/base/include",
"system/core/init", "system/core/init"
], ]
whole_static_libs: ["libinit_helpers_sam8226"]
} }

View file

@ -28,68 +28,117 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <android-base/file.h>
#include <android-base/logging.h> #include <android-base/logging.h>
#include <android-base/properties.h> #include <android-base/properties.h>
#include <android-base/strings.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
#include "property_service.h" #include "property_service.h"
#include "vendor_init.h"
#include "init_msm8226.h"
using android::base::GetProperty; using android::base::GetProperty;
using android::base::ReadFileToString;
using android::base::Trim;
using android::init::property_set; using android::init::property_set;
// copied from build/tools/releasetools/ota_from_target_files.py
// but with "." at the end and empty entry
std::vector<std::string> ro_product_props_default_source_order = {
"",
"product.",
"product_services.",
"odm.",
"vendor.",
"system.",
};
void property_override(char const prop[], char const value[], bool add = true)
{
auto pi = (prop_info *) __system_property_find(prop);
if (pi != nullptr) {
__system_property_update(pi, value, strlen(value));
} else if (add) {
__system_property_add(prop, strlen(prop), value, strlen(value));
}
}
void hspa_properties()
{
property_set("ro.telephony.default_network", "3");
property_set("telephony.lteOnGsmDevice", "0");
}
void lte_properties()
{
property_set("ro.telephony.default_network", "9");
property_set("telephony.lteOnGsmDevice", "1");
}
void wifi_only_properties()
{
property_set("ro.carrier", "wifi-only");
property_set("ro.radio.noril", "1");
}
void vendor_load_properties() void vendor_load_properties()
{ {
const auto set_ro_product_prop = [](const std::string &source, const auto set_ro_product_prop = [](const std::string &source,
const std::string &prop, const std::string &value) { const std::string &prop, const std::string &value) {
auto prop_name = "ro.product." + source + prop; auto prop_name = "ro.product." + source + prop;
property_override(prop_name.c_str(), value.c_str(), false); property_override(prop_name.c_str(), value.c_str(), false);
}; };
std::string bootloader = GetProperty("ro.bootloader", "");
if (bootloader.find("T530XX") == 0) { std::string bootloader = GetProperty("ro.bootloader", "");
/* matissewifixx */ if (bootloader.find("T530NU") == 0) {
property_override("ro.build.description", "matissewifixx-user 5.0.2 LRX22G T530XXS1BRH1 release-keys");
set_ro_product_prop(source, "device", "matissewifi");
set_ro_product_prop(source, "fingerprint", "samsung/matissewifixx/matissewifi:5.0.2/LRX22G/T530XXS1BRH1:user/release-keys");
set_ro_product_prop(source, "model", "SM-T530");
set_ro_product_prop(source, "name", "matissewifi");
wifi_properties();
} else if (bootloader.find("T530NU") == 0) {
/* matissewifiue */ /* matissewifiue */
property_override("ro.build.description", "matissewifiue-user 5.0.2 LRX22G T530NUUEU1BQC1 release-keys"); for (const auto &source : ro_product_props_default_source_order) {
set_ro_product_prop(source, "device", "matissewifiue"); set_ro_product_prop(source, "fingerprint", "samsung/matissewifiue/matissewifi:5.0.2/LRX22G/T530NUU1BOJ4:user/release-keys");
set_ro_product_prop(source, "fingerprint", "samsung/matissewifiue/matissewifiue:5.0.2/LRX22G/T530NUUEU1BQC1:user/release-keys"); set_ro_product_prop(source, "model", "SM-T530NU");
set_ro_product_prop(source, "model", "SM-T530NU"); set_ro_product_prop(source, "device", "matissewifi");
set_ro_product_prop(source, "name", "matissewifiue"); }
wifi_properties(); property_override("ro.build.description", "matissewifiue-user 5.0.2 LRX22G T530NUU1BOJ4 release-keys");
wifi_only_properties();
} else if (bootloader.find("T530XX") == 0) {
/* matissewifixx */
for (const auto &source : ro_product_props_default_source_order) {
set_ro_product_prop(source, "fingerprint", "samsung/matissewifixx/matissewifi:5.0.2/LRX22G/T530XXU1BOJ4:user/release-keys");
set_ro_product_prop(source, "model", "SM-T530");
set_ro_product_prop(source, "device", "matissewifi");
}
property_override("ro.build.description", "matissewifixx-user 5.0.2 LRX22G T530XXU1BOJ4 release-keys");
wifi_only_properties();
} else if (bootloader.find("T531XX") == 0) { } else if (bootloader.find("T531XX") == 0) {
/* matisse3gxx */ /* matisse3gxx */
property_override("ro.build.description", "matisse3gxx-user 5.0.2 LRX22G T531XXS1BRH1 release-keys"); for (const auto &source : ro_product_props_default_source_order) {
set_ro_product_prop(source, "device", "matisse3g"); set_ro_product_prop(source, "fingerprint", "samsung/matisse3gxx/matisse3g:5.0.2/LRX22G/T531XXU1BOE6:user/release-keys");
set_ro_product_prop(source, "fingerprint", "samsung/matisse3gxx/matisse3g:5.0.2/LRX22G/T531XXS1BRH1:user/release-keys"); set_ro_product_prop(source, "model", "SM-T531");
set_ro_product_prop(source, "model", "SM-T531"); set_ro_product_prop(source, "device", "matisse3g");
set_ro_product_prop(source, "name", "matisse3g"); }
gsm_properties(); property_override("ro.build.description", "matisse3gxx-user 5.0.2 LRX22G T531XXU1BOE6 release-keys");
} else if (bootloader.find("T532XX") == 0) { hspa_properties();
/* matisse3gjvxx */
property_override("ro.build.description", "matisse3gjv-user 5.0.2 LRX22G T532JVS1BQB1 release-keys");
set_ro_product_prop(source, "device", "matisse3gjv");
set_ro_product_prop(source, "fingerprint", "ro.vendor.build.fingerprint", "samsung/matisse3gjv/matisse3g:5.0.2/LRX22G/T532JVS1BQB1:user/release-keys");
set_ro_product_prop(source, "model", "SM-T532");
set_ro_product_prop(source, "name", "matisse3gjv");
gsm_properties();
} else if (bootloader.find("T535XX") == 0) { } else if (bootloader.find("T535XX") == 0) {
/* matisseltexx */ /* matisseltexx */
property_override("ro.build.description", "matisseltexx-user 5.0.2 LRX22G T535XXS1BRJ2 release-keys"); for (const auto &source : ro_product_props_default_source_order) {
set_ro_product_prop(source, "device", "matisselte"); set_ro_product_prop(source, "fingerprint", "samsung/matisseltexx/matisselte:5.0.2/LRX22G/T535XXU1BOL1:user/release-keys");
set_ro_product_prop(source, "fingerprint", "samsung/matisseltexx/matisselte:5.0.2/LRX22G/T535XXS1BRJ2:user/release-keys"); set_ro_product_prop(source, "model", "SM-T535");
set_ro_product_prop(source, "model", "SM-T535"); set_ro_product_prop(source, "device", "matisselte");
set_ro_product_prop(source, "name", "matisselte"); }
property_override("ro.build.description", "matisseltexx-user 5.0.2 LRX22G T535XXU1BOL1 release-keys");
lte_properties(); lte_properties();
} else { } else {
wifi_properties(); wifi_only_properties();
} }
std::string device = GetProperty("ro.product.device", ""); std::string device = GetProperty("ro.product.device", "");