MCPcopy Create free account
hub / github.com/d78ui98/APKDeepLens / create_dir_to_extract

Method create_dir_to_extract

APKDeepLens.py:192–225  ·  view source on GitHub ↗

Creating a folder to extract apk source code

(self, apk_file, extracted_path=None)

Source from the content-addressed store, hash-verified

190 pass
191
192 def create_dir_to_extract(self, apk_file, extracted_path=None):
193 """
194 Creating a folder to extract apk source code
195 """
196 extracted_source_path = os.path.join(
197 os.path.dirname(os.path.abspath(__file__)), "app_source", apk_file
198 )
199
200 resources_path = os.path.join(extracted_source_path, "resources")
201 sources_path = os.path.join(extracted_source_path, "sources")
202
203 if (
204 os.path.exists(extracted_source_path)
205 and os.path.isdir(extracted_source_path)
206 and os.path.exists(resources_path)
207 and os.path.isdir(resources_path)
208 and os.path.exists(sources_path)
209 and os.path.isdir(sources_path)
210 ):
211 util.mod_log(
212 "[+] Source code for apk - {} Already extracted. Skipping this step.".format(
213 apk_file
214 ),
215 util.OKCYAN,
216 )
217 return {"result": 0, "path": extracted_source_path}
218 else:
219 os.makedirs(extracted_source_path, exist_ok=True)
220 util.mod_log(
221 "[+] Creating new directory for extracting apk : "
222 + extracted_source_path,
223 util.OKCYAN,
224 )
225 return {"result": 1, "path": extracted_source_path}
226
227 def extract_source_code(self, apk_file, target_dir):
228 """

Callers 1

APKDeepLens.pyFile · 0.80

Calls 1

mod_logMethod · 0.45

Tested by

no test coverage detected