Skip to content

Commit

Permalink
Profiles: Use expression bodies for methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gus33000 committed Feb 27, 2024
1 parent 574fcb8 commit f87eb09
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 329 deletions.
52 changes: 11 additions & 41 deletions FirmwareGen/DeviceProfiles/EpsilonHalfSplit128GB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,23 @@ namespace FirmwareGen.DeviceProfiles
{
public class EpsilonHalfSplit128GB : IDeviceProfile
{
public string[] GetSupplementaryBCDCommands()
{
return [];
}
public string[] GetSupplementaryBCDCommands() => [];

public string[] GetPlatformIDs()
{
return ["Microsoft Corporation.Surface.Surface Duo.1930", "OEMB1.*.OEMB1 Product.*", "OEMEP.*.OEMEP Product.*"];
}
public string[] GetPlatformIDs() => ["Microsoft Corporation.Surface.Surface Duo.1930", "OEMB1.*.OEMB1 Product.*", "OEMEP.*.OEMEP Product.*"];

public string GetFFUFileName(string OSVersion, string Language, string Sku)
{
return $"OEMEP_128GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";
}
public string GetFFUFileName(string OSVersion, string Language, string Sku) => $"OEMEP_128GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";

public string GetDriverDefinitionPath(string DriverFolder)
{
return $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\epsilon.xml";
}
public string GetDriverDefinitionPath(string DriverFolder) => $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\epsilon.xml";

public ulong GetDiskTotalSize()
{
public ulong GetDiskTotalSize() =>
//return 239_683_502_080; // 256GB (Bigger variant);
//return 239_651_758_080; // 256GB (Smaller variant);
return 111_723_675_648; // 128GB;
}
111_723_675_648; // 128GB;

public uint GetDiskSectorSize()
{
return 4096;
}
public uint GetDiskSectorSize() => 4096;

// OEMEP DV UFS LUN 0 Partition Layout
public GPTPartition[] GetPartitionLayout()
{
return
[
public GPTPartition[] GetPartitionLayout() => [
new()
{
TypeGUID = new Guid("2c86e742-745e-4fdd-bfd8-b6a7ac638772"),
Expand Down Expand Up @@ -97,21 +77,11 @@ public GPTPartition[] GetPartitionLayout()
Name = "userdata"
}
];
}

public SplittingStrategy GetSplittingStrategy()
{
return SplittingStrategy.HalfSplit;
}
public SplittingStrategy GetSplittingStrategy() => SplittingStrategy.HalfSplit;

public Guid GetDiskGuid()
{
return new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");
}
public Guid GetDiskGuid() => new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");

public ulong GetCustomSplittingAndroidDesiredSpace()
{
return 4_294_967_296;
}
public ulong GetCustomSplittingAndroidDesiredSpace() => 4_294_967_296;
}
}
53 changes: 11 additions & 42 deletions FirmwareGen/DeviceProfiles/EpsilonHalfSplit256GB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,22 @@ namespace FirmwareGen.DeviceProfiles
{
internal class EpsilonHalfSplit256GB : IDeviceProfile
{
public string[] GetSupplementaryBCDCommands()
{
return [];
}
public string[] GetSupplementaryBCDCommands() => [];

public string[] GetPlatformIDs()
{
return ["Microsoft Corporation.Surface.Surface Duo.1930", "OEMB1.*.OEMB1 Product.*", "OEMEP.*.OEMEP Product.*"];
}
public string[] GetPlatformIDs() => ["Microsoft Corporation.Surface.Surface Duo.1930", "OEMB1.*.OEMB1 Product.*", "OEMEP.*.OEMEP Product.*"];

public string GetFFUFileName(string OSVersion, string Language, string Sku)
{
return $"OEMEP_256GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";
}
public string GetFFUFileName(string OSVersion, string Language, string Sku) => $"OEMEP_256GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";

public string GetDriverDefinitionPath(string DriverFolder)
{
return $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\epsilon.xml";
}
public string GetDriverDefinitionPath(string DriverFolder) => $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\epsilon.xml";

public ulong GetDiskTotalSize()
{
public ulong GetDiskTotalSize() =>
//return 239_683_502_080; // 256GB (Bigger variant);
return 239_651_758_080; // 256GB (Smaller variant);
//return 111_723_675_648; // 128GB;
}
239_651_758_080; // 256GB (Smaller variant);//return 111_723_675_648; // 128GB;

public uint GetDiskSectorSize()
{
return 4096;
}
public uint GetDiskSectorSize() => 4096;

// OEMEP DV UFS LUN 0 Partition Layout
public GPTPartition[] GetPartitionLayout()
{
return
[
public GPTPartition[] GetPartitionLayout() => [
new()
{
TypeGUID = new Guid("2c86e742-745e-4fdd-bfd8-b6a7ac638772"),
Expand Down Expand Up @@ -97,21 +76,11 @@ public GPTPartition[] GetPartitionLayout()
Name = "userdata"
}
];
}

public SplittingStrategy GetSplittingStrategy()
{
return SplittingStrategy.HalfSplit;
}
public SplittingStrategy GetSplittingStrategy() => SplittingStrategy.HalfSplit;

public Guid GetDiskGuid()
{
return new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");
}
public Guid GetDiskGuid() => new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");

public ulong GetCustomSplittingAndroidDesiredSpace()
{
return 4_294_967_296;
}
public ulong GetCustomSplittingAndroidDesiredSpace() => 4_294_967_296;
}
}
52 changes: 11 additions & 41 deletions FirmwareGen/DeviceProfiles/EpsilonMaximizedForWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,23 @@ namespace FirmwareGen.DeviceProfiles
{
internal class EpsilonMaximizedForWindows : IDeviceProfile
{
public string[] GetSupplementaryBCDCommands()
{
return [];
}
public string[] GetSupplementaryBCDCommands() => [];

public string[] GetPlatformIDs()
{
return ["Microsoft Corporation.Surface.Surface Duo.1930", "OEMB1.*.OEMB1 Product.*", "OEMEP.*.OEMEP Product.*"];
}
public string[] GetPlatformIDs() => ["Microsoft Corporation.Surface.Surface Duo.1930", "OEMB1.*.OEMB1 Product.*", "OEMEP.*.OEMEP Product.*"];

public string GetFFUFileName(string OSVersion, string Language, string Sku)
{
return $"OEMEP_128GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";
}
public string GetFFUFileName(string OSVersion, string Language, string Sku) => $"OEMEP_128GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";

public string GetDriverDefinitionPath(string DriverFolder)
{
return $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\epsilon.xml";
}
public string GetDriverDefinitionPath(string DriverFolder) => $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\epsilon.xml";

public ulong GetDiskTotalSize()
{
public ulong GetDiskTotalSize() =>
//return 239_683_502_080; // 256GB (Bigger variant);
//return 239_651_758_080; // 256GB (Smaller variant);
return 111_723_675_648; // 128GB;
}
111_723_675_648; // 128GB;

public uint GetDiskSectorSize()
{
return 4096;
}
public uint GetDiskSectorSize() => 4096;

// OEMEP DV UFS LUN 0 Partition Layout
public GPTPartition[] GetPartitionLayout()
{
return
[
public GPTPartition[] GetPartitionLayout() => [
new()
{
TypeGUID = new Guid("2c86e742-745e-4fdd-bfd8-b6a7ac638772"),
Expand Down Expand Up @@ -97,21 +77,11 @@ public GPTPartition[] GetPartitionLayout()
Name = "userdata"
}
];
}

public SplittingStrategy GetSplittingStrategy()
{
return SplittingStrategy.MaximizedForWindows;
}
public SplittingStrategy GetSplittingStrategy() => SplittingStrategy.MaximizedForWindows;

public Guid GetDiskGuid()
{
return new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");
}
public Guid GetDiskGuid() => new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");

public ulong GetCustomSplittingAndroidDesiredSpace()
{
return 4_294_967_296;
}
public ulong GetCustomSplittingAndroidDesiredSpace() => 4_294_967_296;
}
}
51 changes: 10 additions & 41 deletions FirmwareGen/DeviceProfiles/MTP8150MaximizedForWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,20 @@ namespace FirmwareGen.DeviceProfiles
{
internal class MTP8150MaximizedForWindows : IDeviceProfile
{
public string[] GetSupplementaryBCDCommands()
{
return [];
}
public string[] GetSupplementaryBCDCommands() => [];

public string[] GetPlatformIDs()
{
return ["Microsoft Corporation.Surface.MTP.SM8150"];
}
public string[] GetPlatformIDs() => ["Microsoft Corporation.Surface.MTP.SM8150"];

public string GetFFUFileName(string OSVersion, string Language, string Sku)
{
return $"QCOM_MTP_8150_MaximizedForWindows_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";
}
public string GetFFUFileName(string OSVersion, string Language, string Sku) => $"QCOM_MTP_8150_MaximizedForWindows_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";

public string GetDriverDefinitionPath(string DriverFolder)
{
return $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\mtp855.xml";
}
public string GetDriverDefinitionPath(string DriverFolder) => $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\mtp855.xml";

public ulong GetDiskTotalSize()
{
return 123_371_257_856; // 128GB;
}
public ulong GetDiskTotalSize() => 123_371_257_856; // 128GB;

public uint GetDiskSectorSize()
{
return 4096;
}
public uint GetDiskSectorSize() => 4096;

// MTP855 UFS LUN 0 Partition Layout
public GPTPartition[] GetPartitionLayout()
{
return
[
public GPTPartition[] GetPartitionLayout() => [
new()
{
TypeGUID = new Guid("2c86e742-745e-4fdd-bfd8-b6a7ac638772"),
Expand Down Expand Up @@ -149,21 +128,11 @@ public GPTPartition[] GetPartitionLayout()
Name = "userdata"
}
];
}

public SplittingStrategy GetSplittingStrategy()
{
return SplittingStrategy.MaximizedForWindows;
}
public SplittingStrategy GetSplittingStrategy() => SplittingStrategy.MaximizedForWindows;

public Guid GetDiskGuid()
{
return new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");
}
public Guid GetDiskGuid() => new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");

public ulong GetCustomSplittingAndroidDesiredSpace()
{
return 4_294_967_296;
}
public ulong GetCustomSplittingAndroidDesiredSpace() => 4_294_967_296;
}
}
51 changes: 10 additions & 41 deletions FirmwareGen/DeviceProfiles/ZetaHalfSplit128GB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,23 @@ namespace FirmwareGen.DeviceProfiles
{
public class ZetaHalfSplit128GB : IDeviceProfile
{
public string[] GetSupplementaryBCDCommands()
{
return [];
}
public string[] GetSupplementaryBCDCommands() => [];

public string[] GetPlatformIDs()
{
return ["Microsoft Corporation.Surface.Surface Duo 2.1995",
public string[] GetPlatformIDs() => ["Microsoft Corporation.Surface.Surface Duo 2.1995",
"Microsoft Corporation.Surface.Surface Duo 2.1968",
"OEMC1.*.OEMC1 Product.*",
"OEMZE.*.OEMZE Product.*"];
}

public string GetFFUFileName(string OSVersion, string Language, string Sku)
{
return $"OEMZE_128GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";
}
public string GetFFUFileName(string OSVersion, string Language, string Sku) => $"OEMZE_128GB_HalfSplit_{OSVersion}_CLIENT{Sku}_a64fre_{Language}_unsigned.ffu";

public string GetDriverDefinitionPath(string DriverFolder)
{
return $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\zeta.xml";
}
public string GetDriverDefinitionPath(string DriverFolder) => $@"{DriverFolder}\definitions\Desktop\ARM64\Internal\zeta.xml";

public ulong GetDiskTotalSize()
{
return 110_394_081_280; // 128GB;
}
public ulong GetDiskTotalSize() => 110_394_081_280; // 128GB;

public uint GetDiskSectorSize()
{
return 4096;
}
public uint GetDiskSectorSize() => 4096;

// OEMZE MP UFS LUN 0 Partition Layout
public GPTPartition[] GetPartitionLayout()
{
return
[
public GPTPartition[] GetPartitionLayout() => [
new()
{
TypeGUID = new Guid("2c86e742-745e-4fdd-bfd8-b6a7ac638772"),
Expand Down Expand Up @@ -116,21 +95,11 @@ public GPTPartition[] GetPartitionLayout()
Name = "userdata"
}
];
}

public SplittingStrategy GetSplittingStrategy()
{
return SplittingStrategy.HalfSplit;
}
public SplittingStrategy GetSplittingStrategy() => SplittingStrategy.HalfSplit;

public Guid GetDiskGuid()
{
return new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");
}
public Guid GetDiskGuid() => new Guid("efa6243a-085f-e745-f2ce-54d39ef34351");

public ulong GetCustomSplittingAndroidDesiredSpace()
{
return 4_294_967_296;
}
public ulong GetCustomSplittingAndroidDesiredSpace() => 4_294_967_296;
}
}
Loading

0 comments on commit f87eb09

Please sign in to comment.