/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/fav/a/k.java

https://github.com/HelloHuDi/AndroidReverseNotes · Java · 325 lines · 318 code · 5 blank · 2 comment · 104 complexity · 63561a4711a8f06cf3f20be791d506c5 MD5 · raw file

  1. package com.tencent.mm.plugin.fav.a;
  2. import com.tencent.matrix.trace.core.AppMethodBeat;
  3. import com.tencent.mm.kernel.g;
  4. import com.tencent.mm.protocal.protobuf.aar;
  5. import com.tencent.mm.protocal.protobuf.abe;
  6. import com.tencent.mm.protocal.protobuf.abl;
  7. import com.tencent.mm.protocal.protobuf.abo;
  8. import com.tencent.mm.protocal.protobuf.abu;
  9. import com.tencent.mm.sdk.platformtools.ab;
  10. import com.tencent.mm.sdk.platformtools.bo;
  11. import com.tencent.mm.vfs.b;
  12. import com.tencent.mm.vfs.e;
  13. import com.tencent.mm.vfs.j;
  14. import java.io.IOException;
  15. import java.io.InputStream;
  16. import java.util.Iterator;
  17. public final class k implements w {
  18. public boolean mfm = true;
  19. /* JADX WARNING: Removed duplicated region for block: B:74:0x01e2 A:{SYNTHETIC, Splitter:B:74:0x01e2} */
  20. /* Code decompiled incorrectly, please refer to instructions dump. */
  21. public final boolean t(g gVar) {
  22. Throwable th;
  23. InputStream inputStream;
  24. AppMethodBeat.i(102666);
  25. if (gVar == null) {
  26. AppMethodBeat.o(102666);
  27. return true;
  28. } else if (b.f(gVar)) {
  29. AppMethodBeat.o(102666);
  30. return true;
  31. } else {
  32. g iE = ((ae) g.M(ae.class)).getFavItemInfoStorage().iE(gVar.field_localId);
  33. boolean isNullOrNil;
  34. aar c;
  35. String str;
  36. abe abe;
  37. switch (gVar.field_type) {
  38. case 1:
  39. isNullOrNil = bo.isNullOrNil(gVar.field_favProto.desc);
  40. AppMethodBeat.o(102666);
  41. return isNullOrNil;
  42. case 2:
  43. case 8:
  44. if (new b(b.b(b.c(gVar))).exists()) {
  45. AppMethodBeat.o(102666);
  46. return false;
  47. }
  48. AppMethodBeat.o(102666);
  49. return true;
  50. case 3:
  51. if (this.mfm) {
  52. AppMethodBeat.o(102666);
  53. return true;
  54. }
  55. AppMethodBeat.o(102666);
  56. return false;
  57. case 4:
  58. c = b.c(gVar);
  59. if (new b(b.b(c)).exists()) {
  60. AppMethodBeat.o(102666);
  61. return false;
  62. }
  63. isNullOrNil = bo.isNullOrNil(c.wgg);
  64. AppMethodBeat.o(102666);
  65. return isNullOrNil;
  66. case 5:
  67. abl abl = gVar.field_favProto.wit;
  68. abu abu = gVar.field_favProto.whA;
  69. str = null;
  70. if (abu != null) {
  71. str = abu.wiY;
  72. }
  73. if (abl != null && bo.isNullOrNil(r0)) {
  74. str = abl.link;
  75. }
  76. isNullOrNil = bo.isNullOrNil(str);
  77. AppMethodBeat.o(102666);
  78. return isNullOrNil;
  79. case 6:
  80. if (gVar.field_favProto.why == null) {
  81. AppMethodBeat.o(102666);
  82. return true;
  83. }
  84. AppMethodBeat.o(102666);
  85. return false;
  86. case 7:
  87. c = b.c(gVar);
  88. if (bo.isNullOrNil(c.wgg) && bo.isNullOrNil(c.wgi) && bo.isNullOrNil(c.wgk) && bo.isNullOrNil(c.wgk)) {
  89. AppMethodBeat.o(102666);
  90. return true;
  91. }
  92. AppMethodBeat.o(102666);
  93. return false;
  94. case 10:
  95. abe = gVar.field_favProto.whC;
  96. if (abe == null || bo.isNullOrNil(abe.info)) {
  97. AppMethodBeat.o(102666);
  98. return true;
  99. }
  100. AppMethodBeat.o(102666);
  101. return false;
  102. case 11:
  103. abe = gVar.field_favProto.whC;
  104. if (abe == null || bo.isNullOrNil(abe.info)) {
  105. AppMethodBeat.o(102666);
  106. return true;
  107. }
  108. AppMethodBeat.o(102666);
  109. return false;
  110. case 14:
  111. case 18:
  112. if (gVar.field_id <= 0 && iE != null) {
  113. AppMethodBeat.o(102666);
  114. return true;
  115. } else if (gVar.field_type == 18 && (gVar.field_favProto == null || gVar.field_favProto.wiv.size() <= 1)) {
  116. AppMethodBeat.o(102666);
  117. return true;
  118. } else if (gVar.field_type == 18 && (bo.isNullOrNil(((aar) gVar.field_favProto.wiv.get(0)).wfZ) || bo.isNullOrNil(((aar) gVar.field_favProto.wiv.get(0)).wgb))) {
  119. AppMethodBeat.o(102666);
  120. return true;
  121. } else {
  122. Iterator it = gVar.field_favProto.wiv.iterator();
  123. while (it.hasNext()) {
  124. c = (aar) it.next();
  125. if ((c.dataType == 2 || c.dataType == 8 || c.dataType == 15 || c.dataType == 4) && !e.ct(b.b(c))) {
  126. AppMethodBeat.o(102666);
  127. return true;
  128. }
  129. }
  130. AppMethodBeat.o(102666);
  131. return false;
  132. }
  133. case 15:
  134. abo abo = gVar.field_favProto.whE;
  135. if (abo == null || bo.isNullOrNil(abo.info)) {
  136. AppMethodBeat.o(102666);
  137. return true;
  138. }
  139. AppMethodBeat.o(102666);
  140. return false;
  141. case 16:
  142. if (bo.ank(com.tencent.mm.m.g.Nu().getValue("SIGHTCannotTransmitForFav")) != 0) {
  143. ab.w("MicroMsg.FavSendFilter", "can not retransmit short video");
  144. AppMethodBeat.o(102666);
  145. return true;
  146. }
  147. aar c2 = b.c(gVar);
  148. b bVar = new b(b.b(c2));
  149. ab.v("MicroMsg.FavSendFilter", "type size, favid %d, localid %d, path %s, exist %B", Integer.valueOf(gVar.field_id), Long.valueOf(gVar.field_localId), j.w(bVar.dMD()), Boolean.valueOf(bVar.exists()));
  150. if (bVar.exists()) {
  151. long length = bVar.length();
  152. if (Math.abs(c2.wgu - length) > 16) {
  153. InputStream b;
  154. try {
  155. b = e.b(bVar.mUri, null);
  156. try {
  157. str = com.tencent.mm.a.g.b(b, 4096);
  158. if (b != null) {
  159. try {
  160. b.close();
  161. } catch (IOException e) {
  162. }
  163. }
  164. } catch (IOException e2) {
  165. } catch (Throwable th2) {
  166. th = th2;
  167. inputStream = b;
  168. if (inputStream != null) {
  169. }
  170. AppMethodBeat.o(102666);
  171. throw th;
  172. }
  173. } catch (IOException e3) {
  174. b = null;
  175. str = null;
  176. if (b != null) {
  177. try {
  178. b.close();
  179. } catch (IOException e4) {
  180. }
  181. }
  182. ab.w("MicroMsg.FavSendFilter", "it can not retransmit short video because of file was replaced. file[%d, %s], data[%d, %s]", Long.valueOf(length), str, Long.valueOf(r6), c2.wgq);
  183. AppMethodBeat.o(102666);
  184. return true;
  185. } catch (Throwable th3) {
  186. th = th3;
  187. inputStream = null;
  188. if (inputStream != null) {
  189. try {
  190. inputStream.close();
  191. } catch (IOException e5) {
  192. }
  193. }
  194. AppMethodBeat.o(102666);
  195. throw th;
  196. }
  197. ab.w("MicroMsg.FavSendFilter", "it can not retransmit short video because of file was replaced. file[%d, %s], data[%d, %s]", Long.valueOf(length), str, Long.valueOf(r6), c2.wgq);
  198. AppMethodBeat.o(102666);
  199. return true;
  200. }
  201. AppMethodBeat.o(102666);
  202. return false;
  203. }
  204. AppMethodBeat.o(102666);
  205. return true;
  206. default:
  207. AppMethodBeat.o(102666);
  208. return false;
  209. }
  210. }
  211. }
  212. public static boolean h(aar aar) {
  213. AppMethodBeat.i(102667);
  214. if (aar == null) {
  215. AppMethodBeat.o(102667);
  216. return true;
  217. }
  218. switch (aar.dataType) {
  219. case 2:
  220. case 8:
  221. if (new b(b.b(aar)).exists()) {
  222. AppMethodBeat.o(102667);
  223. return false;
  224. }
  225. AppMethodBeat.o(102667);
  226. return true;
  227. case 3:
  228. AppMethodBeat.o(102667);
  229. return true;
  230. case 4:
  231. if (new b(b.b(aar)).exists()) {
  232. AppMethodBeat.o(102667);
  233. return false;
  234. }
  235. boolean isNullOrNil = bo.isNullOrNil(aar.wgg);
  236. AppMethodBeat.o(102667);
  237. return isNullOrNil;
  238. case 7:
  239. if (bo.isNullOrNil(aar.wgg) && bo.isNullOrNil(aar.wgi) && bo.isNullOrNil(aar.wgk) && bo.isNullOrNil(aar.wgk)) {
  240. AppMethodBeat.o(102667);
  241. return true;
  242. }
  243. AppMethodBeat.o(102667);
  244. return false;
  245. case 15:
  246. if (bo.ank(com.tencent.mm.m.g.Nu().getValue("SIGHTCannotTransmitForFav")) != 0) {
  247. ab.w("MicroMsg.FavSendFilter", "can not retransmit short video");
  248. AppMethodBeat.o(102667);
  249. return true;
  250. } else if (new b(b.b(aar)).exists()) {
  251. AppMethodBeat.o(102667);
  252. return false;
  253. } else {
  254. AppMethodBeat.o(102667);
  255. return true;
  256. }
  257. default:
  258. AppMethodBeat.o(102667);
  259. return false;
  260. }
  261. }
  262. public static boolean u(g gVar) {
  263. AppMethodBeat.i(102668);
  264. if (gVar == null) {
  265. AppMethodBeat.o(102668);
  266. return false;
  267. } else if (gVar.field_itemStatus <= 0 || b.g(gVar)) {
  268. g iE = ((ae) g.M(ae.class)).getFavItemInfoStorage().iE(gVar.field_localId);
  269. b bVar = new b(b.b(b.c(gVar)));
  270. switch (gVar.field_type) {
  271. case 2:
  272. case 8:
  273. if (!bVar.exists()) {
  274. AppMethodBeat.o(102668);
  275. return true;
  276. }
  277. break;
  278. case 4:
  279. if (bo.isNullOrNil(b.c(gVar).wgg) && !bVar.exists()) {
  280. AppMethodBeat.o(102668);
  281. return true;
  282. }
  283. case 14:
  284. case 18:
  285. if (gVar.field_id > 0 || iE == null) {
  286. if (gVar.field_favProto != null && gVar.field_favProto.wiv.size() > 1) {
  287. Iterator it = gVar.field_favProto.wiv.iterator();
  288. while (it.hasNext()) {
  289. aar aar = (aar) it.next();
  290. if (!bo.isNullOrNil(aar.wfZ) && !bo.isNullOrNil(aar.wgb) && !e.ct(b.b(aar))) {
  291. AppMethodBeat.o(102668);
  292. return true;
  293. }
  294. }
  295. break;
  296. }
  297. AppMethodBeat.o(102668);
  298. return false;
  299. }
  300. AppMethodBeat.o(102668);
  301. return false;
  302. case 16:
  303. if (bo.ank(com.tencent.mm.m.g.Nu().getValue("SIGHTCannotTransmitForFav")) != 0) {
  304. ab.w("MicroMsg.FavSendFilter", "can not retransmit short video");
  305. AppMethodBeat.o(102668);
  306. return false;
  307. } else if (!bVar.exists()) {
  308. AppMethodBeat.o(102668);
  309. return true;
  310. }
  311. break;
  312. }
  313. AppMethodBeat.o(102668);
  314. return false;
  315. } else {
  316. AppMethodBeat.o(102668);
  317. return false;
  318. }
  319. }
  320. }