Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/scripts/device_list/amazon.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"KFSNWI":"Fire Max 11 (2023, 13th Gen)",
"KFRAWI (2GB)":"Fire HD 8 (2022, 2GB)",
"KFRAPWI (3GB)":"Fire HD 8 (2022, 3GB)",
"KFRAPWI (4GB)":"Fire HD 8 (2024, 4GB)",
"KFQUWI": "Fire 7 (2022)",
"KFTRWI (3GB)":"Fire HD 10 (2021, 3GB)",
"KFTRPWI (4GB)":"Fire HD 10 (2021, 4GB)",
Expand Down Expand Up @@ -52,8 +53,9 @@
"AFTTIFF55":"Onida HD/FHD - Fire TV (2020)",
"AFTSHN02":"TCL 32 FHD, 40 FHD Fire TV (2023)",
"AFTMD002":"TCL Class S3 1080p LED Smart TV with Fire TV (2023)",
"AFTMD001":"Fire TV - TCL Q6 4K QLED HDR (2023)",
"AFTMA475B1":"TCL 4K Smart Fire TV (2024)",
"AFTMD001":"Fire TV - TCL S4 Series 4K UHD HDR LED (2023)",
"AFTDEC012E":"Fire TV - TCL S4/S5/Q5/Q6 Series 4K UHD HDR LED (2024)",
"AFTKA002":"Fire TV 2-Series (2023)",
"AFTKAUK002":"Fire TV 2-Series (2023)",
"AFTHA004":"Toshiba 4K UHD - Fire TV (2022)",
Expand Down
4 changes: 4 additions & 0 deletions bin/scripts/device_list/apple.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
"iPhone15,5":"iPhone 15 Plus",
"iPhone16,1":"iPhone 15 Pro",
"iPhone16,2":"iPhone 15 Pro Max",
"iPhone17,1":"iPhone 16 Pro",
"iPhone17,2":"iPhone 16 Pro Max",
"iPhone17,3":"iPhone 16",
"iPhone17,4":"iPhone 16 Plus",
"iPod1,1":"iPod touch 1G",
"iPod2,1":"iPod touch 2G",
"iPod3,1":"iPod touch 3G",
Expand Down
17 changes: 16 additions & 1 deletion bin/scripts/device_list/generate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run as
// node generate.js > countly.device.list.js
// resulting file should be copied to "/frontend/express/public/javascripts/countly"

//https://www.theiphonewiki.com/wiki/Models
//https://gist.github.com/adamawolf/3048717
Expand All @@ -15,11 +16,17 @@ var amazon = require("./amazon.json");
for (var i in amazon) {
devices[i] = amazon[i];
}

// Informative messages are writer to stderr so they don't interfere with the stdout piping to a file
// When downloading the CSV file it will be UTF-16 LE. It needs to be transformed to UTF-8 (non BOM version)
// converting with notepad++ or vscode might not work on a windows device. Try on a mac device
process.stderr.write("Starting CSV parsing\n");
var csv = require('csvtojson');
csv()
//from https://support.google.com/googleplay/answer/1727131?hl=en-GB
.fromFile("./supported_devices.csv")
.on('json', (jsonObj)=>{
//process.stderr.write("Parsed data/json line: " + jsonObj);
var d = jsonObj["Marketing Name"] + "";
var i = jsonObj["Model"] + "";
if (i != d && d.trim().length) {
Expand All @@ -33,6 +40,14 @@ csv()
}
}
})
// .on('data', (data)=>{
// //process.stderr.write("Parsed data line: " + data);
// })
// .on('error', (err)=>{
// process.stderr.write("Error while parsing: " + err);
// })
.on('done', ()=>{
process.stderr.write("CSV parsing 'done' trigger\n");
process.stdout.write("/**\n * Object with device models as keys and pretty/marketing device names as values\n * @name countlyDeviceList\n * @global\n * @namespace countlyDeviceList\n */\nvar countlyDeviceList = " + JSON.stringify(devices, null, 4) + ";\n/*global module*/\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = countlyDeviceList;\n}");
});
});
process.stderr.write("Ending CSV parsing\n");
Loading
Loading