Giter VIP home page Giter VIP logo

signal4j's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

signal4j's Issues

Program type already present - Multiple dex files define

Hi,

Thank you for your great work.

I'm unable to run the empty Android application after adding signal4j as dependency.

Build.gradle (Module:app) looks like this,

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "client.company.com.myapplication"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.github.turakar:signal4j:1.0.0'
}

In Build.gradle (Module Project) classpath is 3.1.4

[classpath 'com.android.tools.build:gradle:3.1.4']

I tried to downgrade to appcompat-v7:26.0.0 and in that case i'm facing following error. File changes in error but Multiple dex files define remains.

Multiple dex files define Lorg/bouncycastle/asn1/cms/AuthenticatedData;

NonSuccessfulResponseCodeException: Bad response: 400

I was tried to call in my main class

signalService.finishConnectAsPrimary(verCode);

but this error occurs:

Exception in thread "main" org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResponseCodeException: Bad response: 400
at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:894)
at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeServiceRequest(PushServiceSocket.java:791)
at org.whispersystems.signalservice.internal.push.PushServiceSocket.verifyAccountCode(PushServiceSocket.java:223)
at org.whispersystems.signalservice.api.SignalServiceAccountManager.verifyAccountWithCode(SignalServiceAccountManager.java:203)

any idea?

i'm using jdk 1.8

Reenable lint

Therefore a lot of javadoc has to be updated to make it compatible.

users cannot send to groups except when they are responding

signal4j does not offer (?) a way to send messages to groups, if the user knows only the groupid, because signal4j won't tell you the group's members.

In the sample plugins this works nicely as they only respond to group messages and thus get a handle to the group object, but a plugin that wants to send messages without receiving some does not.

I have added a new sendMessage overload to SignalService to have a dirty workaround:

public void sendMessage(String groupId, String content) throws IOException {
    byte[] id = Base64.decode(groupId);
    Group group = store.getDataStore().getGroup(new GroupId(id));
    SignalServiceDataMessage message = SignalServiceDataMessage.newBuilder()
        .withTimestamp(System.currentTimeMillis())
        .asGroupMessage(SignalServiceGroup.newBuilder(Type.DELIVER)
            .withId(group.getId().getId())
            .build())
        .withBody(content)
        .withExpiration(group.getMessageExpirationTime())
        .build();
   sendMessage(group.getMembers(), message);
}

What did you intend?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.