Newapp: Stendhal - repro issues

I’ve been trying to create reproducible build of our Android game client for F-Droid over the past week. But the build integrity check is failing.

This is my first Android application, our development team doesn’t have much experience with Android app development. I’m trying to understand how to solve the comparison error with the apk built by F-Droid.

ERROR: APK Signature Scheme v2 signer #1: APK integrity check failed. CHUNKED_SHA256 digest mismatch. Expected: <62be3ad6a887785653acd76b09222e50d2fd60d2883265b251e0769f4e0083f6>, actual: <323423cb98808ec2eff9f18c5372f3225a184d03ac391ec5c485ae17fb7ab24a>
2024-03-12 09:35:28,775 ERROR: 
/tmp/tmpiz1xxnai/sigcp_org.stendhalgame.client_1045005.apk: 
2024-03-12 09:35:28,775 INFO: ...NOT verified - /tmp/tmpiz1xxnai/sigcp_org.stendhalgame.client_1045005.apk
2024-03-12 09:35:28,994 DEBUG: > diff -r /tmp/tmpiz1xxnai/tmp_binaries_org.stendhalgame.client_1045005.binary /tmp/tmpiz1xxnai/_tmp_tmpiz1xxnai_sigcp_org.stendhalgame.client_1045005
2024-03-12 09:35:29,199 WARNING: Keeping failed build "tmp/org.stendhalgame.client_1045005.apk"
2024-03-12 09:35:29,199 DEBUG: removing tmp/binaries/org.stendhalgame.client_1045005.binary.apk
2024-03-12 09:35:29,228 ERROR: Could not build app org.stendhalgame.client: compared built binary to supplied reference binary but failed
==== detail begin ====
verification of APK with copied signature failed
Comparing reference APK to APK with copied signature...
Unexpected diff output:
Binary files /tmp/tmpiz1xxnai/tmp_binaries_org.stendhalgame.client_1045005.binary/content/classes.dex and /tmp/tmpiz1xxnai/_tmp_tmpiz1xxnai_sigcp_org.stendhalgame.client_1045005/content/classes.dex differ
==== detail end ====

The classes.dex file differs in the F-Droid build from our apk. I had tried changing Java compatibility to 11 in build.gradle but same problem persisted.

 	compileOptions {
-		sourceCompatibility JavaVersion.VERSION_1_8
-		targetCompatibility JavaVersion.VERSION_1_8
+		sourceCompatibility JavaVersion.VERSION_11
+		targetCompatibility JavaVersion.VERSION_11
 	}

Another developer analyzed the contents of the two packages & came up with the following:

"Basically all .class files are different.

Classfile /tmp2/z/tmp/j1/org/stendhalgame/client/WebClientInfo.class
  Last modified 11.03.2024; size 2114 bytes
  SHA-256 checksum 55a2160fa15d81d5efa188661a02a2e53d5a480e3cd74ca1331e371cdb5b8189
public class org.stendhalgame.client.WebClientInfo
  minor version: 0
  major version: 50
  flags: (0x0021) ACC_PUBLIC, ACC_SUPER
  this_class: #2                          // org/stendhalgame/client/WebClientInfo
  super_class: #4                         // java/lang/Object
  interfaces: 0, fields: 2, methods: 7, attributes: 1
