openstf / STFService.apk

Monitor and perform various actions on your Android device. Not meant for actual user devices.
Other
242 stars 207 forks source link

[help] protobuf version is which one? I can't send any message. #52

Closed lfjking closed 4 years ago

lfjking commented 4 years ago

I can connected server and argent. server recv the message well. but, I can't send any message to server or argent. I look at the Issues that somebody say use the protobuf 2.6.0 can work. but I readly can't send message. the info tell me.:The data sent is of the wrong length or truncated (com.google.protobuf.InvalidProtocolBufferException). Who can tell me which version to use? I use VS2013 for my PC. thanks.

            Envelope    _lope;
            GetDisplayRequest display;
            display.set_id(11);
            _lope.set_id(10);
            _lope.set_type(MessageType::GET_DISPLAY);
            _lope.set_message(display.SerializeAsString());
            std::string data = _lope.SerializeAsString();
            const char* buff = data.data();
            forward.ForwardWrite((unsigned char*)buff, strlen(buff));
com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.
at com.google.protobuf.CodedInputStream.refillBuffer(CodedInputStream.java:1062)
at com.google.protobuf.CodedInputStream.readRawByte(CodedInputStream.java:1129)
at com.google.protobuf.CodedInputStream.readRawVarint64SlowPath(CodedInputStream.java:780)
at com.google.protobuf.CodedInputStream.readRawVarint64(CodedInputStream.java:772)
at com.google.protobuf.CodedInputStream.readInt64(CodedInputStream.java:333)
at com.google.protobuf.UnknownFieldSetLite.mergeFieldFrom(UnknownFieldSetLite.java:305)
at com.google.protobuf.UnknownFieldSetLite.mergeFrom(UnknownFieldSetLite.java:372)
at buffer: com.google.protobuf.UnknownFieldSetLite.mergeFieldFrom(UnknownFieldSetLite.java:318)
at com.google.protobuf.GeneratedMessageLite.parseUnknownField(GeneratedMessageLite.java:190)
at jp.co.cyberagent.stf.proto.Wire$Envelope.dynamicMethod(Wire.java:948)
at com.google.protobuf.GeneratedMessageLite.parsePartialFrom(GeneratedMessageLite.java:1355)
at com.google.protobuf.GeneratedMessageLite.parsePartialDelimitedFrom(GeneratedMessageLite.java:1525) at com.google.protobuf.GeneratedMessageLite.parseDelimitedFrom(GeneratedMessageLite.java:1496)
at jp.co.cyberagent.stf.proto.Wire$Envelope.parseDelimitedFrom(Wire.java:749)
at jp.co.cyberagent.stf.Agent$InputClient.run(Agent.java:216)
InputClient closing
koral-- commented 4 years ago

Look at the build.gradle file: https://github.com/openstf/STFService.apk/blob/master/app/build.gradle#L54 https://github.com/openstf/STFService.apk/blob/master/app/build.gradle#L62 https://github.com/openstf/STFService.apk/blob/master/app/build.gradle#L66