Skip to content

Commit 220f4d4

Browse files
committed
Fix compilation with Lilu 1.4.0
Closes #4.
1 parent 52b78d4 commit 220f4d4

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

NoTouchID.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
);
217217
runOnlyForDeploymentPostprocessing = 0;
218218
shellPath = /bin/bash;
219-
shellScript = "cd \"${TARGET_BUILD_DIR}\"\n\ndist=(\"$FULL_PRODUCT_NAME\")\nif [ -d \"$DWARF_DSYM_FILE_NAME\" ]; then dist+=(\"$DWARF_DSYM_FILE_NAME\"); fi\n\narchive=\"${MODULE_VERSION} ($(echo $CONFIGURATION | tr /a-z/ /A-Z/)).zip\"\nrm -rf *.zip\nif [ \"$CONFIGURATION\" == \"Release\" ]; then\n strip -x -T \"${EXECUTABLE_PATH}\" &>/dev/null || strip -x \"${EXECUTABLE_PATH}\"\nfi\nzip -qry \"${archive}\" \"${dist[@]}\"";
219+
shellScript = "cd \"${TARGET_BUILD_DIR}\"\n\ndist=(\"$FULL_PRODUCT_NAME\")\nif [ -d \"$DWARF_DSYM_FILE_NAME\" ]; then dist+=(\"$DWARF_DSYM_FILE_NAME\"); fi\n\narchive=\"${PRODUCT_NAME}-${MODULE_VERSION}-$(echo $CONFIGURATION | tr /a-z/ /A-Z/).zip\"\nrm -rf *.zip\nif [ \"$CONFIGURATION\" == \"Release\" ]; then\n strip -x -T \"${EXECUTABLE_PATH}\" &>/dev/null || strip -x \"${EXECUTABLE_PATH}\"\nfi\nzip -qry -FS \"${archive}\" \"${dist[@]}\"\n";
220220
};
221221
/* End PBXShellScriptBuildPhase section */
222222

@@ -350,7 +350,7 @@
350350
MODULE_NAME = xyz.racermaster.NoTouchID;
351351
MODULE_START = "$(PRODUCT_NAME)_kern_start";
352352
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
353-
MODULE_VERSION = 1.0.2;
353+
MODULE_VERSION = 1.0.3;
354354
OTHER_CFLAGS = (
355355
"-mmmx",
356356
"-msse",
@@ -397,7 +397,7 @@
397397
MODULE_NAME = xyz.racermaster.NoTouchID;
398398
MODULE_START = "$(PRODUCT_NAME)_kern_start";
399399
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
400-
MODULE_VERSION = 1.0.2;
400+
MODULE_VERSION = 1.0.3;
401401
OTHER_CFLAGS = (
402402
"-mmmx",
403403
"-msse",

NoTouchID/kern_start.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@
1010
#include <Headers/kern_api.hpp>
1111

1212
// Target framework
13-
static const char *binPath = "/System/Library/PrivateFrameworks/BiometricKit.framework/Versions/A/BiometricKit";
13+
static const char binPath[] = "/System/Library/PrivateFrameworks/BiometricKit.framework/Versions/A/BiometricKit";
1414

1515
// Accompanied processes
16-
static const char *procList[] {
17-
"/System/Library/Frameworks/LocalAuthentication.framework/Support/DaemonUtils.framework/Versions/A/DaemonUtils"
18-
};
16+
static const char procPath[] = "/System/Library/Frameworks/LocalAuthentication.framework/Support/DaemonUtils.framework/Versions/A/DaemonUtils";
1917

2018
static const uint8_t find[] = "board-id";
2119
static const uint8_t repl[] = "board-ix";
2220

21+
static_assert(sizeof(find) == sizeof(repl), "Invalid patch size");
22+
2323
static UserPatcher::BinaryModPatch patch {
2424
CPU_TYPE_X86_64,
25+
0,
2526
find,
2627
repl,
27-
strlen(reinterpret_cast<const char *>(find)),
28+
sizeof(find) - 1,
2829
0,
2930
1,
3031
UserPatcher::FileSegment::SegmentTextCstring,
@@ -38,15 +39,11 @@ UserPatcher::BinaryModInfo ADDPR(binaryMod)[] {
3839
const size_t ADDPR(binaryModSize) = 1;
3940

4041
static UserPatcher::ProcInfo ADDPR(procInfo)[] {
41-
{ procList[0], static_cast<uint32_t>(strlen(procList[0])), 1 }
42+
{ procPath, sizeof(procPath) - 1, 1 }
4243
};
4344

4445
const size_t ADDPR(procInfoSize) = 1;
4546

46-
static void noBioStart() {
47-
lilu.onProcLoad(ADDPR(procInfo), ADDPR(procInfoSize), nullptr, nullptr, ADDPR(binaryMod), ADDPR(binaryModSize));
48-
}
49-
5047
static const char *bootargOff[] {
5148
"-nobiooff"
5249
};
@@ -68,6 +65,6 @@ PluginConfiguration ADDPR(config) {
6865
KernelVersion::HighSierra,
6966
KernelVersion::Catalina,
7067
[]() {
71-
noBioStart();
68+
lilu.onProcLoad(ADDPR(procInfo), ADDPR(procInfoSize), nullptr, nullptr, ADDPR(binaryMod), ADDPR(binaryModSize));
7269
}
7370
};

0 commit comments

Comments
 (0)