This repository has been archived by the owner on Feb 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Yu Yuphoria support and misc changes
Yu Yuphoria supported libsuperuser project referenced as submodule Randomize function now changes only last 6 hex digits to preserve OUI
- Loading branch information
Showing
8 changed files
with
81 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "libsuperuser"] | ||
path = libsuperuser | ||
url = https://github.com/ViRb3/libsuperuser |
Submodule libsuperuser
added at
1cf006
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System.Text.RegularExpressions; | ||
|
||
namespace nMAC.Devices | ||
{ | ||
class YuYuphoria : DeviceModel | ||
{ | ||
internal YuYuphoria() | ||
{ | ||
this.Path = "/sys/devices/soc.0/a000000.qcom,wcnss-wlan/wcnss_mac_addr"; | ||
this.FileSyntax = new Regex(@"^([0-9a-f]{2}[:]){5}([0-9a-f]{2})\n*$"); | ||
} | ||
|
||
internal override bool CheckFile(string content) | ||
{ | ||
if (this.FileSyntax.IsMatch(content)) | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
internal override string ExtractMACFromFile(string content) | ||
{ | ||
return content.Replace(":", string.Empty); | ||
} | ||
|
||
internal override void WriteMAC(ref string content, string MAC) | ||
{ | ||
MAC = MAC.ToLower(); | ||
string formattedMAC = string.Empty; | ||
|
||
int @break = 0; | ||
for (int i = 0; i < MAC.Length;) | ||
{ | ||
if (@break < 2) | ||
{ | ||
formattedMAC += MAC[i]; | ||
@break++; | ||
i++; | ||
} | ||
else | ||
{ | ||
@break = 0; | ||
formattedMAC += ":"; | ||
} | ||
} | ||
|
||
content = formattedMAC; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters