Rover12421's Blog

The End.

I’m Back

这次重新回归得感谢老同学Yokide提供的空间服务.

因为版权问题,Blog空间被GitHub屏蔽之后,就懒得折腾.其实不怪GitHub,有打算移除不符合GitHub政策的文章,然后在GitHub上重来的.最后还是太懒,没折腾.再一个,还是有很多人回复询问关于Crack的问题,所以还是不好继续放GitHub.

这次回归不知道能撑多久.

恩.最后最后…没了.感谢您的观看…….

Build ShakaAapt

为了提高ShakaApktool的兼容性,需要订制一个aapt,我称它为ShakaAapt.这篇文章主要是记录ShakaAapt的编译过程,以及搭建ShakaAapt的修改环境.

为了编译aapt你需要下载一份Android源码.最好是最新的.你可以完整编译Android源码来得到aapt.但是这不是我的目的.我的目的是用最少的依赖来编译我的ShakaAapt,以减少编译时间,加快以后修改代码测试速度.

Linux/Windows版本的ShakaAapt都在ubunut下编译.Mac Os的版本我在虚拟机上安装的YOSEMITE上编译.

先来假设几个条件 :

  • $RootDir/ : 整个环境的根目录
  • $RootDir/android-last/ : 最新版本的android源码目录.repo下载的源码就是这个目录.
  • $RootDir/ShakaAapt/ : ShakaAapt相关源文件,配置文件,等等.
  • $RootDir/ShakaAaptBin/ : 用来存放编译好的ShakaAapt二进制文件,也就是用到ShakaApktool里面的文件

Ubuntu下编译Linux和windows版本

参考https://source.android.com/source/initializing.html安装必要的依赖.

准备ShakaAapt相关文件.在linux上使用软链接的方式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cd $RootDir/ShakaAapt/
ln -s ../android-last/build
mkdir development
mkdir external
mkdir frameworks
ln -s ../android-last/libcore
ln -s ../android-last/libnativehelper/
ln -s ../android-last/Makefile
ln -s ../android-last/prebuilts
mkdir sdk
mkdir system
cd development
../../android-last/development/build
cd ../external
ln -s ../../android-last/external/compiler-rt
ln -s ../../android-last/external/expat
ln -s ../../android-last/external/libcxx
ln -s ../../android-last/external/libcxxabi
ln -s ../../android-last/external/libpng
ln -s ../../android-last/external/zlib
cd ../frameworks
mkdir base
mkdir native
cd base
mkdir include
mkdir libs
mkdir tools
cd include
ln -s ../../../../android-last/frameworks/base/include/androidfw
cd ../libs
ln -s ../../../../android-last/frameworks/base/libs/androidfw
cd ../tools
ln -s ../../../../android-last/frameworks/base/tools/aapt
cd ../../native
ln -s ../../../android-last/frameworks/native/include
cd ../../sdk
ln -s ../../android-last/sdk/build
cd ../system
ln -s ../../android-last/system/core
cd ../..

看看完整的目录树:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$RootDir/ShakaAapt>  tree -L 4
.
├── build -> ../android-last/build
├── development
│   └── build -> ../../android-last/development/build
├── external
│   ├── compiler-rt -> ../../android-last/external/compiler-rt
│   ├── expat -> ../../android-last/external/expat
│   ├── libcxx -> ../../android-last/external/libcxx
│   ├── libcxxabi -> ../../android-last/external/libcxxabi
│   ├── libpng -> ../../android-last/external/libpng
│   └── zlib -> ../../android-last/external/zlib
├── frameworks
│   ├── base
│   │   ├── include
│   │   │   └── androidfw -> ../../../../android-last/frameworks/base/include/androidfw
│   │   ├── libs
│   │   │   └── androidfw -> ../../../../android-last/frameworks/base/libs/androidfw
│   │   └── tools
│   │       └── aapt -> ../../../../android-last/frameworks/base/tools/aapt
│   └── native
│       └── include -> ../../../android-last/frameworks/native/include
├── libcore -> ../android-last/libcore
├── libnativehelper -> ../android-last/libnativehelper/
├── Makefile -> ../android-last/Makefile
├── prebuilts -> ../android-last/prebuilts
├── sdk
│   └── build -> ../../android-last/sdk/build
└── system
    └── core -> ../../android-last/system/core

比起完整的Android代码,这个代码量是不是很少了啊.

下面是编译脚本的编写.看文件名就知道是干嘛的,就不做太多的解释了.

  • $RootDir/build_ShakaAapt_linux-x86.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/bash

cd ShakaAapt
export USE_CCACHE=1
export CCACHE_DIR=$(pwd)/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
. build/envsetup.sh
lunch sdk-eng
OUT_DIR=out-x86 make LOCAL_MULTILIB=32 aapt -j4
strip out-x86/host/linux-x86/bin/aapt
strip out-x86/host/linux-x86/lib/libc++.so
mkdir -p ../ShakaAaptBin/linux-x86/bin
mkdir -p ../ShakaAaptBin/linux-x86/lib
cp out-x86/host/linux-x86/bin/aapt ../ShakaAaptBin/linux-x86/bin/aapt
cp out-x86/host/linux-x86/lib/libc++.so ../ShakaAaptBin/linux-x86/lib/libc++.so
  • $RootDir/build_ShakaAapt_linux-x86_64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/bash

cd ShakaAapt
export USE_CCACHE=1
export CCACHE_DIR=$(pwd)/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
. build/envsetup.sh
lunch sdk-eng
OUT_DIR=out-x86_64 make LOCAL_MULTILIB=64 aapt -j4
strip out-x86_64/host/linux-x86/bin/aapt
strip out-x86_64/host/linux-x86/lib64/libc++.so
mkdir -p ../ShakaAaptBin/linux-x86_64/bin
mkdir -p ../ShakaAaptBin/linux-x86_64/lib64
cp out-x86_64/host/linux-x86/bin/aapt ../ShakaAaptBin/linux-x86_64/bin/aapt
cp out-x86_64/host/linux-x86/lib64/libc++.so ../ShakaAaptBin/linux-x86_64/lib64/libc++.so
  • $RootDir/build_ShakaAapt_windows-x86.sh
1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/bash

cd ShakaAapt
export USE_CCACHE=1
export CCACHE_DIR=$(pwd)/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
. build/envsetup.sh
lunch sdk-eng
USE_MINGW=1 OUT_DIR=out-x86 LOCAL_MULTILIB=32 make aapt
strip out-x86/host/windows-x86/bin/aapt.exe
mkdir -p ../ShakaAaptBin/windows-x86/bin
cp out-x86/host/windows-x86/bin/aapt.exe ../ShakaAaptBin/windows-x86/bin/aapt.exe

这里用ccache来加快编译速度.如果你不想要ccache,可以把相关位置去掉.也就是下面3行

1
2
3
export USE_CCACHE=1
export CCACHE_DIR=$(pwd)/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G

更多关于ccache请查看:https://source.android.com/source/building-running.html#using-ccache

脚本编写好了,需要编译那个平台的aapt就执行对应平台的脚本.

注意,编译windows平台,需要另外安装一些依赖包:

sudo apt-get install mingw32 tofrodos

windows版本,目前还不支持64bit的编译.不用纠结这个了,现在sdk中的全是x86的.

虚拟机中编译MacOs版本

首先是环境设定,Mac Os默然的文件系统是不区分大小写的,但是Android源码是要求区分大小写的.

可以参考https://source.android.com/source/initializing.html#setting-up-a-mac-os-x-build-environment来创建一块区分大小写的磁盘镜像,然后把源码拷贝到这个磁盘镜像中.

我用的是虚拟机,所以我选择了添加一块区分大小写敏感的硬盘.这里就不详细解说了.

同样的,我不需要全部的源码,下面是我写的一个编译ShakaAapt所需全部源码的同步脚本

注意,接下来的$RootDir全是MacOs上的根目录了.

  • $RootDir/rsync_ShakaApktool.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash

SRCROOT="/Volumes/VMware Shared Folders/Develop/android/source/android-last"
DESROOT="/Volumes/OSXShareDisk/Develop/android/source/ShakaAapt"

rsync -aP "$SRCROOT/Makefile" "$DESROOT/Makefile"
array=( \
  build libnativehelper prebuilts \
  development/build \
  frameworks/base/include \
  frameworks/base/tools/aapt \
  frameworks/base/libs/androidfw \
  frameworks/native/include \
  external/compiler-rt \
  external/expat \
  external/libcxx \
  external/libcxxabi \
  external/libpng \
  external/zlib \
  sdk/build \
  system/core \
  )

for var in ${array[@]};do
echo $var
mkdir -p "$DESROOT/$var/"
rsync -aP --delete \
   --exclude .git \
  "$SRCROOT/$var/" "$DESROOT/$var/"
done

$SRCROOT : 从目录名称上可以看出,这个目录是共享Ubuntu的目录,这个目录就是Ubuntu上存放Android源码的目录.

DESROOT : 是挂着的另外一块区分大小写的MacOs分区.

目录结果和Ubuntu上是相同的.从上面的脚本可以看出,我这里的$RootDir目录实际是/Volumes/OSXShareDisk/Develop/android/source

如果源码没更新,只修改了部分aapt的源码,再次同步也可以只同步aapt相关的源码就行了,加快同步速度.

  • $RootDir/rsync_ShakaApktool_only_aapt.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash

SRCROOT="/Volumes/VMware Shared Folders/Develop/android/source/android-last"
DESROOT="/Volumes/OSXShareDisk/Develop/android/source/ShakaAapt"

rsync -aP "$SRCROOT/Makefile" "$DESROOT/Makefile"
array=( \
  frameworks/base/tools/aapt \
  )

for var in ${array[@]};do
echo $var
mkdir -p "$DESROOT/$var/"
rsync -aP --delete \
   --exclude .git \
  "$SRCROOT/$var/" "$DESROOT/$var/"
done

源码同步过后,就是编译了,一样的,先写编译脚本,避免每次都执行一堆命令.

  • $RootDir/build_ShakaAapt_maxos-x86.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/bash

cd ShakaAapt
export USE_CCACHE=1
export CCACHE_DIR=$(pwd)/.ccache
prebuilts/misc/darwin-x86/ccache/ccache -M 50G
. build/envsetup.sh
lunch sdk-eng
OUT_DIR=out-x86 make LOCAL_MULTILIB=32 aapt -j4
mkdir -p "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86/bin"
mkdir -p lib "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86/lib"
cp out-x86/host/darwin-x86/bin/aapt "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86/bin/aapt"
cp out-x86/host/darwin-x86/lib/libc++.dylib "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86/lib/libc++.dylib"
    • $RootDir/build_ShakaAapt_maxos-x86_64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/bash

cd ShakaAapt
export USE_CCACHE=1
export CCACHE_DIR=$(pwd)/.ccache
prebuilts/misc/darwin-x86/ccache/ccache -M 50G
. build/envsetup.sh
lunch sdk-eng
OUT_DIR=out-x86_64 make LOCAL_MULTILIB=64 aapt -j4
mkdir -p "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86_64/bin"
mkdir -p "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86_64/lib64/"
cp out-x86_64/host/darwin-x86/bin/aapt "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86_64/bin/aapt"
cp out-x86_64/host/darwin-x86/lib64/libc++.dylib "/Volumes/VMware Shared Folders/Develop/android/source/ShakaAaptBin/darwin-x86_64/lib64/libc++.dylib"

执行相应的脚本就可以编译了.

使用Clion查看修改aapt源码的配置

我觉得用Clion来查看修改aapt的源码还是很爽的.

先创建一个项目,然后在项目目录下用软链接链接源码,windows平台没有软链接,建议在用Linux/Unix平台下使用.

1
2
3
4
5
6
7
8
cd $ClionProject
ln -s $RootDir/android-last/frameworks/base/tools/aapt
mkdir include
mkdir libs
cd include
ln -s $RootDir/android-last/frameworks/base/include/androidfw
cd ../libs
ln -s $RootDir/android-last/frameworks/base/libs/androidfw

看下目录树:

1
2
3
4
5
6
7
8
$ClionProject>  tree -L 2
.
├── aapt -> $RootDir/android-last/frameworks/base/tools/aapt
├── CMakeLists.txt
├── include
│   └── androidfw -> $RootDir/android-last/frameworks/base/include/androidfw
└── libs
    └── androidfw -> $RootDir/android-last/frameworks/base/libs/androidfw

修改CMakeLists.txt文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.2)
project(ShakaAapt)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(AAPTROOT aapt)
set(aaptMain ${AAPTROOT}/Main.cpp)
set(aaptSources
    ${AAPTROOT}/AaptAssets.cpp
    ${AAPTROOT}/AaptConfig.cpp
    ${AAPTROOT}/AaptUtil.cpp
    ${AAPTROOT}/AaptXml.cpp
    ${AAPTROOT}/ApkBuilder.cpp
    ${AAPTROOT}/Command.cpp
    ${AAPTROOT}/CrunchCache.cpp
    ${AAPTROOT}/FileFinder.cpp
    ${AAPTROOT}/Images.cpp
    ${AAPTROOT}/Package.cpp
    ${AAPTROOT}/pseudolocalize.cpp
    ${AAPTROOT}/Resource.cpp
    ${AAPTROOT}/ResourceFilter.cpp
    ${AAPTROOT}/ResourceIdCache.cpp
    ${AAPTROOT}/ResourceTable.cpp
    ${AAPTROOT}/SourcePos.cpp
    ${AAPTROOT}/StringPool.cpp
    ${AAPTROOT}/WorkQueue.cpp
    ${AAPTROOT}/XMLNode.cpp
    ${AAPTROOT}/ZipEntry.cpp
    ${AAPTROOT}/ZipFile.cpp
)

set(LIB_androidfw_ROOT libs/androidfw)
set(LIB_androidfw_commonSources
    ${LIB_androidfw_ROOT}/Asset.cpp
    ${LIB_androidfw_ROOT}/AssetDir.cpp
    ${LIB_androidfw_ROOT}/AssetManager.cpp
    ${LIB_androidfw_ROOT}/misc.cpp
    ${LIB_androidfw_ROOT}/ObbFile.cpp
    ${LIB_androidfw_ROOT}/ResourceTypes.cpp
    ${LIB_androidfw_ROOT}/StreamingZipInflater.cpp
    ${LIB_androidfw_ROOT}/TypeWrappers.cpp
    ${LIB_androidfw_ROOT}/ZipFileRO.cpp
    ${LIB_androidfw_ROOT}/ZipUtils.cpp)

set(SOURCE_FILES ${SOURCE_FILES}
    ${aaptMain}
    ${aaptSources}
    ${LIB_androidfw_commonSources}
)

include_directories(${AAPTROOT})
include_directories(include)

#set(SOURCE_FILES main.cpp)
add_executable(ShakaAapt ${SOURCE_FILES})

现在就可以很舒服的修改aapt源码了,虽然很多引用没有,但是aapt相关部分源码已经可以正常跳转,查找引用了.这就足够了,反正也不是在clion中编译.当然要是你有强迫症,请自行补全其他引用.

Jetbrains Product Patch or Keygen

Jetbrains之前的产品private key 是我从其他keygen里得到了,Clion的private key没法获取到,所以没法直接生成可用的license key.

看了下Clion的算法,和其他产品是一样的,那就简单了,修改一下public key就解决问题.所以,Clion是需要打补丁才能用keygen的.

源码已经放到github上了.
https://github.com/rover12421/JetbrainsPatchKeygen

只上Clion的图,其他的和原来的一样,就不多说了. "Using_Clion" "Clion_Reg"

Please support genuine.


Download Jar : http://pan.baidu.com/s/1gdw7T0v

1
2
3
4
5
6
7
8
9
10
11
12
13
Jetbrains's Product Patch or Keygen.
Crack by Rover12421.
Http://Www.Rover12421.Com
Please support genuine(https://www.jetbrains.com).

Please select product:
1. RubyMine
2. PyCharm
3. WebStorm
4. PhpStorm
5. AppCode
6. Clion
7. Idea

Clion的同学注意了,如果是运行Clion打的补丁,请重启再输入key

Clion安装路径在Linux/Unix/MOS下查找:启动Clion,使用命令ps -ef | grep "clion.jar"查看

Android 使用px适配各种分辨率

360电视管家的UI做的相当不错,在各种分辨率的手机,电视终端上显示效果都差不多.于是研究了下他的实现方式.
360电视管家使用的px作为布局单位,layout文件只适配1080p的布局,这样做的好处是,程序画出来的效果,可以最佳的接近设计给的效果图.
但是其他分辨率怎么办呢?360电视管家在每一个独立的view初始化之后,都根据当前设备分辨率做了一次reset计算.这样就达到了各种分辨率的适配.
这样的计算虽然导致部分分辨率有细微的差异,同时这点差异,导致UI需要左右留白,但是这并不影响整体视觉,反而会更美观.
这点差异与限制换来的结果还是非常值得的.
说UI做的不错,当然不会就只有这一点.360电视管家还做了很多自定义view,使得layout写的相当简洁.
当然也还有可以优化的地方.比如隐藏reset的计算,相识代码的重构…
更多的好或者不好,还是留给读者自己去分析吧…

说了这么多,进入主题吧…
代码在GitHub上:
https://github.com/rover12421/pxScale

效果图:
"pxScale"

JetBrains KegGen

公布Idea 14 的Keygen之后,看到有同学回复需要JetBrains其它产品的Keygen.
很多同学对比Idea 13,14的keygen代码,可能会猜测JetBrains的其他产品只需换掉其中的关键点就行了.其实不然.
除了Idea的key是没有经过RAS加密之外,其他产品的key都是经过RSA加密的.
这里再次公布下JetBrains的其他产品keygen算法.

已经测试支持:

  • PyCharm 3.4.1
  • PhpStorm 8.0.1
  • RubyMine 7.0
  • WebStorm 9.0.1

理论上至少还支持同系列上一个版本,和小版本.
AppCode 没有测试(谁来送我一个Mac吧…^)


有图有真相: "PyCharmKey" "PhpStormKey" "RubyMineKey" "WebStormKey"


看完真相,拿果子…

有实力的同学还是请支持正版!!!

Please support genuine.


RSAEncoder

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package com.rover12421.crack.jerbrains;

import java.math.BigInteger;

public class RSAEncoder
{
    private final BigInteger privKey;
    private final BigInteger pubKey;
    private final int c;
    private final int d;
    private int e = 0;
    private final BigInteger f;
    private final boolean g;

    public RSAEncoder(BigInteger privKey, BigInteger pubKey, int len, boolean newLine) {
        this.privKey = privKey;
        this.pubKey = pubKey;
        this.g = newLine;
        int privKeyLen = privKey.bitLength();
        this.f = new BigInteger(String.valueOf(len));
        int i = (int) Math.ceil(privKeyLen / Math.log(len) * Math.log(2.0D));
        if (i % 5 != 0) {
            i = (i / 5 + 1) * 5;
        }
        this.d = i;
        this.c = (privKeyLen / 8 - 1);
    }

    public String encode(byte[] bytes) {
        int i = bytes.length % this.c;
        byte[] arrayOfByte = new byte[i == 0 ? bytes.length : bytes.length + this.c - i];
        System.arraycopy(bytes, 0, arrayOfByte, this.c - i, bytes.length);

        StringBuffer stringBuffer = new StringBuffer();
        for (int j = 0; j < arrayOfByte.length; j += this.c) {
            encode(arrayOfByte, stringBuffer, j, this.c);
        }
        return stringBuffer.toString();
    }

    private void encode(byte[] bytes, StringBuffer stringBuffer, int off, int len) {
        if (len == 0) {
            return;
        }
        byte[] arrayOfByte = new byte[this.c];
        System.arraycopy(bytes, off, arrayOfByte, 0, len);
        BigInteger localBigInteger1 = new BigInteger(1, arrayOfByte);
        if (localBigInteger1.compareTo(this.pubKey) >= 0) {
            throw new IllegalArgumentException("result is too long");
        }
        BigInteger localBigInteger2 = localBigInteger1.modPow(this.privKey, this.pubKey);
        stringBuffer.append(a(a(localBigInteger2)));
    }

    private String a(String paramString) {
        StringBuffer localStringBuffer = new StringBuffer();
        for (int i = 0; i < paramString.length(); i++) {
            a(localStringBuffer);
            localStringBuffer.append(paramString.charAt(i));
        }
        return localStringBuffer.toString();
    }

    private String a(BigInteger paramBigInteger) {
        StringBuffer localStringBuffer = new StringBuffer();
        for (int i = 0; i < this.d; i++) {
            localStringBuffer.insert(0, b(paramBigInteger.mod(this.f)));
            paramBigInteger = paramBigInteger.divide(this.f);
        }
        return localStringBuffer.toString();
    }

    private void a(StringBuffer paramStringBuffer) {
        if ((this.e > 0) && (this.e % 5 == 0)) {
            if (this.e % 30 == 0)
                paramStringBuffer.append('\n');
            else if (this.g) {
                paramStringBuffer.append('-');
            }
        }
        this.e += 1;
    }

    private static char b(BigInteger paramBigInteger) {
        int i = paramBigInteger.intValue();
        char c1;
        if (i < 10) {
            c1 = (char)(48 + i);
        }
        else
        {
            if (i < 36) {
                c1 = (char)(65 + i - 10);
            }
            else
            {
                if (i < 62)
                    c1 = (char)(97 + i - 36);
                else {
                    c1 = (char)(33 + i - 62);
                }
            }
        }
        return c1;
    }
}

GenericKeyMaker.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package com.rover12421.crack.jerbrains;

import java.math.BigInteger;
import java.util.Random;
import java.util.zip.CRC32;

/**
 * Created by rover12421 on 11/18/14.
 */
public class GenericKeyMaker {

    public static final int LICENSETYPE_COMMERCIAL = 0;
    public static final int LICENSETYPE_NON_COMMERCIAL = 1;
    public static final int LICENSETYPE_SITE = 2;
    public static final int LICENSETYPE_OPENSOURCE = 3;
    public static final int LICENSETYPE_PERSONAL = 4;
    public static final int LICENSETYPE_YEARACADEMIC = 5;

    public static final int PRODUCTID_RubyMine = 4;
    public static final int PRODUCTID_PyCharm = 5;
    public static final int PRODUCTID_WebStorm = 6;
    public static final int PRODUCTID_PhpStorm = 7;
    public static final int PRODUCTID_AppCode = 8;

    private Random random = new Random();

    private String getLicenseId() {
        return String.format("D%sT", Integer.toString(random.nextInt(90000) + 10000));
    }

    private short getCRC(String s, int i, byte bytes[])
    {
        CRC32 crc32 = new CRC32();
        if (s != null)
        {
            for (int j = 0; j < s.length(); j++)
            {
                char c = s.charAt(j);
                crc32.update(c);
            }
        }
        crc32.update(i);
        crc32.update(i >> 8);
        crc32.update(i >> 16);
        crc32.update(i >> 24);
        for (int k = 0; k < bytes.length - 2; k++)
        {
            byte byte0 = bytes[k];
            crc32.update(byte0);
        }
        return (short) (int) crc32.getValue();
    }

    private byte[] generateKeyBytes(int licenseType, int productId,
                                    int minorVersion, int majorVersion,
                                    String userName, int customerId) {
        byte[] keyBytes = new byte[14];
        keyBytes[0] = (byte)((licenseType << 4) + (productId & 0xFF));
        keyBytes[1] = (byte)((minorVersion << 4) + (majorVersion & 0xFF));
        long time = System.currentTimeMillis() >> 16;
        keyBytes[2] = (byte)(int)(time & 0xFF);
        keyBytes[3] = (byte)(int)(time >> 8 & 0xFF);
        keyBytes[4] = (byte)(int)(time >> 16 & 0xFF);
        keyBytes[5] = (byte)(int)(time >> 24 & 0xFF);
        long timeDiff = 99*365;

        timeDiff &= 65535L;
        keyBytes[6] = (byte)(int)(timeDiff & 0xFF);
        keyBytes[7] = (byte)(int)(timeDiff >> 8 & 0xFF);
        keyBytes[8] = 0;
        keyBytes[9] = 1;
        keyBytes[10] = 2;
        keyBytes[11] = 3;
        keyBytes[12] = 4;
        keyBytes[13] = 5;

        int crc32 = getCRC(userName, customerId, keyBytes);
        keyBytes[12] = (byte)(crc32 & 0xFF);
        keyBytes[13] = (byte)(crc32 >> 8 & 0xFF);

        return keyBytes;
    }

    public String generateKey(BigInteger privKey, BigInteger pubKey,
                                     int licenseType, int productId,
                                     int minorVersion, int majorVersion,
                                     String userName) {

        int customerId = random.nextInt(9000) + 1000;
        byte[] keyBytes = generateKeyBytes(licenseType, productId, minorVersion, majorVersion, userName, customerId);

        RSAEncoder encoder = new RSAEncoder(privKey, pubKey, 64, false);
        String serial = encoder.encode(keyBytes);

        serial = "===== LICENSE BEGIN =====\n" + customerId + "-" + getLicenseId() + "\n" + serial + "\n===== LICENSE END =====";
        return serial;
    }

    public String genericPyCharmKey(int minorVersion, int majorVersion, String userName) {
        BigInteger pubKey = new BigInteger("D57B0596A03949D9A3BB0CD1F7931E405AE27D0E0AF4E562072B487B0DAB7F0874AA982E5383E75FF13D36CA9D8531AC1FA2ED7B11C8858E821C2D5FB48002DD", 16);
        BigInteger privKey = new BigInteger("406047D02363033D295DB7C0FD8A94DDCD4A6D71B5A622220C8D65DF0DC1409E0BDE26AF66B0AD717406C22FC8BEC3ED88C1B7091BA3443B6BFBA26120DE6A15", 16);

        return generateKey(privKey, pubKey, LICENSETYPE_NON_COMMERCIAL, PRODUCTID_PyCharm, minorVersion, majorVersion, userName);
    }

    public String genericAppCodeKey(int minorVersion, int majorVersion, String userName) {
        BigInteger pubKey = new BigInteger("F0DD6995C4BD3223641C79C8608D74F32ED54A8BDAE468EB5AC53F1F1C8925E263F82317356BC73B1C82B520630250212416C99CB39A8B7C2611E35552E166B9", 16);
        BigInteger privKey = new BigInteger("81B5EAEF61A4B584839C26253781D63243CD4F38E3A74FAD3713B3FB7025978538F10E743456F24BB20D5792BFDCB76DB6162C3D5C77DB7B29906CBFC9114EA5", 16);

        return generateKey(privKey, pubKey, LICENSETYPE_NON_COMMERCIAL, PRODUCTID_AppCode, minorVersion, majorVersion, userName);
    }

    public String genericPhpStormKey(int minorVersion, int majorVersion, String userName) {
        BigInteger pubKey = new BigInteger("BB62FBB57F105CD61B47AE2290FCB3CE1179942DE171BEDDF6BAA1A521B9368B735C7C931902EBA8DE6D160711A6ECC40F4A5E766E9FCDEE8A38715DB572AD3D", 16);
        BigInteger privKey = new BigInteger("7BFADCB153F59E86E69BC1820B4DB72573786E6B00CB824E57AD59BFE915231972746F47C6FBE0D8D88809DA313C1E4BEAD305AD8AFD31AE116ABCB181FF4F21", 16);

        return generateKey(privKey, pubKey, LICENSETYPE_NON_COMMERCIAL, PRODUCTID_PhpStorm, minorVersion, majorVersion, userName);
    }

    public String genericRubyMineKey(int minorVersion, int majorVersion, String userName) {
        BigInteger pubKey = new BigInteger("BB62FBB57F105CD61B47AE2290FCB3CE1179942DE171BEDDF6BAA1A521B9368B735C7C931902EBA8DE6D160711A6ECC40F4A5E766E9FCDEE8A38715DB572AD3D", 16);
        BigInteger privKey = new BigInteger("7BFADCB153F59E86E69BC1820B4DB72573786E6B00CB824E57AD59BFE915231972746F47C6FBE0D8D88809DA313C1E4BEAD305AD8AFD31AE116ABCB181FF4F21", 16);

        return generateKey(privKey, pubKey, LICENSETYPE_NON_COMMERCIAL, PRODUCTID_RubyMine, minorVersion, majorVersion, userName);
    }

    public String genericWebStormKey(int minorVersion, int majorVersion, String userName) {
        BigInteger pubKey = new BigInteger("BB62FBB57F105CD61B47AE2290FCB3CE1179942DE171BEDDF6BAA1A521B9368B735C7C931902EBA8DE6D160711A6ECC40F4A5E766E9FCDEE8A38715DB572AD3D", 16);
        BigInteger privKey = new BigInteger("7BFADCB153F59E86E69BC1820B4DB72573786E6B00CB824E57AD59BFE915231972746F47C6FBE0D8D88809DA313C1E4BEAD305AD8AFD31AE116ABCB181FF4F21", 16);

        return generateKey(privKey, pubKey, LICENSETYPE_NON_COMMERCIAL, PRODUCTID_WebStorm, minorVersion, majorVersion, userName);
    }

    public static void main(String[] args) {
        GenericKeyMaker keyMaker = new GenericKeyMaker();
//        System.out.println(keyMaker.genericPyCharmKey(1, 13, "Rover12421"));
//        System.out.println(keyMaker.genericPhpStormKey(1, 13, "Rover12421"));
//        System.out.println(keyMaker.genericRubyMineKey(1, 13, "Rover12421"));
        System.out.println(keyMaker.genericWebStormKey(1, 13, "Rover12421"));
    }
}

Update : http://www.rover12421.com/2015/04/07/jetbrains-product-patch-or-keygen.html

JetBrains IntelliJ IDEA 14 Keygen (Java Source Code)

JetBrains IntelliJ IDEA 14 Keygen :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import java.math.BigInteger;
import java.util.Date;
import java.util.Random;
import java.util.zip.CRC32;

public class keygen
{
  /**
  * @param s
  * @param i
  * @param bytes
  * @return
  */
  public static short getCRC(String s, int i, byte bytes[])
  {
      CRC32 crc32 = new CRC32();
      if (s != null)
      {
          for (int j = 0; j < s.length(); j++)
          {
              char c = s.charAt(j);
              crc32.update(c);
          }
      }
      crc32.update(i);
      crc32.update(i >> 8);
      crc32.update(i >> 16);
      crc32.update(i >> 24);
      for (int k = 0; k < bytes.length - 2; k++)
      {
          byte byte0 = bytes[k];
          crc32.update(byte0);
      }
      return (short) (int) crc32.getValue();
  }

  /**
  * @param biginteger
  * @return String
  */
  public static String encodeGroups(BigInteger biginteger)
  {
      BigInteger beginner1 = BigInteger.valueOf(0x39aa400L);
      StringBuilder sb = new StringBuilder();
      for (int i = 0; biginteger.compareTo(BigInteger.ZERO) != 0; i++)
      {
          int j = biginteger.mod(beginner1).intValue();
          String s1 = encodeGroup(j);
          if (i > 0)
          {
              sb.append("-");
          }
          sb.append(s1);
          biginteger = biginteger.divide(beginner1);
      }
      return sb.toString();
  }

  /**
  * @param i
  * @return
  */
  public static String encodeGroup(int i)
  {
      StringBuilder sb = new StringBuilder();
      for (int j = 0; j < 5; j++)
      {
          int k = i % 36;
          char c;
          if (k < 10)
          {
              c = (char) (48 + k);
          }
          else
          {
              c = (char) ((65 + k) - 10);
          }
          sb.append(c);
          i /= 36;
      }
      return sb.toString();
  }

  /**
  * @param name
  * @param days
  * @param id
  * @param prtype
  * @return
  */
  public static String MakeKey(String name, int days, int id)
  {
      id %= 100000;
      byte bkey[] = new byte[12];
      bkey[0] = (byte) 1; // Product type: IntelliJ IDEA is 1
      bkey[1] = 14; // version
      Date d = new Date();
      long ld = (d.getTime() >> 16);
      bkey[2] = (byte) (ld & 255);
      bkey[3] = (byte) ((ld >> 8) & 255);
      bkey[4] = (byte) ((ld >> 16) & 255);
      bkey[5] = (byte) ((ld >> 24) & 255);
      days &= 0xffff;
      bkey[6] = (byte) (days & 255);
      bkey[7] = (byte) ((days >> 8) & 255);
      bkey[8] = 105;
      bkey[9] = -59;
      bkey[10] = 0;
      bkey[11] = 0;
      int w = getCRC(name, id % 100000, bkey);
      bkey[10] = (byte) (w & 255);
      bkey[11] = (byte) ((w >> 8) & 255);
      BigInteger pow = new BigInteger("89126272330128007543578052027888001981", 10);
      BigInteger mod = new BigInteger("86f71688cdd2612ca117d1f54bdae029", 16);
      BigInteger k0 = new BigInteger(bkey);
      BigInteger k1 = k0.modPow(pow, mod);
      String s0 = Integer.toString(id);
      String sz = "0";
      while (s0.length() != 5)
      {
          s0 = sz.concat(s0);
      }
      s0 = s0.concat("-");
      String s1 = encodeGroups(k1);
      s0 = s0.concat(s1);
      return s0;
  }

  public static void main(String[] args)
  {
      if (args.length == 0)
      {
          System.err.printf("*** Usage: %s name%n", keygen.class.getCanonicalName());
          System.exit(1);
      }
      Random r = new Random();
      System.out.println(MakeKey(args[0], 0, r.nextInt(100000)));
  }
}

Using :

1
2
javac keygen.java
java keygen username

"Idea 14 Keygen"

Please support genuine.

Ubuntu 安装 Sublime Text2 并添加 Fcitx 输入法支持

1. 安装sublime-text-2

1
2
3
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

2. fcitx支持

sublime-text-2在Ubuntu下对中文支持不太好,如果是iBus输入法有个插件可以支持,但是太麻烦.于是直接把系统输入法框架改成fcitx的了.

  • 安装最新的fcitx框架
1
2
3
sudo apt-add-repository ppa:fcitx-team/nightly
sudo apt-get update
sudo apt-get install fcitx fcitx-frontend-all

把下面这个补丁文件保存为sublime-imfix.c,然后使用 gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC 命令编译生成libsublime-imfix.so文件

拷贝libsublime-imfix.so文件到sublime-text-2lib目录下:

1
cp libsublime-imfix.so /opt/sublime_text_2/lib/

修改sublime-text-2的启动脚本subl

1
sudo vi /usr/bin/subl

修改结果如下(添加了export LD_PRELOAD这行):

1
2
3
4
5
#!/bin/bash

export LD_PRELOAD=/opt/sublime_text_2/lib/libsublime-imfix.so

/opt/sublime_text_2/sublime_text --class=sublime-text-2 "$@"

sublime-imfix.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
sublime-imfix.c
Use LD_PRELOAD to interpose some function to fix sublime input method support for linux.
By Cjacker Huang <jianzhong.huang at i-soft.com.cn>

gcc -shared -o libsublime-imfix.so sublime_imfix.c  `pkg-config --libs --cflags gtk+-2.0` -fPIC
LD_PRELOAD=./libsublime-imfix.so sublime_text
*/
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
typedef GdkSegment GdkRegionBox;

struct _GdkRegion
{
  long size;
  long numRects;
  GdkRegionBox *rects;
  GdkRegionBox extents;
};

GtkIMContext *local_context;

void
gdk_region_get_clipbox (const GdkRegion *region,
            GdkRectangle    *rectangle)
{
  g_return_if_fail (region != NULL);
  g_return_if_fail (rectangle != NULL);

  rectangle->x = region->extents.x1;
  rectangle->y = region->extents.y1;
  rectangle->width = region->extents.x2 - region->extents.x1;
  rectangle->height = region->extents.y2 - region->extents.y1;
  GdkRectangle rect;
  rect.x = rectangle->x;
  rect.y = rectangle->y;
  rect.width = 0;
  rect.height = rectangle->height;
  //The caret width is 2;
  //Maybe sometimes we will make a mistake, but for most of the time, it should be the caret.
  if(rectangle->width == 2 && GTK_IS_IM_CONTEXT(local_context)) {
        gtk_im_context_set_cursor_location(local_context, rectangle);
  }
}

//this is needed, for example, if you input something in file dialog and return back the edit area
//context will lost, so here we set it again.

static GdkFilterReturn event_filter (GdkXEvent *xevent, GdkEvent *event, gpointer im_context)
{
    XEvent *xev = (XEvent *)xevent;
    if(xev->type == KeyRelease && GTK_IS_IM_CONTEXT(im_context)) {
       GdkWindow * win = g_object_get_data(G_OBJECT(im_context),"window");
       if(GDK_IS_WINDOW(win))
         gtk_im_context_set_client_window(im_context, win);
    }
    return GDK_FILTER_CONTINUE;
}

void gtk_im_context_set_client_window (GtkIMContext *context,
          GdkWindow    *window)
{
  GtkIMContextClass *klass;
  g_return_if_fail (GTK_IS_IM_CONTEXT (context));
  klass = GTK_IM_CONTEXT_GET_CLASS (context);
  if (klass->set_client_window)
    klass->set_client_window (context, window);

  if(!GDK_IS_WINDOW (window))
    return;
  g_object_set_data(G_OBJECT(context),"window",window);
  int width = gdk_window_get_width(window);
  int height = gdk_window_get_height(window);
  if(width != 0 && height !=0) {
    gtk_im_context_focus_in(context);
    local_context = context;
  }
  gdk_window_add_filter (window, event_filter, context);
}

Ubuntu 14.04 编译ffmpeg支持h265/hevc编码

1.安装编译x265所需环境

1
sudo apt-get install mercurial cmake cmake-curses-gui build-essential yasm

2.下载x265源码并编译

1
2
3
4
5
6
7
hg clone https://bitbucket.org/multicoreware/x265
cd x265
hg co 1.2
cd build/linux
./make-Makefiles.bash
make
sudo make install

这里只能使用1.2的版本,1.3和最新的都会在编译ffmpeg时出问题

如果运行x265出现如下错误,在/lib下添加对应的软链接即可.

1
2
$ x265
x265: error while loading shared libraries: libx265.so.25: cannot open shared object file: No such file or directory
1
2
3
cd /lib
sudo ln -s /usr/local/lib/libx265.so.25
cd -

后面如果遇到同样问题,解决方法相同,so从那里得知呢? 仔细看make install的打印信息就知道了.

3. 安装ffmpeg编译所需库

—enable-libvidstab 依赖

1
2
3
4
5
git clone https://github.com/georgmartius/vid.stab.git
cd vid.stab
cmake .
make
sudo make install

—enable-libilbc 依赖

1
2
3
4
5
6
7
git clone https://github.com/dekkers/libilbc.git
cd libilbc
mkdir build
cd build
cmake ../
make
sudo make install

其他的从系统库中安装即可

1
2
3
4
5
6
7
sudo apt-get install libmarisa-dev libfaac-dev libass-dev libmp3lame-dev \
libopus-dev libtheora-dev libvorbis-dev libvpx-dev libx264-dev libsdl1.2-dev \
libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenjpeg-dev \
libspeex-dev libvo-aacenc-dev libvo-amrwbenc-dev libwebp-dev frei0r-plugins-dev \
libgsm1-dev libopencv-dev libschroedinger-dev libcdio-paranoia-dev \
libgnutls-dev libfdk-aac-dev librtmp-dev libtwolame-dev \
libwavpack-dev libzvbi-dev

4.下载编译ffmpeg源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
./configure --arch=amd64 --disable-stripping --enable-avresample \
--enable-pthreads --enable-runtime-cpudetect --prefix=/usr --enable-bzlib \
--enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls \
--enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv \
--enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger \
--enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau \
--enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc \
--enable-libcdio --enable-x11grab --enable-libx264  --enable-libxvid \
--enable-libx265 --enable-libass --enable-libfdk-aac --enable-nonfree \
--enable-libvidstab --enable-libwebp --enable-fontconfig \
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc \
--enable-libvo-amrwbenc --enable-gray --enable-version3 --enable-libtwolame \
--enable-libwavpack --enable-libilbc --enable-libzvbi --enable-avisynth
make
sudo make install

6.查看hevc编码器是否存在

1
ffmpeg -codecs | grep -i hevc

看到如下信息表示hevc/x265编码已经安装成功

1
 DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (encoders: libx265 )

在编码器最前面有一串字符串,含义如下

1
2
3
4
5
6
7
8
9
Codecs:
D..... = Decoding supported
.E.... = Encoding supported
..V... = Video codec
..A... = Audio codec
..S... = Subtitle codec
...I.. = Intra frame-only codec
....L. = Lossy compression
.....S = Lossless compression

7.参考:

Inject Replace eglSwapBuffers Problems

在项目中有个功能是获取FPS,用到了root注入来获取FPS,这个方法是通过计算eglSwapBuffers调用次数来统计的,那目的就简单了,直接注入替换eglSwapBuffers,再在新的函数统计并调用原始的eglSwapBuffers即可.

看起来挺简单的事情,放到实际情况中却又是另外一回事了.

第一个问题是在刷了ColorOS的小米机器上遇到的.问题简单描述就是:通过shell手动执行二进制文件注入成功,通过java代码执行命令,注入失败.

原因是通过java代码执行,在注入的时候找到的mmap偏移地址不对.导致计算远程mmap地址不正确,而无法继续.通过各种测试,最后问题得到解决.

以前的代码是直接使用函数地址:

1
mmap_addr = get_remote_addr(target_pid, libc_path, (uint32_t)mmap);

修改后的代码则从so中查找函数地址:

1
2
3
4
5
void* handle = dlopen(libc_path, RTLD_LAZY);
void* local_mmap = dlsym(handle, "mmap");
dlclose(handle);

mmap_addr = get_remote_addr(target_pid, libc_path, (uint32_t)local_mmap);

第二个问题,则发生在三星系列手机上,注入正常,eglSwapBuffers地址确实替换成功了.但就是不调用替换的函数.没办法,只好硬着头皮看FPS Master的反汇编了.先看图. Alt text 图片上的反汇编,我加来注释.其中的函数名我也改了.可以看到他有去查找/system/lib/hw/system/vendor/lib/hw目录下以hwcomposer开头的文件.(其中的findStartStringFile函数名是我修改的,内容就不贴图了)

知道他会查找hwcomposer开头的文件,那是不算这个文件里也有eglSwapBuffers的实现呢?拿出来对比就知道了. Alt text 第一个eglSwapBuffers.msm8974.so是Z5S上copy出来的,并没有eglSwapBuffers,第二个eglSwapBuffers.omap4.so是三星的一款手机上拿出来的,可以看到确实是有eglSwapBuffers字符串,大致能猜测到,这个so里又实现eglSwapBuffers.那就一起替换吧.

效果和想的一样,这下三星也没问题了.

注入不稳定,各种问题.还有通过eglSwapBuffers得到的fps貌似不理想,不管卡不卡,得到的帧率可能都很底或很高.感觉和性能完全不靠边似的.如果谁还有更好的办法,请提示哦:)

