Giter Site home page Giter Site logo

Empty MMS files posted about envayasms HOT 2 OPEN

youngj avatar youngj commented on July 30, 2024
Empty MMS files posted

from envayasms.

Comments (2)

no-knowledge avatar no-knowledge commented on July 30, 2024

Same experience with Sony Xperia Z3 Compact and Z5 compact, Android 7.1

from envayasms.

fictus avatar fictus commented on July 30, 2024

I was having the same issue. after a few days of messing with the code I noticed this method was returning empty bytes[]

`
public byte[] getData() throws IOException
{
int length = (int)getDataLength();
byte[] bytes = new byte[length];

    int offset = 0;
    int bytesRead = 0;

    InputStream in = openInputStream();

    while (offset < bytes.length) 
    {                 
        bytesRead = in.read(bytes, offset, bytes.length - offset);

        if (bytesRead < 0)
        {
            break;
        }

        offset += bytesRead;
    }

    in.close();
    
    if (offset < bytes.length)
    {
        throw new IOException("Failed to read complete data of MMS part");
    }
    
    return bytes;
}

`

I updated the method to this and now it works:

` public byte[] getData() throws IOException
{
InputStream inputStream = openInputStream();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[RAW_DATA_BLOCK_SIZE];

    while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
      buffer.write(data, 0, nRead);
    }
    buffer.flush();
    return buffer.toByteArray();
}

`

I have attached a modified version of the .apk containing this change;
2021-EnvayaSMS-release_imgs_in.zip

from envayasms.

Related Issues (20)

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.