我正在使用Receigen进行Apple收据检查.我在构建过程中集成了一个脚本,为我的项目生成适当的文件:
# Receigen binary
RECEIGEN="/Applications/Receigen.app/Contents/MacOS/Receigen"
# Extract Info.plist information
INPUT="$INFOPLIST_FILE"
BUNDLE_ID=`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "$INPUT"`
BUNDLE_VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INPUT"`
# Expand information if needed
EXPANDED_BUNDLE_ID=`eval "echo $BUNDLE_ID"`
EXPANDED_BUNDLE_VERSION=`eval "echo $BUNDLE_VERSION"`
# Make sure the destination directory exists
mkdir -p "$DERIVED_FILES_DIR"
HEADER="$DERIVED_FILES_DIR/receiptCheck.h"
# Check if the generation is needed
if [ -e "$HEADER" ]; then
SKIP=`grep -q "$EXPANDED_BUNDLE_ID" "$HEADER" && grep -q "$EXPANDED_BUNDLE_VERSION" "$HEADER" && echo "YES"`
fi
# Generate the header file if needed
if [ "x$SKIP" = "x" …Run Code Online (Sandbox Code Playgroud) 我正在使用 Receigen ( http://receigen.etiemble.com/ ) 为我的一款 MacOS 应用程序进行收据验证。多年来,这种方法一直运作良好,但有些事情发生了变化。我已经有一年左右没有对此应用程序进行更新并提交了更改,但由于收据验证不起作用而被拒绝。
\n\n当我尝试在本地测试收据时,它会弹出应用程序商店登录,我输入我的电子邮件+密码,然后收到“应用程序已损坏”消息。
\n\n我使用 Receigen 代码助手生成验证代码(它生成收据验证代码并尽可能随机化,这样您就不能轻松破解每个使用 receigen 的应用程序)。
\n\n我正在使用 macOS 10.14.3 和 Xcode 10.2。
\n\n这是我的 receiveigen 生成代码的标头:
\n\n// \n// This code was generated by RECEIGEN 4.0.4 on 2019-04-08 15:54:01 and will use: \n// \n// Bundle Identifier : com.inadaydevelopment.mac10biiFinancialCalculator \n// Bundle Version : 2.1.0 \n// Receipt Identifier : com.inadaydevelopment.mac10biiFinancialCalculator \n// Receipt Version : 2.1.0 \n// \n// Language : ObjC \n// Platform : OSX \n// Code Prefix : ReceiptValidation \n// Success …Run Code Online (Sandbox Code Playgroud) 在main.swift文件中,我们调用了收据检查系统(由Receigen生成).在Swift 2中,main.swift阅读:
startup(Process.argc, UnsafeMutablePointer<UnsafePointer<Int8>>(Process.unsafeArgv))
Run Code Online (Sandbox Code Playgroud)
升级到Swift 3后,我已经达到了:
startup(CommandLine.argc, UnsafeMutablePointer<UnsafePointer<Int8>>(CommandLine.unsafeArgv))
Run Code Online (Sandbox Code Playgroud)
显示错误:
无法将类型
UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>(akaUnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>)的值转换 为预期的参数类型UnsafeMutablePointer<_>
更新:使用链接的问题,使其显示为:
startup(CommandLine.argc, UnsafeMutableRawPointer(CommandLine.unsafeArgv)
.bindMemory(
to: UnsafeMutablePointer<Int8>.self,
capacity: Int(CommandLine.argc)))
Run Code Online (Sandbox Code Playgroud)
生产:
无法将类型的值转换
UnsafeMutablePointer<Int8>.Type为预期的参数类型UnsafePointer<Int8>?.Type(akaOptional<UnsafePointer<Int8>>.Type)
编译器所指的位置to:UnsafeMutablePointer.
启动标题如下:
int startup(int argc, const char * argv[]);
Run Code Online (Sandbox Code Playgroud)
如何成功将变量传递给启动main.swift?
我昨晚刚刚更新到Xcode 7.0,它似乎打破了Receigen生成的代码.
CFStringRef ReceiptValidation_str1 = @obfuscateCF@("");
Run Code Online (Sandbox Code Playgroud)
程序中意外的'@'
Receigen自2014年以来一直没有更新,所以这几乎肯定是一个Xcode 7问题.
我联系了Receigen的开发人员并且还没有收到回复(它只有几个小时).任何帮助,将不胜感激.