openssl-1.0.1i for Android

想研究下NDK上使用RSA加密,最方便的应该是openssl了吧.

在github上下了一个openssl 1.0.1c的版本,编译通过.但个人比较追求最新,而且1.01.0f都有Heartbleed漏洞.虽然我只是使用其中的加密算法,这个并不受影响,强迫症,没办法,哈哈. 开始下的1.0.1g,编译完完来才发现不算最新的,于是又编译来最新的1.0.1i(强迫症)

不过简单的对比了1.0.1i1.0.1g,还是做来很多容错处理的.下面记录两个注意的地方.


编译ARM还需要生成汇编文件

1
2
3
4
5
perl crypto/aes/asm/aes-armv4.pl        > crypto/aes/asm/aes-armv4.S
perl crypto/bn/asm/armv4-mont.pl        > crypto/bn/asm/armv4-mont.S
perl crypto/sha/asm/sha1-armv4-large.pl > crypto/sha/asm/sha1-armv4-large.S
perl crypto/sha/asm/sha256-armv4.pl     > crypto/sha/asm/sha256-armv4.S
perl crypto/sha/asm/sha512-armv4.pl     > crypto/sha/asm/sha512-armv4.S

其中一个错误是:

1
2
3
 functions:openssl.c(.data.rel+0x200): error: undefined reference to 'ts_main'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/openssl] Error 1

需要修改apps/progs.h

1
2
3
#if 0 /* ANDROID */
  {FUNC_TYPE_GENERAL,"ts",ts_main},
#endif

实际就算删除这行


代码均下自openssl官方站:

1
http://www.openssl.org/source/openssl-1.0.1i.tar.gz

可以正常编译的代码已经同步到GitHub上了

openssl 1.0.1g : https://github.com/rover12421/openssl-1.0.1g4android

openssl 1.0.1i : https://github.com/rover12421/openssl-1.0.1i4android