mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-12 00:00:44 -04:00
Merge pull request #863 from G10h4ck/qmlapp_pex_alpha
Multiple improvements to android qml app and libreaspilocal
This commit is contained in:
commit
861dab32a5
102 changed files with 3668 additions and 1483 deletions
|
@ -1271,7 +1271,9 @@ bool RsGenExchange::getMsgRelatedMeta(const uint32_t &token, GxsMsgRelatedMetaMa
|
|||
return ok;
|
||||
}
|
||||
|
||||
bool RsGenExchange::getSerializedGroupData(const uint32_t &token, RsGxsGroupId& id,unsigned char *& data,uint32_t& size)
|
||||
bool RsGenExchange::getSerializedGroupData(uint32_t token, RsGxsGroupId& id,
|
||||
unsigned char *& data,
|
||||
uint32_t& size)
|
||||
{
|
||||
RS_STACK_MUTEX(mGenMtx) ;
|
||||
|
||||
|
@ -1304,24 +1306,30 @@ bool RsGenExchange::getSerializedGroupData(const uint32_t &token, RsGxsGroupId&
|
|||
return RsNxsSerialiser(mServType).serialise(nxs_grp,data,&size) ;
|
||||
}
|
||||
|
||||
bool RsGenExchange::deserializeGroupData(unsigned char *data,uint32_t size)
|
||||
bool RsGenExchange::deserializeGroupData(unsigned char *data, uint32_t size,
|
||||
RsGxsGroupId* gId /*= nullptr*/)
|
||||
{
|
||||
RS_STACK_MUTEX(mGenMtx) ;
|
||||
|
||||
RsItem *item = RsNxsSerialiser(mServType).deserialise(data, &size);
|
||||
|
||||
RsNxsGrp *nxs_grp = dynamic_cast<RsNxsGrp*>(item) ;
|
||||
RsNxsGrp *nxs_grp = dynamic_cast<RsNxsGrp*>(item);
|
||||
|
||||
if(item == NULL)
|
||||
{
|
||||
std::cerr << "(EE) RsGenExchange::deserializeGroupData(): cannot deserialise this data. Something's wrong." << std::endl;
|
||||
delete item ;
|
||||
return false ;
|
||||
}
|
||||
if(item == NULL)
|
||||
{
|
||||
std::cerr << "(EE) RsGenExchange::deserializeGroupData(): cannot "
|
||||
<< "deserialise this data. Something's wrong." << std::endl;
|
||||
delete item;
|
||||
return false;
|
||||
}
|
||||
|
||||
mReceivedGrps.push_back( GxsPendingItem<RsNxsGrp*, RsGxsGroupId>(nxs_grp, nxs_grp->grpId,time(NULL)) );
|
||||
mReceivedGrps.push_back(
|
||||
GxsPendingItem<RsNxsGrp*, RsGxsGroupId>(
|
||||
nxs_grp, nxs_grp->grpId,time(NULL)) );
|
||||
|
||||
return true ;
|
||||
if(gId) *gId = nxs_grp->grpId;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RsGenExchange::getGroupData(const uint32_t &token, std::vector<RsGxsGrpItem *>& grpItem)
|
||||
|
|
|
@ -299,8 +299,10 @@ protected:
|
|||
* \return
|
||||
*/
|
||||
|
||||
bool getSerializedGroupData(const uint32_t &token, RsGxsGroupId &id, unsigned char *& data, uint32_t& size);
|
||||
bool deserializeGroupData(unsigned char *data, uint32_t size);
|
||||
bool getSerializedGroupData(uint32_t token, RsGxsGroupId &id,
|
||||
unsigned char *& data, uint32_t& size);
|
||||
bool deserializeGroupData(unsigned char *data, uint32_t size,
|
||||
RsGxsGroupId* gId = nullptr);
|
||||
|
||||
template<class GrpType>
|
||||
bool getGroupDataT(const uint32_t &token, std::vector<GrpType*>& grpItem)
|
||||
|
|
|
@ -922,15 +922,15 @@ android-g++ {
|
|||
## Add this here and not in retroshare.pri because static library are very
|
||||
## sensible to order in command line, has to be in the end of file for the
|
||||
## same reason
|
||||
LIBS += -L$$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/ -lssl
|
||||
INCLUDEPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
DEPENDPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
PRE_TARGETDEPS += $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libssl.a
|
||||
LIBS += -L$$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/ -lssl
|
||||
INCLUDEPATH += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
DEPENDPATH += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
PRE_TARGETDEPS += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/libssl.a
|
||||
|
||||
LIBS += -L$$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/ -lcrypto
|
||||
INCLUDEPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
DEPENDPATH += $$NDK_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
PRE_TARGETDEPS += $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libcrypto.a
|
||||
LIBS += -L$$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/ -lcrypto
|
||||
INCLUDEPATH += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
DEPENDPATH += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/include
|
||||
PRE_TARGETDEPS += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/libcrypto.a
|
||||
|
||||
HEADERS += util/androiddebug.h
|
||||
}
|
||||
|
|
|
@ -91,11 +91,11 @@ class GxsReputation
|
|||
};
|
||||
|
||||
|
||||
class RsGxsIdGroup
|
||||
struct RsGxsIdGroup
|
||||
{
|
||||
public:
|
||||
RsGxsIdGroup(): mLastUsageTS(0), mPgpKnown(false),mIsAContact(false) { return; }
|
||||
~RsGxsIdGroup() { return; }
|
||||
RsGxsIdGroup() :
|
||||
mLastUsageTS(0), mPgpKnown(false), mIsAContact(false) {}
|
||||
~RsGxsIdGroup() {}
|
||||
|
||||
|
||||
RsGroupMetaData mMeta;
|
||||
|
@ -305,8 +305,10 @@ public:
|
|||
virtual bool setAsRegularContact(const RsGxsId& id,bool is_a_contact) = 0 ;
|
||||
virtual bool isARegularContact(const RsGxsId& id) = 0 ;
|
||||
|
||||
virtual bool serialiseIdentityToMemory(const RsGxsId& id,std::string& radix_string)=0;
|
||||
virtual bool deserialiseIdentityFromMemory(const std::string& radix_string)=0;
|
||||
virtual bool serialiseIdentityToMemory( const RsGxsId& id,
|
||||
std::string& radix_string ) = 0;
|
||||
virtual bool deserialiseIdentityFromMemory( const std::string& radix_string,
|
||||
RsGxsId* id = nullptr ) = 0;
|
||||
|
||||
/*!
|
||||
* \brief overallReputationLevel
|
||||
|
|
|
@ -698,9 +698,10 @@ bool p3IdService::getOwnIds(std::list<RsGxsId> &ownIds)
|
|||
return true ;
|
||||
}
|
||||
|
||||
bool p3IdService::serialiseIdentityToMemory(const RsGxsId& id,std::string& radix_string)
|
||||
bool p3IdService::serialiseIdentityToMemory( const RsGxsId& id,
|
||||
std::string& radix_string )
|
||||
{
|
||||
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
||||
RS_STACK_MUTEX(mIdMtx);
|
||||
|
||||
// look into cache. If available, return the data. If not, request it.
|
||||
|
||||
|
@ -758,23 +759,27 @@ void p3IdService::handle_get_serialized_grp(uint32_t token)
|
|||
mSerialisedIdentities[RsGxsId(id)] = s ;
|
||||
}
|
||||
|
||||
bool p3IdService::deserialiseIdentityFromMemory(const std::string& radix_string)
|
||||
bool p3IdService::deserialiseIdentityFromMemory(const std::string& radix_string,
|
||||
RsGxsId* id /* = nullptr */)
|
||||
{
|
||||
std::vector<uint8_t> mem = Radix64::decode(radix_string) ;
|
||||
std::vector<uint8_t> mem = Radix64::decode(radix_string);
|
||||
|
||||
if(mem.empty())
|
||||
if(mem.empty())
|
||||
{
|
||||
std::cerr << "Cannot decode radix string \"" << radix_string << "\"" << std::endl;
|
||||
return false ;
|
||||
std::cerr << __PRETTY_FUNCTION__ << "Cannot decode radix string \""
|
||||
<< radix_string << "\"" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!RsGenExchange::deserializeGroupData(mem.data(),mem.size()))
|
||||
{
|
||||
std::cerr << "Cannot load identity from radix string \"" << radix_string << "\"" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
if( !RsGenExchange::deserializeGroupData(
|
||||
mem.data(), mem.size(), reinterpret_cast<RsGxsGroupId*>(id)) )
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << "Cannot load identity from radix "
|
||||
<< "string \"" << radix_string << "\"" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true ;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3IdService::createIdentity(uint32_t& token, RsIdentityParameters ¶ms)
|
||||
|
|
|
@ -350,8 +350,10 @@ public:
|
|||
const RsIdentityUsage &use_info );
|
||||
virtual bool requestPrivateKey(const RsGxsId &id);
|
||||
|
||||
virtual bool serialiseIdentityToMemory(const RsGxsId& id,std::string& radix_string);
|
||||
virtual bool deserialiseIdentityFromMemory(const std::string& radix_string);
|
||||
virtual bool serialiseIdentityToMemory(const RsGxsId& id,
|
||||
std::string& radix_string);
|
||||
virtual bool deserialiseIdentityFromMemory(const std::string& radix_string,
|
||||
RsGxsId* id = nullptr);
|
||||
|
||||
/**************** RsGixsReputation Implementation ****************/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue