Skip to content

Commit d775b99

Browse files
authored
Merge branch 'main' into dev/mandel/remove-codeql-prs
2 parents ec1a863 + a759bb7 commit d775b99

File tree

128 files changed

+7384
-2544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+7384
-2544
lines changed

dotnet/Workloads/SignList.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
<Skip Include="Build\System.Text.Json.dll" />
3636
<Skip Include="Build\System.Threading.Tasks.Dataflow.dll" />
3737
<Skip Include="Build\System.Threading.Tasks.Extensions.dll" />
38+
<!-- They are now signed by their origin build https://github.com/xamarin/XamarinVS/pull/14522 -->
39+
<Skip Include="imobiledevice-*\*.dll" />
40+
<Skip Include="imobiledevice-*\*.exe" />
3841
</ItemGroup>
3942

4043
<ItemGroup>
4144
<ThirdParty Include="BouncyCastle.Crypto.dll" />
42-
<ThirdParty Include="imobiledevice-*\*.dll" />
43-
<ThirdParty Include="imobiledevice-*\*.exe" />
4445
<!-- Build.zip -->
4546
<ThirdParty Include="Mono.Cecil*.dll" />
4647

msbuild/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
-->
1818
<MessagingVersion Condition="'$(MessagingVersion)' == ''">[3.0.13]</MessagingVersion>
19-
<HotRestartVersion>[1.1.7]</HotRestartVersion>
19+
<HotRestartVersion>[17.14.51-gd03e25086a]</HotRestartVersion>
2020
</PropertyGroup>
2121
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
2222
</Project>

msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,4 +1714,9 @@
17141714
{0}: the path to a file
17151715
</comment>
17161716
</data>
1717+
1718+
<data name="W7144" xml:space="preserve">
1719+
<value>Did not extract {0} because it would write outside the target directory.</value>
1720+
</data>
1721+
17171722
</root>

