Compare commits

...

4 Commits

Author SHA1 Message Date
Sam Bingner ae770e356b Revert to resources supporting substitute if newer Unc0ver has been run 2019-01-15 22:16:56 -10:00
Sam Bingner 60dc9cb8ed Automatically generate unc0ver version from git tags 2019-01-15 22:15:20 -10:00
Sam Bingner a8f3f0d1e1 Create a post.sh to simplify post-compile shell script 2019-01-15 22:15:20 -10:00
Sam Bingner 6ba21570ba Update version display to be dynamic 2019-01-15 22:15:20 -10:00
7 changed files with 38 additions and 3 deletions
+1 -1
View File
@@ -428,7 +428,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Get path for dpkg\nset -e\nif [ -f ~/.profile ]; then\n . ~/.profile\nfi\nRESOURCES_VERSION=\"$(dpkg --info Undecimus/resources/resources.deb | grep Version: | awk '{print $2}')\"\nif [ -z \"${RESOURCES_VERSION}\" ]; then\n echo \"dpkg not found or resources.deb missing\"\n exit 1\nfi\ndefaults write \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\" BundledResources \"${RESOURCES_VERSION}\"\n";
shellScript = "\"${SOURCE_ROOT}/post.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */
+1 -1
View File
@@ -883,7 +883,7 @@
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Utilities" footerTitle="unc0ver v2.1.1" id="33o-xO-9yG">
<tableViewSection headerTitle="Utilities" footerTitle="PLACEHOLDER" id="33o-xO-9yG">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="2Iu-w9-x4b">
<rect key="frame" x="0.0" y="955" width="320" height="44"/>
@@ -410,6 +410,7 @@
}
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UITableViewHeaderFooterView *)footerView forSection:(NSInteger)section {
footerView.textLabel.text = [@"unc0ver " stringByAppendingString:[[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"]];
footerView.textLabel.textAlignment = NSTextAlignmentCenter;
}
+4 -1
View File
@@ -672,9 +672,12 @@ void extractResources() {
if (!debIsInstalled("com.bingner.spawn")) {
_assert(installDeb("spawn.deb", false), message, true);
}
if (!debIsConfigured("science.xnu.injector")) {
if (!debIsConfigured("science.xnu.injector") && !debIsConfigured("trustinjector")) {
_assert(installDeb("injector.deb", false), message, true);
}
if (debIsInstalled("jailbreak-resources")) {
_assert(removeDeb("jailbreak-resources", true), message, true);
}
_assert(installDeb("resources.deb", false), message, true);
}
+1
View File
@@ -64,6 +64,7 @@ bool debIsConfigured(char *packageID);
bool compareInstalledVersion(const char *packageID, const char *op, const char *version);
bool installDeb(char *debName, bool forceDeps);
bool installDebs(NSArray <NSString*> *debs, bool forceDeps);
bool removeDeb(char *packageID, bool forceDeps);
bool pidFileIsValid(NSString *pidfile);
bool pspawnHookLoaded(void);
bool is_symlink(const char *filename);
+5
View File
@@ -172,6 +172,11 @@ bool installDebs(NSArray <NSString*> *debs, bool forceDeps) {
return !WEXITSTATUS(rv);
}
bool removeDeb(char *packageID, bool forceDeps) {
int rv = systemf("/usr/bin/dpkg %s -r \"%s\"", (forceDeps?"--force-depends":""), packageID);
return !WEXITSTATUS(rv);
}
bool pidFileIsValid(NSString *pidfile) {
NSString *jbdpid = [NSString stringWithContentsOfFile:pidfile encoding:NSUTF8StringEncoding error:NULL];
if (jbdpid != nil && pidOfProcess("/usr/libexec/jailbreakd") == jbdpid.integerValue) {
Executable
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
# Get path for dpkg
set -e
if [ -f ~/.profile ]; then
. ~/.profile
fi
RESOURCES_VERSION="$(dpkg --info ${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/resources.deb | grep Version: | awk '{print $2}')"
if [ -z "${RESOURCES_VERSION}" ]; then
echo "dpkg not found or resources.deb missing"
exit 1
else
echo "Bundled resources: ${RESOURCES_VERSION}"
fi
PACKAGE_VERSION="$(git describe --tags --match="v*" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@;s@%@~@g')"
if [ -z "${PACKAGE_VERSION}" ]; then
echo "Could not generate package version"
exit 1
else
echo "Package Version: ${PACKAGE_VERSION}"
fi
defaults write "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" BundledResources "${RESOURCES_VERSION}"
defaults write "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" CFBundleShortVersionString "${PACKAGE_VERSION}"