-
Notifications
You must be signed in to change notification settings - Fork 506
Brands renaming #8109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Brands renaming #8109
Conversation
|
So, what's stopping us from merge? I'd like to update the other PRs with similar logic for "removed" brands |
|
bump |
|
Kind reminder |
|
@sgiehl I've reviewed the changes, all are fine for me. @sanchezzzhak if you can take a second look please? |
|
Fails on composer don't think this was caused by me 😅 |
|
|
||
| # Star | ||
| Star: | ||
| # Kingelon (previously "Star", which seems to be as valid as "Tengda", since a bunch of devices were released both under Kingelon and Star or/and Tengda, for example https://www.needrom.com/download/star-n8800-miui-tengda-kingelon/, but only Kingelon seems to have a logo at least, which is at least some evidence of it being real) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Kingelon
| - regex: 'Cherry(?:[ _]?Mobile)?[ _]?([^/;]+)(?: Build|[);])' | ||
| model: '$1' | ||
|
|
||
| #Previously listed as "White Mobile" brand, but based on https://firmwarefile.com/cherry-mobile-omega-lite-3, https://forum.gsmhosting.com/vbb/f296/cherry-mobile-omega-lite-3-frp-remove-2259709/ and https://deviceatlas.com/device-data/devices/white-mobile/am1010v/30376111 (and others), this is likely "Cherry Mobile", especially since I was not able to find any evidence of "White Mobile" ever existing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this comment
Cherry Mobile should stay with the old name.
https://www.gadgetpilipinas.net/2016/12/cherry-mobile-defender/
The AM1010V can be separated into a separate brand.
|
|
||
| # TechSmart or Techmade | ||
| TechSmart: | ||
| # Techmade (often seen as TechSmart, which is actually a model line: https://www.ebay.it/itm/112931113112 https://www.ebay.it/itm/123071096677 https://www.facebook.com/661598300623815/photos/a.661606387289673/1242575672526072/?type=3&locale=hi_IN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Techmade
| # Newman | ||
| Newman: | ||
| regex: 'Newman[ _](P308|K1|G5i)(?:[);/ ]|$)' | ||
| regex: '(?:(?:(?:Newman[ _])(P308|K1|G5i))|(UE Pad 1))(?:[);/ ]|$)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regex: '(?:(?:Newman[ _])(?:P308|K1|G5i)|UE Pad 1)(?:[);/ ]|$)'
device: 'smartphone'
models:
- regex: 'Newman[ _](P308|K1|G5i)(?:[);/ ]|$)'
model: '$1'
- regex: 'UE Pad 1'
device: 'tablet'
model: 'UE 1 PAD'
|
|
||
| # 360 or names Qihoo 360, +360, QiKU 360 | ||
| '360': | ||
| 360: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rollback quotation
Other program languages will perceive this key not as a string, but as a number, for example, in nodejs.
|
|
||
| # ROiK | ||
| ROiK: | ||
| # KAP (previously ROiK, but that's a model according to this https://www.youtube.com/watch?v=g9TNZJFTTsE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# KAP
|
|
||
| # Padpro | ||
| Padpro: | ||
| # 7Ke tree (previously "Padpro", but "Padpro" seem like a model line, for example at least https://www.ebay.com/itm/404866696988 and https://www.ubuy.com.se/en/product/G68Y4S8AO-new-listing-14-inch-big-screen-tablet-pc-android-13-16gb-ram-512gb-rom-deca-core-keyboard?ref=hm-google-redirect seem like the same device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 7Ke tree
|
|
||
| # HLLO or Exertis HLLO | ||
| HLLO: | ||
| # Exertis (previously HLLO, but was not able to find any evidence of this being a brand besides it being part of Exertis accelerator. Search for the model also shows Exertis most of the times, so HLLO is probably a model line rather than a (sub-)brand) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Exertis
|
|
||
| # Sprint | ||
| Sprint: | ||
| # Quanta Computer ("Sprint" in previous versions, but "Sprint" seems to be a distributor brand (possibly https://en.wikipedia.org/wiki/Sprint_Corporation but no clear evidence was found at the time of writing), similar some HTC models https://phonedb.net/index.php?m=device&s=query&d=detailed_specs&brand=Sprint#result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Quanta Computer
| public static function getShortCode(string $brand): string | ||
| { | ||
| return (string) \array_search($brand, self::$deviceBrands, true) ?: ''; | ||
| return (string) \array_search($brand, self::$legacyShortNames + self::$deviceBrands, true) ?: ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return the old code, as this merging of arrays does not carry payload.
return (string) \array_search($brand, self::$deviceBrands, true) ?: '';
and remove $legacyShortNames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand, what you mean by "does not carry payload". This was done as a way to preserve old names (essentially backwards compatibility), as discussed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$getShortCode = function(string $brand): string {
$legacyShortNames = [
'6T' => 'Twoe',
'5H' => 'MMI',
'WHI' => 'White Mobile',
'6C' => 'Cloudpad',
'DZ' => 'Dazen',
'ER' => 'Ericy',
'HLL' => 'HLLO',
'EKI' => 'EKINOX',
'LPX' => 'LPX-G',
'UE1' => 'UE',
];
$deviceBrands = [
'6T' => '2E',
'5H' => 'ARRIS',
'WHI' => 'Cherry Mobile',
'6C' => 'Cloudfone',
'DZ' => 'Coolpad',
'ER' => 'Ericsson',
'HLL' => 'Exertis',
'EKI' => 'iGet',
'LPX' => 'OTT',
'UE1' => 'Newman',
'TEST' => 'test brand',
];
dump(legacyShortNames + $deviceBrands);
// result only key => value for $legacyShortNames and append new keys/values 'TEST' => ''
return (string) \array_search($brand, $legacyShortNames + $deviceBrands, true) ?: '';
};
dd(
$getShortCode('Twoe'), // result "6T"
$getShortCode('2E'), // result ""
$getShortCode('Cherry Mobile'), // result ""
$getShortCode('White Mobile'), // result "WHI"
$getShortCide('test brand') // result "TEST"
);If we are trying to make compatibility, we must fulfill 2 conditions sequentially
$shortcode = (string) \array_search($brand, self::$deviceBrands, true) ?: '';
if ($shortcode !== '') {
return $shortcode;
}
return (string) \array_search($brand, self::$legacyShortNames, true) ?: '';
Description:
Split from #8096 this covers brand name changes, that are mostly more than just addition of a prefix or otherwise more contentious
Review