Added patching of Android sources by a patchfile, now used to comment call to System.loadLibrary("conscrypt_jni")

This commit is contained in:
Vasily Litvinov 2014-04-03 04:11:06 +04:00
parent b52cbc21b2
commit 61b1c93805
2 changed files with 20 additions and 4 deletions

12
android-patches.diff Normal file
View File

@ -0,0 +1,12 @@
diff -ru android-src.old/org/conscrypt/NativeCrypto.java android-src/org/conscrypt/NativeCrypto.java
--- android-src.old/org/conscrypt/NativeCrypto.java 2014-03-30 23:53:27 +0400
+++ android-src/org/conscrypt/NativeCrypto.java 2014-03-30 23:53:39 +0400
@@ -51,7 +51,7 @@
* name.
*/
if (!"com.android.org.conscrypt".equals(NativeCrypto.class.getPackage().getName())) {
- System.loadLibrary("conscrypt_jni");
+ //System.loadLibrary("conscrypt_jni");
}
clinit();

View File

@ -1579,16 +1579,20 @@ $(build)/android.dep: $(luni-javas) $(libdvm-javas) $(crypto-javas) \
@echo "compiling luni classes"
@mkdir -p $(classpath-build)
@mkdir -p $(build)/android
@rm -rf $(build)/android-src
@mkdir -p $(build)/android-src/external/fdlibm
@mkdir -p $(build)/android-src/libexpat
cp $(android)/external/fdlibm/fdlibm.h $(build)/android-src/external/fdlibm/
cp $(android)/external/expat/lib/expat*.h $(build)/android-src/libexpat/
cp -a $(luni-java)/* $(libdvm-java)/* $(crypto-java)/* $(dalvik-java)/* \
$(xml-java)/* $(build)/android-src/
sed -i -e 's/return ordinal - o.ordinal;/return ordinal - o.ordinal();/' \
$(build)/android-src/java/lang/Enum.java
# sed makes this file read-only which in turn breaks re-builds; so marking it as writable
chmod +w $(build)/android-src/java/lang/Enum.java
# convert line endings... otherwise patches are difficult
# do that by first "dry-running" the patch to determine which files are patched
patch -d $(build)/android-src -p1 --dry-run -f < android-patches.diff | \
grep -E '^patching file ' | sed -e 's/^patching file \(.*\)/\1/g' | \
( cd $(build)/android-src && xargs dos2unix )
# now patch the files
( cd $(build)/android-src && patch -p1 ) < android-patches.diff
find $(build)/android-src -name '*.java' > $(build)/android.txt
$(javac) -Xmaxerrs 1000 -d $(build)/android -sourcepath $(luni-java) \
@$(build)/android.txt