-
Notifications
You must be signed in to change notification settings - Fork 98
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
1 parent
724a5f0
commit 8f30db3
Showing
10 changed files
with
106 additions
and
13 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
Package: com.ethanarbuckle.carplayenable | ||
Package: com.cortex.carplayenable | ||
Name: carplayenable | ||
Depends: mobilesubstrate | ||
Version: 0.1.0 | ||
Architecture: iphoneos-arm | ||
Description: Use any app with CarPlay | ||
Maintainer: Ethan Arbuckle | ||
Author: Ethan Arbuckle | ||
Maintainer: Cortex | ||
Author: Cortex | ||
Section: Tweaks |
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,8 @@ | ||
Origin: repo.ghostbin | ||
Label: repo.ghostbin | ||
Suite: testing | ||
Version: 1.0 | ||
Codename: repo.ghostbin | ||
Architectures: iphoneos-arm | ||
Components: main | ||
Description: repo.ghostbin |
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 @@ | ||
import subprocess | ||
from typing import Optional | ||
import sys | ||
from pathlib import Path | ||
import hashlib | ||
import tempfile | ||
import gzip | ||
|
||
|
||
REPO_IP_ADDRESS = "206.189.219.64" | ||
REPO_PATH = "/var/www/repo.ghostbin.co" | ||
DEBS_FOLDER = "debs" | ||
|
||
|
||
def run_local_command(command: str) -> Optional[str]: | ||
output = subprocess.check_output(command, shell=True) | ||
return output.decode("utf-8") if output else None | ||
|
||
def run_remote_command(command: str) -> Optional[str]: | ||
full_command = f"ssh root@{REPO_IP_ADDRESS} \"{command}\"" | ||
return run_local_command(full_command) | ||
|
||
def send_file(local_file: str, remote_path: str) -> None: | ||
run_local_command(f"scp \"{local_file}\" root@{REPO_IP_ADDRESS}:\"{REPO_PATH}/{remote_path}\"") | ||
|
||
|
||
def run(deb_to_upload: Path) -> None: | ||
|
||
# Confirm connection | ||
try: | ||
if "var" not in run_remote_command("ls /"): | ||
raise Exception() | ||
# Create debs folder | ||
run_remote_command(f"mkdir -p {REPO_PATH}/{DEBS_FOLDER}") | ||
except: | ||
raise RuntimeError(f"Failed to connect to {REPO_IP_ADDRESS}") | ||
|
||
# Upload the Release file | ||
release_file_path = Path(__file__).parent / "Release" | ||
send_file(release_file_path.as_posix(), "Release") | ||
|
||
# Generate the Package info | ||
package_info = run_local_command(f"dpkg -I {deb_to_upload.as_posix()} control") | ||
|
||
# Generate hashes and add them to package info | ||
with open(deb_to_upload.as_posix(), mode="rb") as debf: | ||
deb_contents = debf.read() | ||
# Add md5 | ||
md5_hash = hashlib.md5(deb_contents).hexdigest() | ||
package_info += f"MD5sum: {md5_hash}\n" | ||
# Add sha1 | ||
sha1_hash = hashlib.sha1(deb_contents).hexdigest() | ||
package_info += f"SHA1: {sha1_hash}\n" | ||
# Add sha256 | ||
sha256_hash = hashlib.sha256(deb_contents).hexdigest() | ||
package_info += f"SHA256: {sha256_hash}\n" | ||
|
||
# Add deb name to package file | ||
remote_deb_location = f"debs/{deb_to_upload.name}" | ||
package_info += f"Filename: {remote_deb_location}\n" | ||
|
||
# Gzip package file and upload | ||
# with tempfile.NamedTemporaryFile(mode="wb") as packagef | ||
with open("Packages.gz", mode="wb") as packagef, gzip.GzipFile(fileobj=packagef, mode="wb") as gzout: | ||
# Write contents to temp file | ||
gzout.write(package_info.encode("utf-8")) | ||
gzout.flush() | ||
gzout.close() | ||
packagef.close() | ||
# Send to server | ||
send_file(packagef.name, "Packages.gz") | ||
|
||
# Upload deb | ||
send_file(deb_to_upload.as_posix(), remote_deb_location) | ||
|
||
print("done") | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
if len(sys.argv) < 2 or ".deb" not in sys.argv[1]: | ||
raise Exception("No deb provided") | ||
|
||
provided_deb = Path(sys.argv[1]) | ||
run(provided_deb) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#define CRASH_REPORT_URL @"https://us-central1-decoded-cove-239422.cloudfunctions.net/process_crash_reports" | ||
#define UPLOADED_LOGS_PLIST_PATH @"/var/mobile/Library/Preferences/com.ethanarbuckle.carplay-uploaded-crashlogs.plist" | ||
#define UPLOADED_LOGS_PLIST_PATH @"/var/mobile/Library/Preferences/com.carplayenable.uploaded-crashlogs.plist" | ||
|
||
void symbolicateAndUploadCrashlogs(void); |
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