Closed kimw closed 6 years ago
$ uname -a
Linux 69fd5a3a817e 4.13.12-041312-generic #201711080535 SMP Wed Nov 8 10:40:26 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ free -m
total used free shared buff/cache available
Mem: 7887 1876 3636 529 2375 5128
Swap: 1023 0 1023
$ df -h
Filesystem Size Used Avail Use% Mounted on
overlay 15G 4.7G 9.4G 34% /
tmpfs 64M 0 64M 0% /dev
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/Air--vg-var 15G 4.7G 9.4G 34% /etc/hosts
shm 64M 0 64M 0% /dev/shm
tmpfs 3.9G 0 3.9G 0% /sys/firmware
$ wget --version
GNU Wget 1.17.1 built on linux-gnu.
+digest -gpgme +https +ipv6 +iri +large-file -metalink +nls +ntlm
+opie -psl +ssl/openssl
Wgetrc:
/etc/wgetrc (system)
Locale:
/usr/share/locale
Compile:
gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
-DLOCALEDIR="/usr/share/locale" -I. -I../../src -I../lib
-I../../lib -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include
-DHAVE_LIBSSL -DNDEBUG -g -O2 -fPIE -fstack-protector-strong
-Wformat -Werror=format-security -DNO_SSLv2 -D_FILE_OFFSET_BITS=64
-g -Wall
Link:
gcc -DHAVE_LIBSSL -DNDEBUG -g -O2 -fPIE -fstack-protector-strong
-Wformat -Werror=format-security -DNO_SSLv2 -D_FILE_OFFSET_BITS=64
-g -Wall -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro
-Wl,-z,now -L/usr/lib -lpcre -luuid -lssl -lcrypto -lz -lidn
ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Originally written by Hrvoje Niksic <hniksic@xemacs.org>.
Please send bug reports and questions to <bug-wget@gnu.org>.
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ ccache --version
ccache version 3.2.4
Copyright (C) 2002-2007 Andrew Tridgell
Copyright (C) 2009-2015 Joel Rosdahl
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
$ java -Xmx32m -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
$ javac -J-Xmx32m -version
javac 1.8.0_151
Define invalid.
It's because you're building a debug APK, which would include additional debug files in that APK.
@Mygod
INVALID means - When I try to install shadowsocks-release-unsigned.apk
into my device, it reports The package appears to be corrupt. See attachment.
Device: Samsung S6 Edge Android: 7.0
PS, the installation of both shadowsocks-debug.apk
and shadowsocks-debug-unaligned.apk
are OK.
@madeye
I'm not sure it's caused by different building target. Because I found debug build & release build are in the same file structure. See pic attached.
All 3 apk files are built today morning.
@wongsyrone Thanks for your reply. The doc is very useful. It helps me to read the code easy more.
You cannot install shadowsocks-release-unsigned.apk
to any device. It's expected.
Please follow https://developer.android.com/studio/publish/app-signing.html to sign the APK with your key.
@madeye Thank you.
I was trying to build shadowsocks-android from docker image. The building process is successful, but apk file is invalid.
Build steps are,
Command in host
Commands in docker image
The compiling is successful and I got 2 files stored in
/workdir/shadowsocks-android/mobile/target/android/output
, which areshadowsocks-debug.apk
&shadowsocks-debug-unaligned.apk
. Any of these 2 files can not installed in Adnroid 7.0.0 (Samsung S6 Edge).I unzipped the apk files and find that the structure are different from official release file (https://github.com/shadowsocks/shadowsocks-android/releases/download/v4.2.5/shadowsocks-nightly-4.2.5.apk), shown as pictures attached.
What can I do to build a valid apk file?
ATTACHMENTS
The File Structure From Official apk File
Please note that the file
publicsuffixes.gz
is not exists in self-build apk file.File Structure From Self-build apk File, shadowsocks-debug.apk
Please note that the directorys
error_prone
,HACKED-META-INF
,okhttp3
&third_party
are not exists in official apk file.File Structure From Self-build apk File, shadowsocks-debug-unaligned.apk