Skip to content

Commit ebb0c7f

Browse files
committed
Support library names with the "-1.0" suffix
1 parent 0cff405 commit ebb0c7f

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/main/java/airsquared/blobsaver/app/natives/Libimobiledevice.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ public class Libimobiledevice {
5858
public static native void idevice_free(Pointer idevice);
5959

6060
static {
61-
NativeUtils.register(Libimobiledevice.class, "imobiledevice");
61+
try {
62+
NativeUtils.register(Libimobiledevice.class, "imobiledevice");
63+
} catch (UnsatisfiedLinkError e) {
64+
try {
65+
NativeUtils.register(Libimobiledevice.class, "imobiledevice-1.0");
66+
} catch (UnsatisfiedLinkError e2) {
67+
e.addSuppressed(e2);
68+
throw e;
69+
}
70+
}
6271
}
6372
}

src/main/java/airsquared/blobsaver/app/natives/Libirecovery.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ public static class irecv_device_info extends Structure {
6767

6868

6969
static {
70-
NativeUtils.register(Libirecovery.class, "irecovery");
70+
try {
71+
NativeUtils.register(Libimobiledevice.class, "irecovery");
72+
} catch (UnsatisfiedLinkError e) {
73+
try {
74+
NativeUtils.register(Libimobiledevice.class, "irecovery-1.0");
75+
} catch (UnsatisfiedLinkError e2) {
76+
e.addSuppressed(e2);
77+
throw e;
78+
}
79+
}
7180
}
7281
}

0 commit comments

Comments
 (0)