Constant pool:
    #1 = Utf8               org/stendhalgame/client/WebClientInfo
    #2 = Class              #1            // org/stendhalgame/client/WebClientInfo
    #3 = Utf8               java/lang/Object
    #4 = Class              #3            // java/lang/Object
    #5 = Utf8               org/stendhalgame/client/WebClientInfo$1
    #6 = Class              #5            // org/stendhalgame/client/WebClientInfo$1
    #7 = Utf8               instance
    #8 = Utf8               Lorg/stendhalgame/client/WebClientInfo;
    #9 = Utf8               parsedInfo
   #10 = Utf8               Ljava/util/HashMap;
   #11 = Utf8               Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;
   #12 = Utf8               <init>
   #13 = Utf8               ()V
   #14 = NameAndType        #12:#13       // "<init>":()V
   #15 = Methodref          #4.#14        // java/lang/Object."<init>":()V
   #16 = Utf8               java/util/HashMap
   #17 = Class              #16           // java/util/HashMap
   #18 = Methodref          #17.#14       // java/util/HashMap."<init>":()V
   #19 = NameAndType        #9:#10        // parsedInfo:Ljava/util/HashMap;
   #20 = Fieldref           #2.#19        // org/stendhalgame/client/WebClientInfo.parsedInfo:Ljava/util/HashMap;
   #21 = Utf8               Code
   #22 = Utf8               get
   #23 = Utf8               ()Lorg/stendhalgame/client/WebClientInfo;
   #24 = NameAndType        #7:#8         // instance:Lorg/stendhalgame/client/WebClientInfo;
   #25 = Fieldref           #2.#24        // org/stendhalgame/client/WebClientInfo.instance:Lorg/stendhalgame/client/WebClientInfo;
   #26 = Methodref          #2.#14        // org/stendhalgame/client/WebClientInfo."<init>":()V
   #27 = Utf8               (Ljava/lang/String;)Ljava/lang/String;
   #28 = Utf8               containsKey
   #29 = Utf8               (Ljava/lang/Object;)Z
   #30 = NameAndType        #28:#29       // containsKey:(Ljava/lang/Object;)Z
   #31 = Methodref          #17.#30       // java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
   #32 = Utf8               (Ljava/lang/Object;)Ljava/lang/Object;
   #33 = NameAndType        #22:#32       // get:(Ljava/lang/Object;)Ljava/lang/Object;
   #34 = Methodref          #17.#33       // java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
   #35 = Utf8               java/lang/String
   #36 = Class              #35           // java/lang/String
   #37 = Utf8
   #38 = String             #37           //
   #39 = Utf8               getBuild
   #40 = Utf8               ()Ljava/lang/String;
   #41 = Utf8               org/stendhalgame/client/ClientView
   #42 = Class              #41           // org/stendhalgame/client/ClientView
   #43 = Utf8               isGameActive
   #44 = Utf8               ()Z
   #45 = NameAndType        #43:#44       // isGameActive:()Z
   #46 = Methodref          #42.#45       // org/stendhalgame/client/ClientView.isGameActive:()Z
   #47 = Utf8               not connected
   #48 = String             #47           // not connected
   #49 = Utf8               build
   #50 = String             #49           // build
   #51 = NameAndType        #22:#27       // get:(Ljava/lang/String;)Ljava/lang/String;
   #52 = Methodref          #2.#51        // org/stendhalgame/client/WebClientInfo.get:(Ljava/lang/String;)Ljava/lang/String;
   #53 = Utf8               equals
   #54 = NameAndType        #53:#29       // equals:(Ljava/lang/Object;)Z
   #55 = Methodref          #36.#54       // java/lang/String.equals:(Ljava/lang/Object;)Z
   #56 = Utf8               not available
   #57 = String             #56           // not available
   #58 = Utf8               getVersion
   #59 = Utf8               version
   #60 = String             #59           // version
   #61 = Utf8               onClientConnected
   #62 = Utf8               ()Lorg/stendhalgame/client/ClientView;
   #63 = NameAndType        #22:#62       // get:()Lorg/stendhalgame/client/ClientView;
   #64 = Methodref          #42.#63       // org/stendhalgame/client/ClientView.get:()Lorg/stendhalgame/client/ClientView;
   #65 = Utf8               java/util/Arrays
   #66 = Class              #65           // java/util/Arrays
   #67 = Utf8               asList
   #68 = Utf8               ([Ljava/lang/Object;)Ljava/util/List;
   #69 = NameAndType        #67:#68       // asList:([Ljava/lang/Object;)Ljava/util/List;
   #70 = Methodref          #66.#69       // java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
   #71 = Utf8               java/util/List
   #72 = Class              #71           // java/util/List
   #73 = Utf8               iterator
   #74 = Utf8               ()Ljava/util/Iterator;
   #75 = NameAndType        #73:#74       // iterator:()Ljava/util/Iterator;
   #76 = InterfaceMethodref #72.#75       // java/util/List.iterator:()Ljava/util/Iterator;
   #77 = Utf8               java/util/Iterator
   #78 = Class              #77           // java/util/Iterator
   #79 = Utf8               hasNext
   #80 = NameAndType        #79:#44       // hasNext:()Z
   #81 = InterfaceMethodref #78.#80       // java/util/Iterator.hasNext:()Z
   #82 = Utf8               next
   #83 = Utf8               ()Ljava/lang/Object;
   #84 = NameAndType        #82:#83       // next:()Ljava/lang/Object;
   #85 = InterfaceMethodref #78.#84       // java/util/Iterator.next:()Ljava/lang/Object;
   #86 = Utf8               java/lang/StringBuilder
   #87 = Class              #86           // java/lang/StringBuilder
   #88 = Utf8               (function(){return document.documentElement.getAttribute(\"data-build-
   #89 = String             #88           // (function(){return document.documentElement.getAttribute(\"data-build-
   #90 = Utf8               (Ljava/lang/String;)V
   #91 = NameAndType        #12:#90       // "<init>":(Ljava/lang/String;)V
   #92 = Methodref          #87.#91       // java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
   #93 = Utf8               append
   #94 = Utf8               (Ljava/lang/String;)Ljava/lang/StringBuilder;
   #95 = NameAndType        #93:#94       // append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   #96 = Methodref          #87.#95       // java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   #97 = Utf8               \")})();
   #98 = String             #97           // \")})();
   #99 = Utf8               toString
  #100 = NameAndType        #99:#40       // toString:()Ljava/lang/String;
  #101 = Methodref          #87.#100      // java/lang/StringBuilder.toString:()Ljava/lang/String;
  #102 = Utf8               (Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
  #103 = NameAndType        #12:#102      // "<init>":(Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
  #104 = Methodref          #6.#103       // org/stendhalgame/client/WebClientInfo$1."<init>":(Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
  #105 = Utf8               evaluateJavascript
  #106 = Utf8               (Ljava/lang/String;Landroid/webkit/ValueCallback;)V
  #107 = NameAndType        #105:#106     // evaluateJavascript:(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
  #108 = Methodref          #42.#107      // org/stendhalgame/client/ClientView.evaluateJavascript:(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
  #109 = Utf8               put
  #110 = Utf8               (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  #111 = Utf8               (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  #112 = NameAndType        #109:#111     // put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  #113 = Methodref          #17.#112      // java/util/HashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  #114 = Utf8               Signature
  #115 = Utf8               InnerClasses
{
  public static org.stendhalgame.client.WebClientInfo get();
    descriptor: ()Lorg/stendhalgame/client/WebClientInfo;
    flags: (0x0009) ACC_PUBLIC, ACC_STATIC
    Code:
      stack=2, locals=0, args_size=0
         0: getstatic     #25                 // Field instance:Lorg/stendhalgame/client/WebClientInfo;
         3: ifnonnull     16
         6: new           #2                  // class org/stendhalgame/client/WebClientInfo
         9: dup
        10: invokespecial #26                 // Method "<init>":()V
        13: putstatic     #25                 // Field instance:Lorg/stendhalgame/client/WebClientInfo;
        16: getstatic     #25                 // Field instance:Lorg/stendhalgame/client/WebClientInfo;
        19: areturn

  public java.lang.String get(java.lang.String);
    descriptor: (Ljava/lang/String;)Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=2, locals=2, args_size=2
         0: aload_0
         1: getfield      #20                 // Field parsedInfo:Ljava/util/HashMap;
         4: aload_1
         5: invokevirtual #31                 // Method java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
         8: ifeq          26
        11: aload_0
        12: getfield      #20                 // Field parsedInfo:Ljava/util/HashMap;
        15: aload_1
        16: invokevirtual #34                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
        19: checkcast     #36                 // class java/lang/String
        22: astore_1
        23: goto          29
        26: ldc           #38                 // String
        28: astore_1
        29: aload_1
        30: areturn

  public java.lang.String getBuild();
    descriptor: ()Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=2, locals=3, args_size=1
         0: invokestatic  #46                 // Method org/stendhalgame/client/ClientView.isGameActive:()Z
         3: ifne          9
         6: ldc           #48                 // String not connected
         8: areturn
         9: aload_0
        10: ldc           #50                 // String build
        12: invokevirtual #52                 // Method get:(Ljava/lang/String;)Ljava/lang/String;
        15: astore_2
        16: aload_2
        17: astore_1
        18: ldc           #38                 // String
        20: aload_2
        21: invokevirtual #55                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
        24: ifeq          30
        27: ldc           #57                 // String not available
        29: astore_1
        30: aload_1
        31: areturn

  public java.lang.String getVersion();
    descriptor: ()Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=2, locals=3, args_size=1
         0: invokestatic  #46                 // Method org/stendhalgame/client/ClientView.isGameActive:()Z
         3: ifne          9
         6: ldc           #48                 // String not connected
         8: areturn
         9: aload_0
        10: ldc           #60                 // String version
        12: invokevirtual #52                 // Method get:(Ljava/lang/String;)Ljava/lang/String;
        15: astore_2
        16: aload_2
        17: astore_1
        18: ldc           #38                 // String
        20: aload_2
        21: invokevirtual #55                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
        24: ifeq          30
        27: ldc           #57                 // String not available
        29: astore_1
        30: aload_1
        31: areturn

  public void onClientConnected();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=6, locals=4, args_size=1
         0: invokestatic  #64                 // Method org/stendhalgame/client/ClientView.get:()Lorg/stendhalgame/client/ClientView;
         3: pop
         4: iconst_2
         5: anewarray     #36                 // class java/lang/String
         8: dup
         9: iconst_0
        10: ldc           #50                 // String build
        12: aastore
        13: dup
        14: iconst_1
        15: ldc           #60                 // String version
        17: aastore
        18: invokestatic  #70                 // Method java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
        21: invokeinterface #76,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
        26: astore_1
        27: aload_1
        28: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
        33: ifeq          93
        36: aload_1
        37: invokeinterface #85,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
        42: checkcast     #36                 // class java/lang/String
        45: astore_2
        46: new           #87                 // class java/lang/StringBuilder
        49: dup
        50: ldc           #89                 // String (function(){return document.documentElement.getAttribute(\"data-build-
        52: invokespecial #92                 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
        55: astore_3
        56: aload_3
        57: aload_2
        58: invokevirtual #96                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
        61: pop
        62: aload_3
        63: ldc           #98                 // String \")})();
        65: invokevirtual #96                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
        68: pop
        69: aload_3
        70: invokevirtual #101                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
        73: astore_3
        74: invokestatic  #64                 // Method org/stendhalgame/client/ClientView.get:()Lorg/stendhalgame/client/ClientView;
        77: aload_3
        78: new           #6                  // class org/stendhalgame/client/WebClientInfo$1
        81: dup
        82: aload_0
        83: aload_2
        84: invokespecial #104                // Method org/stendhalgame/client/WebClientInfo$1."<init>":(Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
        87: invokevirtual #108                // Method org/stendhalgame/client/ClientView.evaluateJavascript:(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
        90: goto          27
        93: return

  public java.lang.String put(java.lang.String, java.lang.String);
    descriptor: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=3, locals=3, args_size=3
         0: aload_0
         1: getfield      #20                 // Field parsedInfo:Ljava/util/HashMap;
         4: aload_1
         5: aload_2
         6: invokevirtual #113                // Method java/util/HashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
         9: checkcast     #36                 // class java/lang/String
        12: areturn
}
InnerClasses:
  #6;                                     // class org/stendhalgame/client/WebClientInfo$1
