Added patched MapDB (v1.0.6), some changes in DataSerializerEx to prevent app crash

This commit is contained in:
ChronosX88 2019-04-06 07:16:04 +04:00
parent ad357c779e
commit 8a0e370936
5 changed files with 5 additions and 6 deletions

View File

@ -42,6 +42,7 @@ dependencies {
annotationProcessor "androidx.room:room-compiler:2.1.0-alpha04" annotationProcessor "androidx.room:room-compiler:2.1.0-alpha04"
implementation('net.tomp2p:tomp2p-all:5.0-Beta8') { implementation('net.tomp2p:tomp2p-all:5.0-Beta8') {
exclude group: 'net.tomp2p', module: 'tomp2p-storage' exclude group: 'net.tomp2p', module: 'tomp2p-storage'
exclude group: 'org.mapdb', module: 'mapdb'
} }
implementation 'org.slf4j:slf4j-log4j12:1.7.26' implementation 'org.slf4j:slf4j-log4j12:1.7.26'
implementation group: 'com.h2database', name: 'h2-mvstore', version: '1.4.197' implementation group: 'com.h2database', name: 'h2-mvstore', version: '1.4.197'
@ -50,5 +51,5 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.google.code.gson:gson:2.8.5'
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: '3.1.0.RELEASE' implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: '3.1.0.RELEASE'
implementation 'de.hdodenhof:circleimageview:3.0.0' implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'org.mapdb:mapdb:2.0-beta13' implementation group: 'org.objenesis', name: 'objenesis', version: '2.6'
} }

Binary file not shown.

Binary file not shown.

View File

@ -7,7 +7,6 @@ import net.tomp2p.peers.Number160;
import net.tomp2p.storage.AlternativeCompositeByteBuf; import net.tomp2p.storage.AlternativeCompositeByteBuf;
import net.tomp2p.storage.Data; import net.tomp2p.storage.Data;
import org.mapdb.DataIO;
import org.mapdb.Serializer; import org.mapdb.Serializer;
import java.io.DataInput; import java.io.DataInput;
@ -27,7 +26,7 @@ import java.security.SignatureException;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
public class DataSerializerEx extends Serializer<Data> implements Serializable { public class DataSerializerEx implements Serializer<Data>, Serializable {
private static final long serialVersionUID = 1428836065493792295L; private static final long serialVersionUID = 1428836065493792295L;
//TODO: test the performance impact //TODO: test the performance impact
@ -140,7 +139,8 @@ public class DataSerializerEx extends Serializer<Data> implements Serializable {
} else if(header == 0) { } else if(header == 0) {
return deserializeMapDB(in); return deserializeMapDB(in);
} else { } else {
throw new IOException("unexpected header: " + header); //throw new IOException("unexpected header: " + header);
return null;
} }
} }
@ -164,8 +164,6 @@ public class DataSerializerEx extends Serializer<Data> implements Serializable {
//throw new IOException("signature could not be read"); //throw new IOException("signature could not be read");
Log.e("DataSerializerEx", "# Signature could not be read!"); Log.e("DataSerializerEx", "# Signature could not be read!");
} }
DataIO.DataInputByteArray di = (DataIO.DataInputByteArray) in;
di.setPos(di.internalByteArray().length);
return data; return data;
} }

0
gradlew vendored Normal file → Executable file
View File