Permalink
Browse files

Use BoundedBufferedReader in Airodump to avoid OutOfMemoryException.

  • Loading branch information...
chrisk44 committed May 30, 2018
1 parent b9d2fa3 commit 74e8ee98ae67cfa8fc81d72920cf560b68c82af1
View
@@ -24,7 +24,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
@@ -28,6 +28,7 @@
import static com.hijacker.MainActivity.BAND_2;
import static com.hijacker.MainActivity.BAND_5;
import static com.hijacker.MainActivity.BAND_BOTH;
import static com.hijacker.MainActivity.MAX_READLINE_SIZE;
import static com.hijacker.MainActivity.airodump_dir;
import static com.hijacker.MainActivity.always_cap;
import static com.hijacker.MainActivity.band;
@@ -192,9 +193,9 @@ public void run(){
int mode = channel==0 ? 0 : 1;
Process process = Runtime.getRuntime().exec(final_cmd);
last_action = System.currentTimeMillis();
BufferedReader in = new BufferedReader(new InputStreamReader(process.getErrorStream()));
BoundedBufferedReader in = new BoundedBufferedReader(new InputStreamReader(process.getErrorStream()));
String buffer;
while(Airodump.isRunning() && (buffer = in.readLine())!=null){
while(Airodump.isRunning() && (buffer = in.readLine(MAX_READLINE_SIZE))!=null){
main(buffer, mode);
}
}catch(IOException e){ Log.e("HIJACKER/Exception", "Caught Exception in Airodump.start() read thread: " + e.toString()); }
Oops, something went wrong.

0 comments on commit 74e8ee9

Please sign in to comment.