已损坏,无法打开。您应该将它移到废纸篓

安装破解版的app或者非appstroe的app经常会遇到这个问题。出现这个情况,通过下面的方法并不能解决:

  1. 系统偏好设置-任何来源“——不管用
  2. 没有任何来源字样,搞定之后勾上任何来源,不管用

实际上问题是出在了mac的quarantine flag上,如果要修复这个问题需要用到下面的命令:

sudo xattr -rd com.apple.quarantine /Applications/xxx.app

com.apple.quarantine属性:

Type: com.apple.quarantine
Subtypes: none
Serialisation: none
Data type: UTF-8 string containing Gatekeeper score, the system time of download, the downloading app or agent, and a UUID for the event
Example: <30303833 3b353833 37316533 633b5361 66617269 2e617070 3b334239 32393643 302d4336 46342d34 3942332d 42414331 2d424342 32323946 46453744 36> «0083;58371e3c;Safari.app;3B9296C0-C6F4-49B3-BAC1-BCB229FFE7D6»
macOS: El Capitan, Sierra, High Sierra
System use: very uncommon
App use: all downloaded apps
Document use: common, notably Zip and other archives which have been downloaded
Other usage: none

Purpose: flags requirement to perform full Gatekeeper check on downloaded app (or executable).
Continue Reading

Mac OSX Guest账号无法登录

去年OSX更新之后Guest账号就无法登录,很久之前发了weibo,@苹果的官方支持,但是也没人理我~~ 这个账号对于自己来说并没有什么太大的用处,但是家里的小朋友有时候会想随便玩玩电脑,假装自己在工作。没有这个账号还真的十分蛋疼。

今天又想到了这个问题,就想看看有什么办法解决这个问题没。整个账号设置看起来十分正常:

 

Continue Reading

OSX pip3 install mysqlclient

在家办公于是将工作环境换到了mac,配置环境的时候安装mysqlclient出现了下面的错误:

(venv_home_mini) obaby@Obabys-Mac-mini taichigameserver % pip3 install mysqlclient
Collecting mysqlclient
  Using cached https://files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: command not found
    /bin/sh: mariadb_config: command not found
    /bin/sh: mysql_config: command not found
    Traceback (most recent call last):
      File "", line 1, in 
      File "/private/var/folders/gf/qbbv4crd5m9f1vkz5066dvyw0000gn/T/pip-install-m5gv0sbr/mysqlclient/setup.py", line 16, in 
        metadata, options = get_config()
      File "/private/var/folders/gf/qbbv4crd5m9f1vkz5066dvyw0000gn/T/pip-install-m5gv0sbr/mysqlclient/setup_posix.py", line 61, in get_config
        libs = mysql_config("libs")
      File "/private/var/folders/gf/qbbv4crd5m9f1vkz5066dvyw0000gn/T/pip-install-m5gv0sbr/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/gf/qbbv4crd5m9f1vkz5066dvyw0000gn/T/pip-install-m5gv0sbr/mysqlclient/

网上搜了一下说安装mysql-connector-c  ,但是安装之后依然报错。于是尝试安装mysql,安装mysql之后解决该问题,其实出问题的地方在于这个命令找不到,如果直接在终端中执行mysql_config如果能够执行成功,那么只需要创建个软连接就可以解决这个问题。

(venv_home_mini) obaby@Obabys-Mac-mini taichigameserver % mysql_config
Usage: /usr/local/bin/mysql_config [OPTIONS]
Compiler: AppleClang 11.0.0.11000033
Options:
        --cflags         [-I/usr/local/Cellar/mysql/8.0.19/include/mysql ]
        --cxxflags       [-I/usr/local/Cellar/mysql/8.0.19/include/mysql ]
        --include        [-I/usr/local/Cellar/mysql/8.0.19/include/mysql]
        --libs           [-L/usr/local/Cellar/mysql/8.0.19/lib -lmysqlclient -lssl -lcrypto]
        --libs_r         [-L/usr/local/Cellar/mysql/8.0.19/lib -lmysqlclient -lssl -lcrypto]
        --plugindir      [/usr/local/Cellar/mysql/8.0.19/lib/plugin]
        --socket         [/tmp/mysql.sock]
        --port           [0]
        --version        [8.0.19]
        --variable=VAR   VAR is one of:
                pkgincludedir [/usr/local/Cellar/mysql/8.0.19/include/mysql]
                pkglibdir     [/usr/local/Cellar/mysql/8.0.19/lib]
                plugindir     [/usr/local/Cellar/mysql/8.0.19/lib/plugin]

安装命令:

brew install mysql

如果没有安装homebrew,通过下面的命令安装:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  

使用apple script管理进程

代码如下:

tell application "System Events"
	set listOfProcesses to (name of every process where background only is false)
	tell me to set selectedProcesses to choose from list listOfProcesses with multiple selections allowed
end tell
--The variable `selectedProcesses` will contain the list of selected items.
repeat with processName in selectedProcesses
	do shell script "Killall " & quoted form of processName
end repeat

和系统的活动监视器相比,好处在于只有前台进程。

xcode 9.2 集成obfuscator-llvm

Obfuscator-LLVM is a project initiated in June 2010 by the information security group of the University of Applied Sciences and Arts Western Switzerland of Yverdon-les-Bains (HEIG-VD).

The aim of this project is to provide an open-source fork of the LLVM compilation suite able to provide increased software security through code obfuscation and tamper-proofing. As we currently mostly work at the Intermediate Representation (IR) level, our tool is compatible with all programming languages (C, C++, Objective-C, Ada and Fortran) and target platforms (x86, x86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC, Alpha, CellSPU, MIPS, MSP430, SystemZ, and XCore) currently supported by LLVM.

对于这个插件,网上的安装文章相对来说还是挺多的,例如官方的文档https://github.com/obfuscator-llvm/obfuscator/wiki/Installation,再例如 http://www.exchen.net/ios-hacker-obfuscator-llvm-xcode%E9%9B%86%E6%88%90%E9%85%8D%E7%BD%AE.html。已经写的都非常详细了,按照上面的文章基本都可以配置好了,唯一需要注意的是如果xcode的版本不同,对应的里面的字符串可能不一致,例如:

<string>Apple LLVM 8.0</string> -> <string>Obfuscator 4.0</string>

如果用的是xcode9 那么应该是Apple LLVM 9.0。同时如果在编译之前没有安装cmake,可以通过homebrew来安装还是非常方便的。

brew install cmake

Homebrew installs the stuff you need that Apple didn’t.

如何安装homebrew请参考这个链接:https://brew.sh/

如果不想跳转上面的链接,直接在终端中执行下面的安装代码即可:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

这里想说的是安装完成之后,还可能会出现别的问题,例如提示编译的时候提示下面的信息:

clang-4.0: error: cannot specify -o when generating multiple output files
Continue Reading

osx cycript image not found

今天在osx上运行cycript的时候出现了如下的错误:

/Users/obaby/Desktop/小项目/keygen/cycript_0.9.594/cycript
dyld: Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib
Referenced from: /Users/obaby/Desktop/小项目/keygen/cycript_0.9.594/Cycript.lib/cycript-apl
Reason: image not found
Abort trap: 6

看起来貌似是因为libruby.2.0.0.dylib文件没有找到,打开ruby目录发现果然没有2.0的文件,只有2.3的。处理方法也很简单,直接把2.3的复制一份,改为2.0即可