mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 12:05:32 -04:00
universal7885: Add my makefile Generator script
Change-Id: I2ec7e72a67d73e5b9b6dd4f57557ede1651ebe03 Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
70476a701f
commit
b231e3bd21
4 changed files with 82 additions and 5 deletions
29
universal7885-common/vendor_detect/main.cpp
Normal file
29
universal7885-common/vendor_detect/main.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <filesystem>
|
||||
using namespace std;
|
||||
std::vector<std::string> get_directories(const std::string& s)
|
||||
{
|
||||
std::vector<std::string> r;
|
||||
for(auto& p : std::filesystem::recursive_directory_iterator(s))
|
||||
if (p.is_directory())
|
||||
r.push_back(p.path().string());
|
||||
return r;
|
||||
}
|
||||
int main(){
|
||||
std::vector<std::string> vendors = get_directories("vendor");
|
||||
for (int i = 0; i < vendors.size(); i++){
|
||||
std::string name = vendors[i].substr(7, vendors[i].length());
|
||||
name = name.substr(0, name.find('/'));
|
||||
if (name != "qcom" && name != "nxp" && name != "samsung"
|
||||
&& name != "gapps" && name != "google" &&
|
||||
name != "gms" && name != "codeaurora"){
|
||||
ofstream output;
|
||||
output.open("device/samsung/universal7885-common/vendor_name");
|
||||
output << name;
|
||||
output.close();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in a new issue