scheme

Android P v3签名新特性

谁都会走 提交于 2020-01-29 07:20:38
新版v3签名在v2的基础上,仍然采用检查整个压缩包的校验方式。不同的是在签名部分增可以添加新的证书,即可以不用修改ApplicationID来完成证书的更新迭代。 本文引用自 https://xuanxuanblingbling.github.io/ctf/android/2018/12/30/signature/ 概述 签名机制主要有两种用途: 使用特殊的key签名可以获取到一些不同的权限 验证数据保证不被篡改,防止应用被恶意的第三方覆盖 这里我们主要讨论第二个用途,即验证数据是否是可信的。应用程序的作者使用自己的私钥签名APK文件,并将签名与公钥一起发布到APK中,这个过程称之为签名。当应用程序被安装时,用发布的公钥去解析签名,并与文件的hash进行比对,这个过程叫验签。 显然这里我们尝试修改被签名数据的任何一部分都会导致验签失败,但是我们并不能防止重新签名。于是就存在一个问题:如何相信一个应用是正版应用?AOSP原生中并没有这种校验机制,如果是第一次安装,则默认相信自签名的应用。 但是当我们更新应用时,android根据应用的ApplicationID(一般与包名相同)来判断是否是同一个应用,并且要验证原来的应用与更新应用的证书是否匹配。但是在v1v2的签名版本中一个应用只允许用一个证书来校验,这时如果软件开发者想要更新证书并且完成软件的更新,是没有办法的

urlparse (scheme、netloc、path等)

梦想与她 提交于 2020-01-26 02:19:55
python2 from urllib2 import urlparse python3 from urlib.parse import urlparse >>> url = "http://localhost/test.py?a=hello&b=world " >>> from urlib2 import urlparse Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named urlib2 >>> from urllib2 import urlparse >>> result = urlparse.urlparse(url) >>> result ParseResult(scheme='http', netloc='localhost', path='/test.py', params='', query='a=hello&b=world ', fragment='') result.scheme : 网络协议 result.netloc: 服务器位置(也有可能是用户信息) result.path: 网页文件在服务器中的位置 result.params: 可选参数 result.query: &连接键值对 result.fragment

xctool工具

笑着哭i 提交于 2020-01-25 19:07:22
xctool 【1】xctool的特性: 原文:http://www.infoq.com/cn/news/2013/05/Facebook-buck-xctool-build xctool 是Facebook最近开源的另一种构建工具,它用于构建iOS应用程序。xctool替换了 xcodebuild ,具有以下特性: 能够作为Xcode.app运行相同的测试 构建输出和测试结果都是JSON格式的,使得我们不需要解析输出 xctool只有在发现错误的时候才打印消息,而xcodebuild对每个源文件都会打印。 我们想要知道为什么Facebook基于xcodebuild构建了另一种工具,所以采访了xctool的提交者 Fred Potter ,询问他为什么这个工具更好一些: xctool的最大好处在于,它可以从命令行构建和运行单元测试,这和Xcode.app从图形化界面上达到一样的效果。如果你为iOS设置了持续集成系统,那么这就非常重要了。你想要能够自动化运行测试,那些测试与你的开发人员在本地计算机上运行的完全相同,而xcodebuild不会用和Xcode.app相同的方式来构建和运行测试。在Xcode 4中,苹果把单元测试集成到了Xcode中——与“构建”和“运行”一起,有一个新的“测试”动作;使用Xcode scheme,你可以选择启用或者禁用哪些单元测试;如果你依赖于iOS模拟器

如何在Xcode 4中设置NSZombieEnabled?