Classfile /tmp2/z/tmp/j2/org/stendhalgame/client/WebClientInfo.class
  Last modified 11.03.2024; size 2114 bytes
  SHA-256 checksum 4ba758d6ec5b3df3301718d0f22559f9888df5a3b7d88c35dde0cb2bfd13a454
public class org.stendhalgame.client.WebClientInfo
  minor version: 0
  major version: 50
  flags: (0x0021) ACC_PUBLIC, ACC_SUPER
  this_class: #2                          // org/stendhalgame/client/WebClientInfo
  super_class: #4                         // java/lang/Object
  interfaces: 0, fields: 2, methods: 7, attributes: 1
Constant pool:
    #1 = Utf8               org/stendhalgame/client/WebClientInfo
    #2 = Class              #1            // org/stendhalgame/client/WebClientInfo
    #3 = Utf8               java/lang/Object
    #4 = Class              #3            // java/lang/Object
    #5 = Utf8               org/stendhalgame/client/WebClientInfo$1
    #6 = Class              #5            // org/stendhalgame/client/WebClientInfo$1
    #7 = Utf8               instance
    #8 = Utf8               Lorg/stendhalgame/client/WebClientInfo;
    #9 = Utf8               parsedInfo
   #10 = Utf8               Ljava/util/HashMap;
   #11 = Utf8               Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;
   #12 = Utf8               <init>
   #13 = Utf8               ()V
   #14 = NameAndType        #12:#13       // "<init>":()V
   #15 = Methodref          #4.#14        // java/lang/Object."<init>":()V
   #16 = Utf8               java/util/HashMap
   #17 = Class              #16           // java/util/HashMap
   #18 = Methodref          #17.#14       // java/util/HashMap."<init>":()V
   #19 = NameAndType        #9:#10        // parsedInfo:Ljava/util/HashMap;
   #20 = Fieldref           #2.#19        // org/stendhalgame/client/WebClientInfo.parsedInfo:Ljava/util/HashMap;
   #21 = Utf8               Code
   #22 = Utf8               get
   #23 = Utf8               ()Lorg/stendhalgame/client/WebClientInfo;
   #24 = NameAndType        #7:#8         // instance:Lorg/stendhalgame/client/WebClientInfo;
   #25 = Fieldref           #2.#24        // org/stendhalgame/client/WebClientInfo.instance:Lorg/stendhalgame/client/WebClientInfo;
   #26 = Methodref          #2.#14        // org/stendhalgame/client/WebClientInfo."<init>":()V
   #27 = Utf8               (Ljava/lang/String;)Ljava/lang/String;
   #28 = Utf8               containsKey
   #29 = Utf8               (Ljava/lang/Object;)Z
   #30 = NameAndType        #28:#29       // containsKey:(Ljava/lang/Object;)Z
   #31 = Methodref          #17.#30       // java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
   #32 = Utf8               (Ljava/lang/Object;)Ljava/lang/Object;
   #33 = NameAndType        #22:#32       // get:(Ljava/lang/Object;)Ljava/lang/Object;
   #34 = Methodref          #17.#33       // java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
   #35 = Utf8               java/lang/String
   #36 = Class              #35           // java/lang/String
   #37 = Utf8
   #38 = String             #37           //
   #39 = Utf8               getBuild
   #40 = Utf8               ()Ljava/lang/String;
   #41 = Utf8               org/stendhalgame/client/ClientView
   #42 = Class              #41           // org/stendhalgame/client/ClientView
   #43 = Utf8               isGameActive
   #44 = Utf8               ()Z
   #45 = NameAndType        #43:#44       // isGameActive:()Z
   #46 = Methodref          #42.#45       // org/stendhalgame/client/ClientView.isGameActive:()Z
   #47 = Utf8               not connected
   #48 = String             #47           // not connected
   #49 = Utf8               build
   #50 = String             #49           // build
   #51 = NameAndType        #22:#27       // get:(Ljava/lang/String;)Ljava/lang/String;
   #52 = Methodref          #2.#51        // org/stendhalgame/client/WebClientInfo.get:(Ljava/lang/String;)Ljava/lang/String;
   #53 = Utf8               equals
   #54 = NameAndType        #53:#29       // equals:(Ljava/lang/Object;)Z
   #55 = Methodref          #36.#54       // java/lang/String.equals:(Ljava/lang/Object;)Z
   #56 = Utf8               not available
   #57 = String             #56           // not available
   #58 = Utf8               getVersion
   #59 = Utf8               version
   #60 = String             #59           // version
   #61 = Utf8               onClientConnected
   #62 = Utf8               ()Lorg/stendhalgame/client/ClientView;
   #63 = NameAndType        #22:#62       // get:()Lorg/stendhalgame/client/ClientView;
   #64 = Methodref          #42.#63       // org/stendhalgame/client/ClientView.get:()Lorg/stendhalgame/client/ClientView;
   #65 = Utf8               java/util/Arrays
   #66 = Class              #65           // java/util/Arrays
   #67 = Utf8               asList
   #68 = Utf8               ([Ljava/lang/Object;)Ljava/util/List;
   #69 = NameAndType        #67:#68       // asList:([Ljava/lang/Object;)Ljava/util/List;
   #70 = Methodref          #66.#69       // java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
   #71 = Utf8               java/util/List
   #72 = Class              #71           // java/util/List
   #73 = Utf8               iterator
   #74 = Utf8               ()Ljava/util/Iterator;
   #75 = NameAndType        #73:#74       // iterator:()Ljava/util/Iterator;
   #76 = InterfaceMethodref #72.#75       // java/util/List.iterator:()Ljava/util/Iterator;
   #77 = Utf8               java/util/Iterator
   #78 = Class              #77           // java/util/Iterator
   #79 = Utf8               hasNext
   #80 = NameAndType        #79:#44       // hasNext:()Z
   #81 = InterfaceMethodref #78.#80       // java/util/Iterator.hasNext:()Z
   #82 = Utf8               next
   #83 = Utf8               ()Ljava/lang/Object;
   #84 = NameAndType        #82:#83       // next:()Ljava/lang/Object;
   #85 = InterfaceMethodref #78.#84       // java/util/Iterator.next:()Ljava/lang/Object;
   #86 = Utf8               java/lang/StringBuilder
   #87 = Class              #86           // java/lang/StringBuilder
   #88 = Utf8               (function(){return document.documentElement.getAttribute(\"data-build-
   #89 = String             #88           // (function(){return document.documentElement.getAttribute(\"data-build-
   #90 = Utf8               (Ljava/lang/String;)V
   #91 = NameAndType        #12:#90       // "<init>":(Ljava/lang/String;)V
   #92 = Methodref          #87.#91       // java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
   #93 = Utf8               append
   #94 = Utf8               (Ljava/lang/String;)Ljava/lang/StringBuilder;
   #95 = NameAndType        #93:#94       // append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   #96 = Methodref          #87.#95       // java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   #97 = Utf8               \")})();
   #98 = String             #97           // \")})();
   #99 = Utf8               toString
  #100 = NameAndType        #99:#40       // toString:()Ljava/lang/String;
  #101 = Methodref          #87.#100      // java/lang/StringBuilder.toString:()Ljava/lang/String;
  #102 = Utf8               (Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
  #103 = NameAndType        #12:#102      // "<init>":(Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
  #104 = Methodref          #6.#103       // org/stendhalgame/client/WebClientInfo$1."<init>":(Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
  #105 = Utf8               evaluateJavascript
  #106 = Utf8               (Ljava/lang/String;Landroid/webkit/ValueCallback;)V
  #107 = NameAndType        #105:#106     // evaluateJavascript:(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
  #108 = Methodref          #42.#107      // org/stendhalgame/client/ClientView.evaluateJavascript:(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
  #109 = Utf8               put
  #110 = Utf8               (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  #111 = Utf8               (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  #112 = NameAndType        #109:#111     // put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  #113 = Methodref          #17.#112      // java/util/HashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  #114 = Utf8               Signature
  #115 = Utf8               InnerClasses
{
  public static org.stendhalgame.client.WebClientInfo get();
    descriptor: ()Lorg/stendhalgame/client/WebClientInfo;
    flags: (0x0009) ACC_PUBLIC, ACC_STATIC
    Code:
      stack=2, locals=0, args_size=0
         0: getstatic     #25                 // Field instance:Lorg/stendhalgame/client/WebClientInfo;
         3: ifnonnull     16
         6: new           #2                  // class org/stendhalgame/client/WebClientInfo
         9: dup
        10: invokespecial #26                 // Method "<init>":()V
        13: putstatic     #25                 // Field instance:Lorg/stendhalgame/client/WebClientInfo;
        16: getstatic     #25                 // Field instance:Lorg/stendhalgame/client/WebClientInfo;
        19: areturn

  public java.lang.String get(java.lang.String);
    descriptor: (Ljava/lang/String;)Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=2, locals=2, args_size=2
         0: aload_0
         1: getfield      #20                 // Field parsedInfo:Ljava/util/HashMap;
         4: aload_1
         5: invokevirtual #31                 // Method java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
         8: ifeq          26
        11: aload_0
        12: getfield      #20                 // Field parsedInfo:Ljava/util/HashMap;
        15: aload_1
        16: invokevirtual #34                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
        19: checkcast     #36                 // class java/lang/String
        22: astore_1
        23: goto          29
        26: ldc           #38                 // String
        28: astore_1
        29: aload_1
        30: areturn

  public java.lang.String getBuild();
    descriptor: ()Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=2, locals=3, args_size=1
         0: invokestatic  #46                 // Method org/stendhalgame/client/ClientView.isGameActive:()Z
         3: ifne          9
         6: ldc           #48                 // String not connected
         8: areturn
         9: aload_0
        10: ldc           #50                 // String build
        12: invokevirtual #52                 // Method get:(Ljava/lang/String;)Ljava/lang/String;
        15: astore_2
        16: aload_2
        17: astore_1
        18: ldc           #38                 // String
        20: aload_2
        21: invokevirtual #55                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
        24: ifeq          30
        27: ldc           #57                 // String not available
        29: astore_1
        30: aload_1
        31: areturn

  public java.lang.String getVersion();
    descriptor: ()Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=2, locals=3, args_size=1
         0: invokestatic  #46                 // Method org/stendhalgame/client/ClientView.isGameActive:()Z
         3: ifne          9
         6: ldc           #48                 // String not connected
         8: areturn
         9: aload_0
        10: ldc           #60                 // String version
        12: invokevirtual #52                 // Method get:(Ljava/lang/String;)Ljava/lang/String;
        15: astore_2
        16: aload_2
        17: astore_1
        18: ldc           #38                 // String
        20: aload_2
        21: invokevirtual #55                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
        24: ifeq          30
        27: ldc           #57                 // String not available
        29: astore_1
        30: aload_1
        31: areturn

  public void onClientConnected();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=6, locals=4, args_size=1
         0: invokestatic  #64                 // Method org/stendhalgame/client/ClientView.get:()Lorg/stendhalgame/client/ClientView;
         3: pop
         4: iconst_2
         5: anewarray     #36                 // class java/lang/String
         8: dup
         9: iconst_0
        10: ldc           #50                 // String build
        12: aastore
        13: dup
        14: iconst_1
        15: ldc           #60                 // String version
        17: aastore
        18: invokestatic  #70                 // Method java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
        21: invokeinterface #76,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
        26: astore_2
        27: aload_2
        28: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
        33: ifeq          93
        36: aload_2
        37: invokeinterface #85,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
        42: checkcast     #36                 // class java/lang/String
        45: astore_1
        46: new           #87                 // class java/lang/StringBuilder
        49: dup
        50: ldc           #89                 // String (function(){return document.documentElement.getAttribute(\"data-build-
        52: invokespecial #92                 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
        55: astore_3
        56: aload_3
        57: aload_1
        58: invokevirtual #96                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
        61: pop
        62: aload_3
        63: ldc           #98                 // String \")})();
        65: invokevirtual #96                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
        68: pop
        69: aload_3
        70: invokevirtual #101                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
        73: astore_3
        74: invokestatic  #64                 // Method org/stendhalgame/client/ClientView.get:()Lorg/stendhalgame/client/ClientView;
        77: aload_3
        78: new           #6                  // class org/stendhalgame/client/WebClientInfo$1
        81: dup
        82: aload_0
        83: aload_1
        84: invokespecial #104                // Method org/stendhalgame/client/WebClientInfo$1."<init>":(Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
        87: invokevirtual #108                // Method org/stendhalgame/client/ClientView.evaluateJavascript:(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
        90: goto          27
        93: return

  public java.lang.String put(java.lang.String, java.lang.String);
    descriptor: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=3, locals=3, args_size=3
         0: aload_0
         1: getfield      #20                 // Field parsedInfo:Ljava/util/HashMap;
         4: aload_1
         5: aload_2
         6: invokevirtual #113                // Method java/util/HashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
         9: checkcast     #36                 // class java/lang/String
        12: areturn
}
InnerClasses:
  #6;                                     // class org/stendhalgame/client/WebClientInfo$1

