Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
AndroidIngestModule.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2016 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.modules.android;
20 
21 import java.util.ArrayList;
22 
27 import org.sleuthkit.datamodel.Content;
31 
32 class AndroidIngestModule implements DataSourceIngestModule {
33 
34  private IngestJobContext context = null;
35 
36  @Override
37  public void startUp(IngestJobContext context) throws IngestModuleException {
38  this.context = context;
39  }
40 
41  @Override
42  public ProcessResult process(Content dataSource, DataSourceIngestModuleProgress progressBar) {
43  ArrayList<String> errors = new ArrayList<>();
44  progressBar.switchToDeterminate(9);
46 
47  try {
48  ContactAnalyzer.findContacts(dataSource, fileManager, context);
49  progressBar.progress(1);
50  if (context.dataSourceIngestIsCancelled()) {
52  }
53  } catch (Exception e) {
54  errors.add("Error getting Contacts"); //NON-NLS
55  }
56 
57  try {
58  CallLogAnalyzer.findCallLogs(dataSource, fileManager, context);
59  progressBar.progress(2);
60  if (context.dataSourceIngestIsCancelled()) {
62  }
63  } catch (Exception e) {
64  errors.add("Error getting Call Logs"); //NON-NLS
65  }
66 
67  try {
68  TextMessageAnalyzer.findTexts(dataSource, fileManager, context);
69  progressBar.progress(3);
70  if (context.dataSourceIngestIsCancelled()) {
72  }
73  } catch (Exception e) {
74  errors.add("Error getting Text Messages"); //NON-NLS
75  }
76 
77  try {
78  TangoMessageAnalyzer.findTangoMessages(dataSource, fileManager, context);
79  progressBar.progress(4);
80  if (context.dataSourceIngestIsCancelled()) {
82  }
83  } catch (Exception e) {
84  errors.add("Error getting Tango Messages"); //NON-NLS
85  }
86 
87  try {
88  WWFMessageAnalyzer.findWWFMessages(dataSource, fileManager, context);
89  progressBar.progress(5);
90  if (context.dataSourceIngestIsCancelled()) {
92  }
93  } catch (Exception e) {
94  errors.add("Error getting Words with Friends Messages"); //NON-NLS
95  }
96 
97  try {
98  GoogleMapLocationAnalyzer.findGeoLocations(dataSource, fileManager, context);
99  progressBar.progress(6);
100  if (context.dataSourceIngestIsCancelled()) {
102  }
103  } catch (Exception e) {
104  errors.add("Error getting Google Map Locations"); //NON-NLS
105  }
106 
107  try {
108  BrowserLocationAnalyzer.findGeoLocations(dataSource, fileManager, context);
109  progressBar.progress(7);
110  if (context.dataSourceIngestIsCancelled()) {
112  }
113  } catch (Exception e) {
114  errors.add("Error getting Browser Locations"); //NON-NLS
115  }
116 
117  try {
118  CacheLocationAnalyzer.findGeoLocations(dataSource, fileManager, context);
119  progressBar.progress(8);
120  } catch (Exception e) {
121  errors.add("Error getting Cache Locations"); //NON-NLS
122  }
123 
124  // create the final message for inbox
125  StringBuilder errorMessage = new StringBuilder();
126  String errorMsgSubject;
128  if (errors.isEmpty() == false) {
129  msgLevel = IngestMessage.MessageType.ERROR;
130  errorMessage.append("Errors were encountered"); //NON-NLS
131  for (String msg : errors) {
132  errorMessage.append("<li>").append(msg).append("</li>\n"); //NON-NLS
133  }
134  errorMessage.append("</ul>\n"); //NON-NLS
135 
136  if (errors.size() == 1) {
137  errorMsgSubject = "One error was found"; //NON-NLS
138  } else {
139  errorMsgSubject = "errors found: " + errors.size(); //NON-NLS
140  }
141  } else {
142  errorMessage.append("No errors"); //NON-NLS
143  errorMsgSubject = "No errors"; //NON-NLS
144  }
145 
147  }
148 }

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jan 2 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.