。_饼干妹妹 提交于 2020-01-25 12:09:33
如何在Xcode 4中为我的可执行文件设置 NSZombie Enabled 和 CFZombieLevel ? #1楼 在Xcode 4.2中 项目名称/编辑方案/诊断/ 启用Zombie Objects复选框 你完成了 #2楼 在Xcode> 4.3中: 单击scheme下拉栏 - > edit scheme - > arguments选项卡,然后在Environment Variables列中添加NSZombieEnabled,在value列中添加YES。 祝好运 !!! #3楼 Cocoa提供了一个很酷的功能,可以极大地增强您调试此类情况的能力。 这是一个名为NSZombieEnabled的环境变量,观看此 视频 解释在 objective-C 中设置NSZombieEnabled #4楼 在Xcode 7中 ⌘ < 或从 Product > Scheme 菜单中选择 Edit Scheme 从“ Diagnostics 选项卡中选择“ Enable Zombie Objects ” 或者,如果你更喜欢 .xcconfig 文件,你可以阅读这篇文章 https://therealbnut.wordpress.com/2012/01/01/setting-xcode-4-0-environment-variables-from-a-script/ #5楼 在Xcode 4

Recursion on a list in Scheme - avoid premature termination

无人久伴 提交于 2020-01-25 11:57:27
问题 I was doing a problem from the HTDP book where you have to create a function that finds all the permutations for the list. The book gives the main function, and the question asks for you to create the helper function that would insert an element everywhere in the list. The helper function, called insert_everywhere , is only given 2 parameters. No matter how hard I try, I can't seem to create this function using only two parameters. This is my code: (define (insert_everywhere elt lst) (cond [

(self self) call inside the let statement, in strict language

十年热恋 提交于 2020-01-25 00:48:11
问题 I am currently, going through this article on Y-combinator by Mike Vanier. Along the way of Y-combinator derivation, this code: (define (part-factorial self) (lambda (n) (if (= n 0) 1 (* n ((self self) (- n 1)))))) ((part-factorial part-factorial) 5) ==> 120 (define factorial (part-factorial part-factorial)) (factorial 5) ==> 120 is worked out to: (define (part-factorial self) (let ((f (self self))) (lambda (n) (if (= n 0) 1 (* n (f (- n 1))))))) (define factorial (part-factorial part

Sorting a list in scheme

十年热恋 提交于 2020-01-24 16:17:07
问题 How do write a sorting algorithm that returns a list into increasing order. ex: '(1 3 5 2 9) returns '(1 2 3 5 9) 回答1: Most Scheme implementations come with a procedure to sort lists. If your implementation does not provide one, it is not difficult to roll one on your on. Here is an implementation of the quick-sort algorithm: > (define (qsort e) (if (or (null? e) (<= (length e) 1)) e (let loop ((left null) (right null) (pivot (car e)) (rest (cdr e))) (if (null? rest) (append (append (qsort

How to compile multiple Chicken Scheme files?

廉价感情. 提交于 2020-01-24 11:07:29
问题 I need to compile a Chicken Scheme project containing multiple source files, but I'm getting errors. According to the manual and this SO answer, I need to put (declare) s in my sources. Why the compiler can't just see that I'm importing the other source is beyond me, but meh. The problem is, even if I put the (declare) s in, the compiler complains about the (import) s and (use) s. infinity.filesystem.scm: (use bindings filepath posix) (declare (uses infinity.general.scm)) (load-relative

How to avoid loading cycle in Racket?

左心房为你撑大大i 提交于 2020-01-24 04:22:07
问题 I have quite simple set of .rkt sources and, say, "a.rkt" and "b.rkt" among them. I'd like to be able to write (require "a.rkt") in "b.rkt" and vice versa. Now I'm facing error about "loading cycle". Can I solve this issue with bare modules without adding units? Does Racket have anything similar to forward declaration so I could simple add missing signature instead of requiring? If both answers are "No", does someone know good and understandable tutorial on how to implement units with typed

How To Change Image Sizes in Racket

坚强是说给别人听的谎言 提交于 2020-01-23 11:18:51
问题 I am making a game using racket and need a background bitmap image. But the image I have selected is too big. How do I change the size? What I have: (bitmap/url "http://www.example.com/") 回答1: Import this package: (require htdp/image) And use the shrink procedures defined in that package. EDIT : As has been pointed out in the comments, 2htdp/image would be a better alternative: (require 2htdp/image) Take a look at the scale procedure. 来源: https://stackoverflow.com/questions/10318208/how-to