@@ -773,7 +773,7 @@ var _ = Describe("AppStore (Download)", func() {
773
773
})
774
774
})
775
775
776
- When ("app uses modern FiarPlay protection" , func () {
776
+ When ("app uses modern FairPlay protection" , func () {
777
777
BeforeEach (func () {
778
778
zipFile = zip .NewWriter (tmpFile )
779
779
w , err := zipFile .Create ("Payload/Test.app/SC_Info/Manifest.plist" )
@@ -810,6 +810,68 @@ var _ = Describe("AppStore (Download)", func() {
810
810
Expect (err ).ToNot (HaveOccurred ())
811
811
})
812
812
})
813
+
814
+ When ("app uses modern FairPlay protection and has Watch app" , func () {
815
+ BeforeEach (func () {
816
+ zipFile = zip .NewWriter (tmpFile )
817
+ w , err := zipFile .Create ("Payload/Test.app/SC_Info/Manifest.plist" )
818
+ Expect (err ).ToNot (HaveOccurred ())
819
+
820
+ manifest , err := plist .Marshal (PackageManifest {
821
+ SinfPaths : []string {
822
+ "SC_Info/TestApp.sinf" ,
823
+ },
824
+ }, plist .BinaryFormat )
825
+ Expect (err ).ToNot (HaveOccurred ())
826
+
827
+ _ , err = w .Write (manifest )
828
+ Expect (err ).ToNot (HaveOccurred ())
829
+
830
+ w , err = zipFile .Create ("Payload/Test.app/Info.plist" )
831
+ Expect (err ).ToNot (HaveOccurred ())
832
+
833
+ info , err := plist .Marshal (map [string ]interface {}{
834
+ "CFBundleExecutable" : "Test" ,
835
+ }, plist .BinaryFormat )
836
+ Expect (err ).ToNot (HaveOccurred ())
837
+
838
+ _ , err = w .Write (info )
839
+ Expect (err ).ToNot (HaveOccurred ())
840
+
841
+ w , err = zipFile .Create ("Payload/Test.app/Watch/Test Watch App.app/Info.plist" )
842
+ Expect (err ).ToNot (HaveOccurred ())
843
+
844
+ watchInfo , err := plist .Marshal (map [string ]interface {}{
845
+ "WKWatchKitApp" : true ,
846
+ }, plist .BinaryFormat )
847
+ Expect (err ).ToNot (HaveOccurred ())
848
+
849
+ _ , err = w .Write (watchInfo )
850
+ Expect (err ).ToNot (HaveOccurred ())
851
+
852
+ err = zipFile .Close ()
853
+ Expect (err ).ToNot (HaveOccurred ())
854
+ })
855
+
856
+ It ("sinf is in the correct path" , func () {
857
+ outputPath := strings .TrimSuffix (tmpFile .Name (), ".tmp" )
858
+ err := as .Download ("" , outputPath , true )
859
+ Expect (err ).ToNot (HaveOccurred ())
860
+
861
+ r , err := zip .OpenReader (outputPath )
862
+ Expect (err ).ToNot (HaveOccurred ())
863
+ defer r .Close ()
864
+
865
+ found := false
866
+ for _ , f := range r .File {
867
+ if f .Name == "Payload/Test Watch App.app/SC_Info/TestApp.sinf" {
868
+ found = true
869
+ break
870
+ }
871
+ }
872
+ Expect (found ).To (BeFalse ())
873
+ })
874
+ })
813
875
})
814
876
})
815
877
})
0 commit comments