Browse Source

Added nitotv flags and fixed ldid signing

Jaywalker 6 years ago
parent
commit
6a2c155b36
1 changed files with 64 additions and 13 deletions
  1. 64 13
      the_memo.sh

+ 64 - 13
the_memo.sh

@@ -24,6 +24,7 @@ PKG_NAME="" #The name of our current package being built
 PKG_VERSION="-1"
 WORKING_DIR="" #This stores the working directory under BUILD_ROOT
 BUILD_BASH="false"
+NITOTV="false"
 
 set -e
 # set trap to help debug any build errors
@@ -40,6 +41,9 @@ while test $# -gt 0; do
 		-h|--help)
 			usage
 			;;
+		-n|--nito-tv)
+			NITOTV="true"
+			;;
 		-c|--codesign-tool)
 			shift
 			if test $# -gt 0; then
@@ -202,9 +206,15 @@ codesign() {
 		jtool --sign platform --ent "$BUILD_ROOT/ent.plist" "$1"
 		sudo cp -X out.bin "$1"
 	elif [ "$CODESIGN_TOOL" == "ldid" ]; then
-		ldid -S "$1"
+		cp "$1" out.bin
+		sudo chmod 777 out.bin
+		ldid -S out.bin
+		sudo cp -X out.bin "$1"
 	elif [ "$CODESIGN_TOOL" == "ldid2" ]; then
-		ldid2 -S "$1"
+		cp "$1" out.bin
+		sudo chmod 777 out.bin
+		ldid2 -S out.bin
+		sudo cp -X out.bin "$1"
 	fi
 }
 
@@ -3426,31 +3436,42 @@ installSubstrate() {
 	if [ ! -e mobilesubstrate_0.9.6301_iphoneos-arm.deb ]; then
 		curl -LO http://apt.saurik.com/debs/com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb
 		checkSHA256 com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb 86515cb9f6832247dbeae8427b996099dc8759bb1ef1d719c293123f2f531ee1
-		curl -LO http://apt.saurik.com/debs/mobilesubstrate_0.9.6301_iphoneos-arm.deb
-		checkSHA256 mobilesubstrate_0.9.6301_iphoneos-arm.deb 8dc91a066f088632409fecf65613831b8d6802e3b799f2dc87563c3ea2ed06ca
+		#curl -LO http://apt.saurik.com/debs/mobilesubstrate_0.9.6301_iphoneos-arm.deb
+		#checkSHA256 mobilesubstrate_0.9.6301_iphoneos-arm.deb 8dc91a066f088632409fecf65613831b8d6802e3b799f2dc87563c3ea2ed06ca
+		curl -LO http://nitosoft.com/repo/deb/mobilesubstrate_0.9.6301_appletvos-arm64.deb
 	fi
 
 	initDebStructure
-	dpkg-deb -e mobilesubstrate_0.9.6301_iphoneos-arm.deb deb/DEBIAN
-	dpkg-deb -x mobilesubstrate_0.9.6301_iphoneos-arm.deb deb
-	sed -i -- "s|iphoneos-arm|${PLATFORM_LOWER}-$ARCH|" deb/DEBIAN/control
-	createListFile mobilesubstrate
-	dpkg -b deb
-	mv deb.deb "mobilesubstrate_0.9.6301_${PLATFORM_LOWER}-$ARCH.deb"
-	dpkg-deb -e com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb deb/DEBIAN
+	#dpkg-deb -e mobilesubstrate_0.9.6301_iphoneos-arm.deb deb/DEBIAN
+	#dpkg-deb -x mobilesubstrate_0.9.6301_iphoneos-arm.deb deb
+	#sed -i -- "s|iphoneos-arm|${PLATFORM_LOWER}-$ARCH|" deb/DEBIAN/control
+	dpkg-deb -e mobilesubstrate_0.9.6301_appletvos-arm64.deb deb/DEBIAN
+	dpkg-deb -x mobilesubstrate_0.9.6301_appletvos-arm64.deb deb
+	PKG_NAME="mobilesubstrate"
+	PKG_VERSION="0.9.6301"
+	echo "here?"
+	createListFile
+	echo "here??"
+	#dpkg -b deb
+	#mv deb.deb "mobilesubstrate_0.9.6301_${PLATFORM_LOWER}-$ARCH.deb"
+	#dpkg-deb -e com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb deb/DEBIAN
 
 	initDebStructure
+	dpkg-deb -e com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb deb/DEBIAN
 	dpkg-deb -x com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb deb
 	sed -i -- "s|iphoneos-arm|${PLATFORM_LOWER}-$ARCH|" deb/DEBIAN/control
-	createListFile com.saurik.substrate.safemode
+	PKG_NAME="com.saurik.substrate.safemode"
+	PKG_VERSION="0.9.6001"
+	createListFile
 	dpkg -b deb
 	mv deb.deb "com.saurik.substrate.safemode_0.9.6001_${PLATFORM_LOWER}-$ARCH.deb"
-	rm mobilesubstrate_0.9.6301_iphoneos-arm.deb com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb
+	rm com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb
 	dpkg-deb -x "com.saurik.substrate.safemode_0.9.6001_${PLATFORM_LOWER}-$ARCH.deb" "$SKEL_PREFIX/"
 	dpkg-deb -x "mobilesubstrate_0.9.6301_${PLATFORM_LOWER}-$ARCH.deb" "$SKEL_PREFIX/"
 	#dpkg-deb -x com.saurik.substrate.safemode_0.9.6001_iphoneos-arm.deb
 }
 
+
 #main functions
 #main
 #Entry Point
@@ -3480,6 +3501,36 @@ buildAPTAndDependencies
 #createListFile "com.nito.nitoTV4"
 #dpkg-deb -x nitoTVLatest.deb "$SKEL_PREFIX"
 
+if [ "$NITOTV" == "true" ]; then
+	installSubstrate
+	rm -rf deb
+	mkdir -p deb/DEBIAN
+	dpkg-deb -x nitoTV_2.0-24_appletvos-arm64.deb deb
+	dpkg-deb -e nitoTV_2.0-24_appletvos-arm64.deb deb/DEBIAN
+	PKG_NAME="com.nito.nitoTV4"
+	PKG_VERSION="2.0-24"
+	createListFile
+	dpkg-deb -x nitoTV_2.0-24_appletvos-arm64.deb "$SKEL_PREFIX"
+
+	rm -rf deb
+	mkdir -p deb/DEBIAN
+	dpkg-deb -x com.nito.tssagent_1.0-appletvos-arm64.deb deb
+	dpkg-deb -e com.nito.tssagent_1.0-appletvos-arm64.deb deb/DEBIAN
+	PKG_NAME="com.nito.tssagent"
+	PKG_VERSION="1.0"
+	createListFile
+	dpkg-deb -x com.nito.tssagent_1.0-appletvos-arm64.deb "$SKEL_PREFIX"
+
+	rm -rf deb
+	mkdir -p deb/DEBIAN
+	dpkg-deb -x com.nito.uicache_0.0.1-245_appletvos-arm64.deb deb
+	dpkg-deb -e com.nito.uicache_0.0.1-245_appletvos-arm64.deb deb/DEBIAN
+	PKG_NAME="com.nito.uicache"
+	PKG_VERSION="0.0.1-245"
+	createListFile
+	dpkg-deb -x com.nito.uicache_0.0.1-245_appletvos-arm64.deb "$SKEL_PREFIX"
+fi
+
 createStatusFile
 
 #clean out frivolous stuff to slim skel down to a reasonable size