-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
artehe
committed
Jan 11, 2024
1 parent
bf81219
commit 3448b7d
Showing
15 changed files
with
66,020 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...mobiledevice/Exceptions/PlistException.cs → Netimobiledevice/Plist/PlistException.cs
100755 → 100644
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
2 changes: 1 addition & 1 deletion
2
...device/Exceptions/PlistFormatException.cs → ...obiledevice/Plist/PlistFormatException.cs
100755 → 100644
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Netimobiledevice.Plist; | ||
using NetimobiledeviceTest.TestFiles; | ||
|
||
namespace NetimobiledeviceTest.Plist; | ||
|
||
[TestClass] | ||
public class BinaryFormatReaderTests | ||
{ | ||
[TestMethod] | ||
public void ParseBinaryPlistWithSingleDictionary() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/GenericBinary.plist")) { | ||
PropertyNode node = PropertyList.Load(stream); | ||
Assert.IsNotNull(node); | ||
DictionaryNode dictionary = node.AsDictionaryNode(); | ||
Assert.IsNotNull(dictionary); | ||
Assert.AreEqual(14, dictionary.Count); | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void ReadFileWithUID() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/UidBinary.plist")) { | ||
DictionaryNode root = PropertyList.Load(stream).AsDictionaryNode(); | ||
|
||
Assert.IsNotNull(root); | ||
Assert.AreEqual(4, root.Count); | ||
|
||
DictionaryNode dict = root["$top"].AsDictionaryNode(); | ||
Assert.IsNotNull(dict); | ||
|
||
UidNode uid = dict["data"].AsUidNode(); | ||
Assert.IsNotNull(uid); | ||
|
||
Assert.AreEqual<ulong>(1, uid.Value); | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void ReadingFileWith16bitIntegers() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/UnityBinary.plist")) { | ||
try { | ||
PropertyNode node = PropertyList.Load(stream); | ||
} | ||
catch (PlistFormatException ex) { | ||
Assert.Fail(ex.Message); | ||
} | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void ReadingFileWithLargeDictionary() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/LargeDictionaryBinary.plist")) { | ||
try { | ||
PropertyNode node = PropertyList.Load(stream); | ||
DictionaryNode dictNode = node.AsDictionaryNode(); | ||
Assert.IsNotNull(dictNode); | ||
Assert.AreEqual(32768, dictNode.Keys.Count); | ||
} | ||
catch (PlistFormatException ex) { | ||
Assert.Fail(ex.Message); | ||
} | ||
} | ||
} | ||
} |
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,87 @@ | ||
using Netimobiledevice.Plist; | ||
using NetimobiledeviceTest.TestFiles; | ||
|
||
namespace NetimobiledeviceTest.Plist; | ||
|
||
[TestClass] | ||
public class XmlReaderTests | ||
{ | ||
[TestMethod] | ||
public void ParseXmlPlistWithSingleDictionary() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/GenericXml.plist")) { | ||
PropertyNode node = PropertyList.Load(stream); | ||
DictionaryNode dictionary = node.AsDictionaryNode(); | ||
Assert.IsNotNull(dictionary); | ||
Assert.AreEqual(14, dictionary.Count); | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void DocumentContainingNestedCollections() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/DictInsideArrayXml.plist")) { | ||
PropertyNode node = PropertyList.Load(stream); | ||
|
||
Assert.IsNotNull(node); | ||
Assert.IsInstanceOfType<DictionaryNode>(node); | ||
|
||
ArrayNode array = node.AsDictionaryNode().Values.First().AsArrayNode(); | ||
Assert.IsNotNull(array); | ||
Assert.AreEqual(1, array.Count); | ||
|
||
DictionaryNode dictionary = array[0].AsDictionaryNode(); | ||
Assert.IsNotNull(dictionary); | ||
|
||
Assert.AreEqual(4, dictionary.Count); | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void DocumentContainingEmptyArray() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/EmptyArrayXml.plist")) { | ||
DictionaryNode root = PropertyList.Load(stream).AsDictionaryNode(); | ||
|
||
Assert.IsNotNull(root); | ||
Assert.AreEqual(1, root.Count); | ||
|
||
Assert.IsInstanceOfType<DictionaryNode>(root["Entitlements"]); | ||
DictionaryNode dict = root["Entitlements"].AsDictionaryNode(); | ||
|
||
ArrayNode array = dict["com.apple.developer.icloud-container-identifiers"].AsArrayNode(); | ||
Assert.IsNotNull(array); | ||
Assert.AreEqual(0, array.Count); | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void ReadingFileWith16bitIntegers() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/UnityXml.plist")) { | ||
try { | ||
PropertyNode node = PropertyList.Load(stream); | ||
} | ||
catch (PlistFormatException ex) { | ||
Assert.Fail(ex.Message); | ||
} | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void ReadingFileWithLargeDictionary() | ||
{ | ||
using (Stream stream = TestFileHelper.GetTestFileStream("TestFiles/LargeDictionaryXml.plist")) { | ||
try { | ||
PropertyNode node = PropertyList.Load(stream); | ||
DictionaryNode dictNode = node.AsDictionaryNode(); | ||
Assert.IsNotNull(dictNode); | ||
Assert.AreEqual(32768, dictNode.Keys.Count); | ||
} | ||
catch (PlistFormatException ex) { | ||
Assert.Fail(ex.Message); | ||
} | ||
} | ||
} | ||
} | ||
|
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,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>UILaunchImages</key> | ||
<array> | ||
<dict> | ||
<key>UILaunchImageMinimumOSVersion</key> | ||
<string>7.0</string> | ||
<key>UILaunchImageName</key> | ||
<string>LaunchImage-700-568h</string> | ||
<key>UILaunchImageOrientation</key> | ||
<string>Portrait</string> | ||
<key>UILaunchImageSize</key> | ||
<string>{320, 568}</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</plist> |
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,85 @@ | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Entitlements</key> | ||
<dict> | ||
<key>com.apple.developer.pass-type-identifiers</key> | ||
<array> | ||
<string>S25XN959HW.*</string> | ||
</array> | ||
<key>com.apple.developer.networking.networkextension</key> | ||
<array> | ||
<string>app-proxy-provider</string> | ||
<string>content-filter-provider</string> | ||
<string>packet-tunnel-provider</string> | ||
<string>dns-proxy</string> | ||
</array> | ||
<key>com.apple.developer.networking.HotspotConfiguration</key> | ||
<true/> | ||
<key>com.apple.developer.networking.multipath</key> | ||
<true/> | ||
<key>com.apple.developer.nfc.readersession.formats</key> | ||
<array> | ||
<string>NDEF</string> | ||
</array> | ||
<key>com.apple.developer.ClassKit-environment</key> | ||
<array> | ||
<string>development</string> | ||
<string>production</string> | ||
</array> | ||
<key>com.apple.developer.authentication-services.autofill-credential-provider</key> | ||
<true/> | ||
<key>com.apple.developer.networking.wifi-info</key> | ||
<true/> | ||
<key>keychain-access-groups</key> | ||
<array> | ||
<string>S25XN959HW.*</string> | ||
</array> | ||
<key>inter-app-audio</key> | ||
<true/> | ||
<key>get-task-allow</key> | ||
<true/> | ||
<key>application-identifier</key> | ||
<string>S25XN959HW.com.os.os04</string> | ||
<key>com.apple.developer.healthkit</key> | ||
<true/> | ||
<key>com.apple.developer.healthkit.access</key> | ||
<array> | ||
<string>health-records</string> | ||
</array> | ||
<key>com.apple.developer.ubiquity-kvstore-identifier</key> | ||
<string>S25XN959HW.*</string> | ||
<key>com.apple.developer.icloud-services</key> | ||
<string>*</string> | ||
<key>com.apple.developer.icloud-container-identifiers</key> | ||
<array> </array> | ||
<key>com.apple.developer.icloud-container-development-container-identifiers</key> | ||
<array> </array> | ||
<key>com.apple.developer.ubiquity-container-identifiers</key> | ||
<array> </array> | ||
<key>com.apple.developer.associated-domains</key> | ||
<string>*</string> | ||
<key>com.apple.security.application-groups</key> | ||
<array> </array> | ||
<key>com.apple.developer.homekit</key> | ||
<true/> | ||
<key>com.apple.developer.team-identifier</key> | ||
<string>S25XN959HW</string> | ||
<key>com.apple.external-accessory.wireless-configuration</key> | ||
<true/> | ||
<key>aps-environment</key> | ||
<string>development</string> | ||
<key>com.apple.developer.in-app-payments</key> | ||
<array> </array> | ||
<key>com.apple.developer.default-data-protection</key> | ||
<string>NSFileProtectionComplete</string> | ||
<key>com.apple.developer.networking.vpn.api</key> | ||
<array> | ||
<string>allow-vpn</string> | ||
</array> | ||
<key>com.apple.developer.siri</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</plist> |
Binary file not shown.
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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIconFile</key> | ||
<string></string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.test.${PRODUCT_NAME:rfc1034identifier}</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>${PRODUCT_NAME}</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>${MACOSX_DEPLOYMENT_TARGET}</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2014 Test. All rights reserved.</string> | ||
<key>NSMainNibFile</key> | ||
<string>MainMenu</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
</dict> | ||
</plist> |
Binary file not shown.
Oops, something went wrong.