continued in next post …

… continued from previous post

--- /tmp/1.txt	2024-03-11 10:17:03.092258331 +0100
+++ /tmp/2.txt	2024-03-11 10:17:07.677096047 +0100
@@ -1,6 +1,6 @@
-Classfile /tmp2/z/tmp/j1/org/stendhalgame/client/WebClientInfo.class
+Classfile /tmp2/z/tmp/j2/org/stendhalgame/client/WebClientInfo.class
   Last modified 11.03.2024; size 2114 bytes
-  SHA-256 checksum 55a2160fa15d81d5efa188661a02a2e53d5a480e3cd74ca1331e371cdb5b8189
+  SHA-256 checksum 4ba758d6ec5b3df3301718d0f22559f9888df5a3b7d88c35dde0cb2bfd13a454
 public class org.stendhalgame.client.WebClientInfo
   minor version: 0
   major version: 50
@@ -228,21 +228,21 @@
         17: aastore
         18: invokestatic  #70                 // Method java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
         21: invokeinterface #76,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
-        26: astore_1
-        27: aload_1
+        26: astore_2
+        27: aload_2
         28: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
         33: ifeq          93
-        36: aload_1
+        36: aload_2
         37: invokeinterface #85,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
         42: checkcast     #36                 // class java/lang/String