msbuild/Xamarin.MacDev.Tasks/Decompress.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ static bool TryDecompressUsingSystemIOCompression (TaskLoggingHelper log, string
171171
resource = resource.TrimEnd ('/', '\\');
172172
resource = resource.Replace ('\\', zipDirectorySeparator);
173173
var resourceAsDir = resource + zipDirectorySeparator;
174+
decompressionDir = Path.GetFullPath (decompressionDir);
174175

175176
using var archive = ZipFile.OpenRead (zip);
176177
foreach (var entry in archive.Entries) {
@@ -204,6 +205,17 @@ static bool TryDecompressUsingSystemIOCompression (TaskLoggingHelper log, string
204205

205206
var isDir = entryPath [entryPath.Length - 1] == zipDirectorySeparator;
206207
var targetPath = Path.Combine (decompressionDir, entryPath.Replace (zipDirectorySeparator, Path.DirectorySeparatorChar));
208+
209+
// canonicalize the path
210+
targetPath = Path.GetFullPath (targetPath);
211+
212+
// validate that the unzipped file is inside the target directory
213+
var decompressionDirectoryPath = decompressionDir.Trim (Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
214+
if (!targetPath.StartsWith (decompressionDirectoryPath)) {
215+
log.LogWarning (7144, null, MSBStrings.W7144 /* Did not extract {0} because it would write outside the target directory. */, entryPath);
216+
continue;
217+
}
218+
207219
if (isDir) {
208220
Directory.CreateDirectory (targetPath);
209221
} else {

msbuild/Xamarin.MacDev.Tasks/Tasks/PackLibraryResources.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ public override bool Execute ()
4949
{
5050
var results = new List<ITaskItem> ();
5151

52+
var hashOriginalResources = new HashSet<string> (BundleOriginalResourcesWithLogicalNames.Select (v => v.ItemSpec));
53+
5254
foreach (var item in BundleResourcesWithLogicalNames) {
55+
if (hashOriginalResources.Contains (item.ItemSpec)) {
56+
Log.LogMessage (MessageImportance.Low, $"Skipping BundleResourcesWithLogicalNames={item.ItemSpec}, because it's also specified in BundleOriginalResourcesWithLogicalNames");
57+
continue;
58+
}
59+
5360
var logicalName = item.GetMetadata ("LogicalName");
5461

5562
if (string.IsNullOrEmpty (logicalName)) {

scripts/rsp-to-csproj/rsp-to-csproj.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ void ProcessFile (string file)
175175
break;
176176
case "noconfig": // this is already passed to csc by default
177177
break;
178+
case "reportanalyzer":
179+
if (!properties.Contains (("ReportAnalyzer", "true")))
180+
properties.Add (new ("ReportAnalyzer", "true"));
181+
break;
178182
default:
179183
ReportError ($"Didn't understand argument '{a}'");
180184
break;

src/AppKit/Enums.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,22 +1439,6 @@ public enum NSPasteboardReadingOptions : ulong {
14391439
AsKeyedArchive = 4,
14401440
}
14411441

1442-
#if !NET && MONOMAC // Use the one in Foundation instead, only keep this in macOS until .NET.
1443-
[Native]
1444-
public enum NSUnderlineStyle : long {
1445-
None = 0x00,
1446-
Single = 0x01,
1447-
Thick = 0x02,
1448-
Double = 0x09,
1449-
PatternSolid = 0x0000,
1450-
PatternDot = 0x0100,
1451-
PatternDash = 0x0200,
1452-
PatternDashDot = 0x0300,
1453-
PatternDashDotDot = 0x0400,
1454-
ByWord = 0x8000,
1455-
}
1456-
#endif
1457-
14581442
// Convenience enum, untyped in ObjC
14591443
[NoMacCatalyst]
14601444
public enum NSUnderlinePattern : int {

src/Foundation/Compat.cs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Compat.cs: Stuff we won't provide in Xamarin.iOS.dll or newer XAMCORE_* profiles
2+
// Compat.cs: Stuff we won't provide in newer XAMCORE_* profiles
33
//
44
// Authors:
55
// Sebastien Pouliot <sebastien@xamarin.com>
@@ -12,30 +12,6 @@
1212
using ObjCRuntime;
1313

1414
namespace Foundation {
15-
16-
#if !NET
17-
#if MONOMAC
18-
public partial class NSError {
19-
20-
// removed in Xcode 11 GM
21-
[Obsolete ("This API has been removed.")]
22-
public static NSError GetFileProviderErrorForOutOfDateItem (FileProvider.INSFileProviderItem updatedVersion)
23-
{
24-
return null;
25-
}
26-
}
27-
#endif
28-
29-
public partial class NSUserActivity {
30-
31-
[Obsolete ("Use the constructor that allows you to set an activity type.")]
32-
public NSUserActivity ()
33-
: this (String.Empty)
34-
{
35-
}
36-
}
37-
#endif // !NET
38-
3915
#if !XAMCORE_5_0
4016
#if __IOS__ && !__MACCATALYST__
4117
public partial class NSUrlConnection {

src/Foundation/DictionaryContainer.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,14 @@
4343
using UIKit;
4444
#endif
4545

46-
#if !NET
47-
using NativeHandle = System.IntPtr;
48-
#endif
49-
5046
#nullable enable
5147

5248
namespace Foundation {
5349

54-
#if NET
5550
[SupportedOSPlatform ("ios")]
5651
[SupportedOSPlatform ("maccatalyst")]
5752
[SupportedOSPlatform ("macos")]
5853
[SupportedOSPlatform ("tvos")]
59-
#endif
6054
public abstract class DictionaryContainer {
6155
#if !COREBUILD
6256
protected DictionaryContainer ()
@@ -247,11 +241,7 @@ protected DictionaryContainer (NSDictionary? dictionary)
247241
return value as NSDictionary<TKey, TValue>;
248242
}
249243

250-
#if NET
251244
protected T? GetStrongDictionary<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T> (NSString key)
252-
#else
253-
protected T? GetStrongDictionary<T> (NSString key)
254-
#endif
255245
where T : DictionaryContainer
256246
{
257247
return GetStrongDictionary (key, dict =>

src/Foundation/Enum.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,9 @@ public enum NSUrlCredentialPersistence : ulong {
7777

7878
#if MONOMAC
7979

80-
#if !NET
81-
[Native]
82-
public enum NSBundleExecutableArchitecture : long {
83-
#else
8480
/// <summary>The bundle's architecture.</summary>
8581
[NoiOS][NoTV][NoMacCatalyst]
8682
public enum NSBundleExecutableArchitecture {
87-
#endif
8883
I386 = 0x00000007,
8984
PPC = 0x00000012,
9085
X86_64 = 0x01000007,
@@ -252,10 +247,6 @@ public enum NSCalendarUnit : ulong {
252247
public enum NSDataReadingOptions : ulong {
253248
Mapped = 1 << 0,
254249
Uncached = 1 << 1,
255-
#if !NET
256-
[Obsolete ("This option is unavailable.")]
257-
Coordinated = 1 << 2,
258-
#endif
259250
MappedAlways = 1 << 3,
260251
}
261252

@@ -592,10 +583,6 @@ public enum NSVolumeEnumerationOptions : ulong {
592583
[Flags]
593584
[Native]
594585
public enum NSDirectoryEnumerationOptions : ulong {
595-
#if !NET
596-
[Obsolete ("Use 'None' instead.")]
597-
SkipsNone = 0,
598-
#endif
599586
None = 0,
600587
SkipsSubdirectoryDescendants = 1 << 0,
601588
SkipsPackageDescendants = 1 << 1,
@@ -808,10 +795,6 @@ public enum NSJsonReadingOptions : ulong {
808795
Json5Allowed = 8,
809796
[iOS (15, 0), TV (15, 0), MacCatalyst (15, 0)]
810797
TopLevelDictionaryAssumed = 16,
811-
#if !NET
812-
[Obsolete ("Use 'FragmentsAllowed. instead.")]
813-
AllowFragments = FragmentsAllowed,
814-
#endif
815798
}
816799

817800
[Flags]
@@ -889,7 +872,6 @@ public enum NSAttributedStringEnumeration : ulong {
889872
LongestEffectiveRangeNotRequired = 1 << 20,
890873
}
891874

892-
#if NET || !MONOMAC
893875
// macOS has defined this in AppKit as well, but starting with .NET we're going
894876
// to use this one only.
895877
[Native]
@@ -905,7 +887,6 @@ public enum NSUnderlineStyle : long {
905887
PatternDashDotDot = 0x0400,
906888
ByWord = 0x8000,
907889
}
908-
#endif
909890

910891
// There's an AppKit.NSWritingDirection, which is deprecated.
911892
// There's also an UIKit.UITextWritingDirection, which is deprecated too.
@@ -977,17 +958,6 @@ public enum NSLigatureType : long {
977958
All,
978959
}
979960

980-
#if !NET
981-
[Flags]
982-
[Native]
983-
public enum NSDateComponentsWrappingBehavior : ulong {
984-
None = 0,
985-
WrapCalendarComponents = 1 << 0,
986-
987-
// Did not add the new enums here, we moved them elsewhere, and provided overloads.
988-
}
989-
#endif
990-
991961
[Flags]
992962
[Native]
993963
public enum NSCalendarOptions : ulong {

src/Foundation/LinkerSafeAttribute.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929

3030
namespace Foundation {
3131

32-
#if NET
3332
[Obsolete ("Replace with '[assembly: System.Reflection.AssemblyMetadata (\"IsTrimmable\", \"True\")]'.")]
3433
[EditorBrowsable (EditorBrowsableState.Never)]
35-
#endif
3634
[AttributeUsage (AttributeTargets.Assembly)]
3735
public sealed class LinkerSafeAttribute : Attribute {
3836

src/Foundation/ModelAttribute.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,5 @@ public sealed class ModelAttribute : Attribute {
3232
public ModelAttribute () { }
3333

3434
public string? Name { get; set; }
35-
#if !NET
36-
public bool AutoGeneratedName { get; set; }
37-
#endif
3835
}
3936
}

src/Foundation/MonoTouchException.cs

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)