On 04/24/2014 08:03 PM, Nathan of Guardian wrote:
> 
> 
> On April 24, 2014 7:22:50 PM EDT, Hans-Christoph Steiner 
> <[email protected]> wrote:
>>
>>
>> On 04/24/2014 04:45 PM, Michael Rogers wrote:
>>> On 23/04/14 20:45, Hans-Christoph Steiner wrote:
>>>> That looks like the final detail!  I'm even getting the exact same
>>>> META-INF/MANIFEST.MF, only the two signature files are different.
>>>> They also have the exact same number of bytes.  Still different
>>>> hashes though.  The sort order of the files is the same, just the
>>>> timestamps of the files in the zip are different.
>>>
>>> Brilliant!
>>>
>>>> 'ant debug' does not like frozen time.  It should be possible to
>>>> change the timestamps of the files before being zipped up into the
>>>> jar using 'touch'. The files seem to all be staged in bin/
>>>> beforehand.
>>>
>>> Sounds good, that would avoid the need for something like SortJar to
>>> sort and timestamp the jar entries.
>>>
>>> We should probably test this on a couple of different filesystems to
>>> ensure the entries are being added in an order that doesn't depend on
>>> how the filesystem implements directories.
>>
>> Arg, that failed.  It seems that the <apkbuilder> ant target aka
>> ApkBuilder.java does the final APK assembly, and it resets the
>> timestamps when
>> assembling the APK.  It is using
>> `entry.setTime(inputFile.lastModified());`.
>> It seems to first build a jar, then read the contents of the .jar into
>> a .zip.
>> When creating the .zip, it does not explicitly set the time, so that
>> might be
>> the source of the problem.  But maybe I'm reading it wrong.
>>
>> *
>> https://android.googlesource.com/platform/sdk/+/e162064a7b5db1eecec34271bc7e2a4296181ea6/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java
>> *
>> https://android.googlesource.com/platform/sdk/+/e162064a7b5db1eecec34271bc7e2a4296181ea6/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SignedJarBuilder.java
>>
> 
> Should we be using gradle for this and the new build system instead?

I have never touched gradle, but it sounds definitely worth trying.  Anyone
want to try it?  My guess is that that gradle also uses the same
ApkBuilder.java as ant.  But if we nail down a fix, it'll probably be a small
change to that code, and maybe there is a chance of getting it accepted into
the official SDK.  Since its in the SDK, a new SDK release will affect all
Android versions.

.hc

-- 
PGP fingerprint: 5E61 C878 0F86 295C E17D  8677 9F0F E587 374B BE81
_______________________________________________
Guardian-dev mailing list

Post: [email protected]
List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev

To Unsubscribe
        Send email to:  [email protected]
        Or visit: 
https://lists.mayfirst.org/mailman/options/guardian-dev/archive%40mail-archive.com

You are subscribed as: [email protected]

Reply via email to