-        45: astore_2
+        45: astore_1
         46: new           #87                 // class java/lang/StringBuilder
         49: dup
         50: ldc           #89                 // String (function(){return document.documentElement.getAttribute(\"data-build-
         52: invokespecial #92                 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
         55: astore_3
         56: aload_3
-        57: aload_2
+        57: aload_1
         58: invokevirtual #96                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
         61: pop
         62: aload_3
@@ -257,7 +257,7 @@
         78: new           #6                  // class org/stendhalgame/client/WebClientInfo$1
         81: dup
         82: aload_0
-        83: aload_2
+        83: aload_1
         84: invokespecial #104                // Method org/stendhalgame/client/WebClientInfo$1."<init>":(Lorg/stendhalgame/client/WebClientInfo;Ljava/lang/String;)V
         87: invokevirtual #108                // Method org/stendhalgame/client/ClientView.evaluateJavascript:(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
         90: goto          27

Same java version. But the compiler uses different registers."

So it sounds like it a compatibility issue between the Java compilers?

Taking a look now

First remark, you built your APK with Java 17, I see this artefact: Reproducible Builds | F-Droid - Free and Open Source Android App Repository

after using Java 17 this is the diff log:
sted1045005_j17.log.zip (3.3 KB)

are you sure you build from GitHub - arianne/stendhal at 956ef6c5faa1bfff15829ee8d7ea302b2218ae54 ?

Thanks for the response. I see now the problem is the compiler version. The runner’s default Java version is 11, so I need to install 17:

    sudo:
      - apt-get install -y openjdk-17-jdk-headless
      - update-alternatives --auto java

Related: New app, pipeline failed with bad JAVA_VERSION

The build now succeeds, thank you.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.