Skip to content

Commit

Permalink
Stable version 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjunetime committed Apr 29, 2021
1 parent fc27e47 commit b0239bf
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests.md
implement.md
.xcode-version
*.xcbkptlist
.jshintrc

src/SMServer/shared/IdentityPass.swift
src/SMServer/identity.pfx
Expand Down
5 changes: 4 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Changelog
0.7.4 → Unreleased
0.7.4 → 0.8.0
- Built libsmserver into the `.deb` package so that it is no longer necessary as a dependency
- Updates read receipts in real time
- Automatically displays texts sent by user from outside of SMServer ([#76](https://github.com/iandwelker/smserver/issues/76))
- Optimized profile image retrieval
- Added better notification images ([#119](https://github.com/iandwelker/smserver/issues/119))
- Removed _Compatible with libsmserver 0.x.x_ label at bottom of settings view
- Fixed incorrect mime type issues when returning profile pictures
- Fixed various potential issues in build script
- Fixed incorrect operating system retrieval
Expand All @@ -12,6 +14,7 @@
- Fixed infinite crashes when trying to run as daemon ([#111](https://github.com/iandwelker/smserver/issues/111))
- Fixed issue with different addresses being concatenated ([#118](https://github.com/iandwelker/smserver/issues/118))
- Fixed ordering of subjects with attachments & disappearing tapbacks ([#110](https://github.com/iandwelker/smserver/issues/110))
- Properly linted JavaScript and removed extraneous code

0.7.3 → 0.7.4
- Added support for sending tapbacks to specific parts of messages ([#81](https://github.com/iandwelker/smserver/issues/81))
Expand Down
60 changes: 30 additions & 30 deletions make.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/local/bin/bash

pn () {
{ [ $# -gt 1 ] && [[ "${2}" == "-n" ]] && echo -en "${1}" >&3; } || echo -e "${1}" >&3
Expand All @@ -23,7 +23,7 @@ leave() {
}

err () {
pn "\033[31;1mERROR:\033[0m ${1}"
pn "\e[31;1mERROR:\e[0m ${1}"
leave
}

Expand Down Expand Up @@ -81,33 +81,33 @@ then
pn "
usage: ./make.sh -hndivk
\033[1mOptions\033[0m:
\e[1mOptions\e[0m:
-h, --help : Shows this help message; ignores all other options
-n, --new : Runs processes that only need to happen once, specifically creating a certificate
and adding support swift files. You must run this at least once after cloning the
repo or else it won't build.
-d, --deb : Builds a .deb. Requires either the command line utility \033[1mdpkg\033[0m, or a jailbroken
-d, --deb : Builds a .deb. Requires either the command line utility \e[1mdpkg\e[0m, or a jailbroken
iDevice on the local network to ssh into to create the archive
-i, --ipa : Builds a .ipa
-v, --verbose : Runs verbose; doesn't hide any output
-k, --keep : Don't remove extracted \033[1mSMServer.app\033[0m files when cleaning up
-m, --minify : Minify css & html file when compiling assets using minify (\033[1mbrew install tdewolff/tap/minify\033[0m)
-k, --keep : Don't remove extracted \e[1mSMServer.app\e[0m files when cleaning up
-m, --minify : Minify css & html file when compiling assets using minify (\e[1mbrew install tdewolff/tap/minify\e[0m)
"
exit
fi

! command -v xcodebuild &>/dev/null && err "Please install xcode command line tools"

[ "$new" = true ] && ! command -v openssl &> /dev/null && err "Please install \033[1mopenssl\033[0m (required to build new certificates)"
[ "$new" = true ] && ! command -v openssl &> /dev/null && err "Please install \e[1mopenssl\e[0m (required to build new certificates)"
[ "$deb" = true ] && ! command -v dpkg &>/dev/null && err "Please install dpkg to create deb pagkage"

ls -A "${ROOTDIR}"/libsmserver/* || err "It looks like you haven't yet set up this repository's submodules. Please run \033[1mgit submodule init && git submodule update --remote\033[0m and try again."
ls -A "${ROOTDIR}"/libsmserver/* || err "It looks like you haven't yet set up this repository's submodules. Please run \e[1mgit submodule init && git submodule update --remote\e[0m and try again."

[ -z ${DEV_CERT+x} ] && DEV_CERT=$(security find-identity -v -p codesigning | head -n1 | cut -d '"' -f2)

if [ "$new" = true ]
then
pn "\n\033[33mWARNING:\033[0m Running this with the \033[1m-n\033[0m flag will delete the existing \033[1mcert.der\033[0m file and replace it with one you will be creating."
pn "\n\e[33mWARNING:\e[0m Running this with the \e[1m-n\e[0m flag will delete the existing \e[1mcert.der\e[0m file and replace it with one you will be creating."
pn "This is necessary to build from source. If you'd like to continue, hit enter. Else, cancel execution of this script\n"
pn "These new certificates will need a password to function correctly, which you'll need to provide."

Expand All @@ -118,14 +118,14 @@ then

while ! [[ "${pass}" == "${passcheck}" ]]
do
pn "\n\033[33mWARNING:\033[0m passwords are not equal. Please try again."
pn "\n\e[33mWARNING:\e[0m passwords are not equal. Please try again."
pn "Please enter the password: " -n
read -r pass
pn "Please enter again for verification: " -n
read -r passcheck
done

pn "\033[35m==>\033[0m Creating certificate..."
pn "\e[35m==>\e[0m Creating certificate..."
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 9999 -nodes -subj "/C=ZZ/ST=./L=./O=./CN=smserver.com"
openssl x509 -outform der -in cert.pem -out "${ROOTDIR}/src/SMServer/cert.der"
openssl pkcs12 -export -out "${ROOTDIR}/src/SMServer/identity.pfx" -inkey key.pem -in cert.pem -password pass:"$pass"
Expand All @@ -136,7 +136,7 @@ then

olddir="$(pwd)"
cd "${ROOTDIR}/src" || err "Source directory is gone"
pn "\033[35m==>\033[0m Installing pods..."
pn "\e[35m==>\e[0m Installing pods..."
pod install

cd "$olddir" || err "$olddir is gone"
Expand All @@ -145,87 +145,87 @@ fi

if [ "$deb" = true ] || [ "$ipa" = true ]
then
pn "\033[34m==>\033[0m Checking files and LLVM Version..."
pn "\e[34m==>\e[0m Checking files and LLVM Version..."
llvm_vers=$(llvm-gcc --version | grep -oE "clang\-[0-9]{4,}" | sed 's/clang\-//g')
[ "${llvm_vers}" -lt 1200 ] && \
err "You are using llvm < 1200 (Xcode 11.7 or lower); this will fail to compile. Please install Xcode 12.0 or higher to build SMServer."

{ ! [ -f ${ROOTDIR}/src/SMServer/identity.pfx ] || ! [ -f ${ROOTDIR}/src/SMServer/shared/IdentityPass.swift ]; } && \
err "You haven't created some files necessary to compile this. Please run this script with the \033[1m-n\033[0m or \033[1m--new\033[0m flag first"
err "You haven't created some files necessary to compile this. Please run this script with the \e[1m-n\e[0m or \e[1m--new\e[0m flag first"

if [ "$min" = true ]
then
! command -v minify && err "Please install minify to minify asset files"

pn "\033[34m==>\033[0m Minifying css & html files..."
pn "\e[34m==>\e[0m Minifying css & html files..."
cp -r "${html_dir}/" "${html_tmp}/"

find "$html_tmp" -name "*.css" | while read -r file
ls "$html_tmp"/*.css | while read -r file
do
newfile="${file//$(printf "%q" "$html_tmp")/$(printf "%q" "$html_dir")}"
minify "$file" > "$newfile"
done

find "$html_tmp" -name "*.html" | while read -r file
ls "$html_tmp"/*.html | while read -r file
do
newfile="${file//$(printf "%q" "$html_tmp")/$(printf "%q" "$html_dir")}"
minify --html-keep-comments --html-keep-document-tags --html-keep-end-tags --html-keep-quotes --html-keep-whitespace "$file" > "$newfile"
done
fi

rm -rf "${ROOTDIR}/package/SMServer.xcarchive"
pn "\033[34m==>\033[0m Cleaning and archiving package..."
pn "\e[34m==>\e[0m Cleaning and archiving package..."
xcodebuild clean archive -workspace "${ROOTDIR}/src/SMServer.xcworkspace" -scheme SMServer -archivePath "${ROOTDIR}/package/SMServer.xcarchive" -destination generic/platform=iOS -allowProvisioningUpdates \
|| err "Failed to archive package. Run again with \033[1m-v\033[0m to see why"
|| err "Failed to archive package. Run again with \e[1m-v\e[0m to see why"

pn "\033[34m==>\033[0m Codesigning..."
pn "\e[34m==>\e[0m Codesigning..."
codesign --entitlements "${ROOTDIR}/src/app.entitlements" -f --deep -s "${DEV_CERT}" "${ROOTDIR}/package/SMServer.xcarchive/Products/Applications/SMServer.app"

pn "✅ \033[1mSMServer.app successfully created\033[0m\n"
pn "✅ \e[1mSMServer.app successfully created\e[0m\n"
fi

if [ "$deb" = true ]
then
recv=false

pn "\033[92m==>\033[0m Extracting \033[1mSMServer.app\033[0m..."
pn "\e[92m==>\e[0m Extracting \e[1mSMServer.app\e[0m..."
mkdir -p "${ROOTDIR}/package/deb/Applications"
rm -rf "${ROOTDIR}/package/deb/Applications/SMServer.app"
cp -r "${ROOTDIR}/package/SMServer.xcarchive/Products/Applications/SMServer.app" "${ROOTDIR}/package/deb/Applications/SMServer.app"

pn "\033[92m==>\033[0m Building \033[1mlibsmserver\033[0m..."
pn "\e[92m==>\e[0m Building \e[1mlibsmserver\e[0m..."
cd "${ROOTDIR}/libsmserver" || err "The libsmserver directory is gone."

make -B package FINALPACKAGE=1 || err "Failed to build libsmserver. Run with the \033[1m-v\033[0m to see details"
make -B package FINALPACKAGE=1 || err "Failed to build libsmserver. Run with the \e[1m-v\e[0m to see details"
cd ".." || err "The parent directory is gone."

cp "${ROOTDIR}/libsmserver/lib/libsmserver.dylib" "${ROOTDIR}/package/deb/Library/MobileSubstrate/DynamicLibraries/"
cp "${ROOTDIR}/libsmserver/libsmserver.plist" "${ROOTDIR}/package/deb/Library/MobileSubstrate/DynamicLibraries/"

pn "\033[92m==>\033[0m Building \033[1m.deb\033[0m..."
pn "\e[92m==>\e[0m Building \e[1m.deb\e[0m..."
dpkg -b "${ROOTDIR}/package/deb"
{ mv "${ROOTDIR}/package/deb.deb" "${ROOTDIR}/package/SMServer_${vers}.deb" && recv=true; } || \
pn "\033[33;1mWARNING:\033[0m Failed to create .deb. Run with \033[1m-v\033[0m to see more details."
pn "\e[33;1mWARNING:\e[0m Failed to create .deb. Run with \e[1m-v\e[0m to see more details."

if [ "$recv" = true ]
then
pn "✅ SMServer_${vers}.deb successfully created at \033[1m${ROOTDIR}/package/SMServer_${vers}.deb\033[0m\n"
pn "✅ SMServer_${vers}.deb successfully created at \e[1m${ROOTDIR}/package/SMServer_${vers}.deb\e[0m\n"
else
rm "${ROOTDIR}/package/SMServer_${vers}.deb" # Since it may be corrupted
fi
fi

if [ "$ipa" = true ]
then
pn "\033[35m==>\033[0m Extracting \033[1mSMServer.app\033[0m..."
pn "\e[35m==>\e[0m Extracting \e[1mSMServer.app\e[0m..."
mkdir -p "${ROOTDIR}/package/Payload"
rm -r "${ROOTDIR}/package/Payload/SMServer.app"
cp -r "${ROOTDIR}/package/SMServer.xcarchive/Products/Applications/SMServer.app" "${ROOTDIR}/package/Payload/SMServer.app"

pn "\033[35m==>\033[0m Compressing payload into \033[1mSMServer_${vers}.ipa\033[0m..."
pn "\e[35m==>\e[0m Compressing payload into \e[1mSMServer_${vers}.ipa\e[0m..."
ditto -c -k --sequesterRsrc --keepParent "${ROOTDIR}/package/Payload" "${ROOTDIR}/package/SMServer_${vers}.ipa"

pn "✅ SMServer_${vers}.ipa successfully created a† \033[1m${ROOTDIR}/package/SMServer_${vers}.ipa\033[0m"
pn "✅ SMServer_${vers}.ipa successfully created a† \e[1m${ROOTDIR}/package/SMServer_${vers}.ipa\e[0m"
fi

leave
1 change: 1 addition & 0 deletions package/deb/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Description: Send texts from your browser!
Maintainer: Ian Welker <[email protected]>
Author: Ian Welker
Section: Multimedia
Installed-Size: 5940
Binary file not shown.
Loading

0 comments on commit b0239bf

Please sign in to comment.