daktak / opengapps_downloader

Android : Download opengapps zip from github
GNU General Public License v3.0
23 stars 1 forks source link

I found some crash issues!! #19

Open YYYSSSHHH opened 4 years ago

YYYSSSHHH commented 4 years ago

Environment Info: APK:android:versionCode="12" android:versionName="0.4.6" AndroidOS Version = 6.0.1

Description information: We find that mobile apps are prone to crashes due to a network issue, mainly because successful network API calls return unexpected or no data. And we found that when this app's network returned data is null ,or the network request fails (status code is 404/503), the app has crashed.

crash information: crash one: crashActivity=org.opengappsdownloader.SetPreferenceActivity

:

java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

Caused by: java.lang.NullPointerException: println needs a message at android.util.Log.println_native(Native Method) at android.util.Log.e(Log.java:232) at org.opengappsdownloader.Download.parseUrl(Download.java:108) at org.opengappsdownloader.Download$ParseURL.doInBackground(Download.java:76) at org.opengappsdownloader.Download$ParseURL.doInBackground(Download.java:72) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) ... 4 more java.lang.NullPointerException: println needs a message at android.util.Log.println_native(Native Method) at android.util.Log.e(Log.java:232) at org.opengappsdownloader.Download.parseUrl(Download.java:108) at org.opengappsdownloader.Download$ParseURL.doInBackground(Download.java:76) at org.opengappsdownloader.Download$ParseURL.doInBackground(Download.java:72) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

Finally: The cause of the program crash may be that the network response data is not handled properly in the code, such as null or empty.

If you have confirmed or fixed this problem, please give me a reply, thank you!

YYYSSSHHH commented 4 years ago

How do we test the APP? We use the fuzzing method to simulate the network response data. For example, when the app receives network API response data from the server or network, we will replace it with 404, null and random data.

A very simple example:

normal data :Value=”hello” -----fuzzing-----> simulated data :Value=null or network request fails(404、503) or Value=”heee”(random data) or Value=""(empty) , etc.