Permalink
Browse files

init

  • Loading branch information...
kar committed Aug 3, 2017
0 parents commit 69fed964a3e79d1059860cae34b230388c662552
Showing with 14,571 additions and 0 deletions.
  1. +12 −0 .gitignore
  2. +674 −0 LICENSE
  3. +57 −0 Makefile
  4. +33 −0 README.md
  5. +1 −0 app/.gitignore
  6. +88 −0 app/build.gradle
  7. +32 −0 app/proguard-rules.pro
  8. +23 −0 app/src/debug/kotlin/org.blokada.app.android/MainApplication.kt
  9. +15 −0 app/src/dev/AndroidManifest.xml
  10. +3 −0 app/src/dev/res/values/strings_branding.xml
  11. +29 −0 app/src/firebase/kotlin/org.blokada.app.android/AFirebaseDashPersistence.kt
  12. +71 −0 app/src/firebase/kotlin/org.blokada.app.android/AFirebaseJournal.kt
  13. +73 −0 app/src/firebase/kotlin/org.blokada.app.android/AFirebaseModule.kt
  14. +19 −0 app/src/firebase/kotlin/org.blokada.app.android/FirebaseState.kt
  15. +35 −0 app/src/firebase/kotlin/org.blokada.ui.app.android/AFirebaseDashes.kt
  16. +24 −0 app/src/incognito/kotlin/org.blokada.app.android/MainApplication.kt
  17. +16 −0 app/src/main/AndroidManifest.xml
  18. +76 −0 app/src/main/kotlin/org.blokada.app.android/AAppConfigModule.kt
  19. +16 −0 app/src/prod/AndroidManifest.xml
  20. +3 −0 app/src/prod/res/values/strings_branding.xml
  21. +24 −0 app/src/release/kotlin/org.blokada.app.android/MainApplication.kt
  22. +24 −0 build.gradle
  23. +18 −0 gradle.properties
  24. BIN gradle/wrapper/gradle-wrapper.jar
  25. +6 −0 gradle/wrapper/gradle-wrapper.properties
  26. +160 −0 gradlew
  27. +90 −0 gradlew.bat
  28. +1 −0 libcore/.gitignore
  29. +73 −0 libcore/build.gradle
  30. +38 −0 libcore/proguard-rules.pro
  31. +52 −0 libcore/src/main/AndroidManifest.xml
  32. +61 −0 libcore/src/main/kotlin/org.blokada/app/AppAnalytics.kt
  33. +26 −0 libcore/src/main/kotlin/org.blokada/app/AppComponents.kt
  34. +146 −0 libcore/src/main/kotlin/org.blokada/app/AppModels.kt
  35. +266 −0 libcore/src/main/kotlin/org.blokada/app/AppModule.kt
  36. +132 −0 libcore/src/main/kotlin/org.blokada/app/DnsProxy.kt
  37. +60 −0 libcore/src/main/kotlin/org.blokada/app/EnabledStateActor.kt
  38. +81 −0 libcore/src/main/kotlin/org.blokada/app/FilterSerializer.kt
  39. +46 −0 libcore/src/main/kotlin/org.blokada/app/FilterSourceSingle.kt
  40. +21 −0 libcore/src/main/kotlin/org.blokada/app/HostlineProcessor.kt
  41. +9 −0 libcore/src/main/kotlin/org.blokada/app/IProxyEvents.kt
  42. +42 −0 libcore/src/main/kotlin/org.blokada/app/UpdateCoordinator.kt
  43. +74 −0 libcore/src/main/kotlin/org.blokada/app/android/AAppDummyConfigModule.kt
  44. +131 −0 libcore/src/main/kotlin/org.blokada/app/android/AAppModule.kt
  45. +174 −0 libcore/src/main/kotlin/org.blokada/app/android/AAppPersistence.kt
  46. +102 −0 libcore/src/main/kotlin/org.blokada/app/android/AAppReceivers.kt
  47. +56 −0 libcore/src/main/kotlin/org.blokada/app/android/AAppUtils.kt
  48. +41 −0 libcore/src/main/kotlin/org.blokada/app/android/AEngineManagerProvider.kt
  49. +129 −0 libcore/src/main/kotlin/org.blokada/app/android/AFilterSources.kt
  50. +27 −0 libcore/src/main/kotlin/org.blokada/app/android/AKeepAliveAgent.kt
  51. +50 −0 libcore/src/main/kotlin/org.blokada/app/android/AKeepAliveService.kt
  52. +27 −0 libcore/src/main/kotlin/org.blokada/app/android/ALogcatJournal.kt
  53. +299 −0 libcore/src/main/kotlin/org.blokada/app/android/AState.kt
  54. +78 −0 libcore/src/main/kotlin/org.blokada/app/android/ATunnelAgent.kt
  55. +64 −0 libcore/src/main/kotlin/org.blokada/app/android/ATunnelPermsUtils.kt
  56. +127 −0 libcore/src/main/kotlin/org.blokada/app/android/ATunnelService.kt
  57. +98 −0 libcore/src/main/kotlin/org.blokada/app/android/AUpdateDownloader.kt
  58. +87 −0 libcore/src/main/kotlin/org.blokada/app/android/AWatchdog.kt
  59. +64 −0 libcore/src/main/kotlin/org.blokada/app/android/lollipop/ALollipopEngineManager.kt
  60. +98 −0 libcore/src/main/kotlin/org.blokada/app/android/lollipop/ALollipopTunnelEvents.kt
  61. +216 −0 libcore/src/main/kotlin/org.blokada/app/android/lollipop/ALollipopTunnelThread.kt
  62. +40 −0 libcore/src/main/kotlin/org.blokada/app/android/lollipop/ForwardQueue.kt
  63. +19 −0 libcore/src/main/kotlin/org.blokada/framework/FrameworkComponents.kt
  64. +106 −0 libcore/src/main/kotlin/org.blokada/framework/FrameworkUtils.kt
  65. +53 −0 libcore/src/main/kotlin/org.blokada/framework/Identity.kt
  66. +359 −0 libcore/src/main/kotlin/org.blokada/framework/Property.kt
  67. +24 −0 libcore/src/main/kotlin/org.blokada/framework/android/AActivityContext.kt
  68. +101 −0 libcore/src/main/kotlin/org.blokada/framework/android/AConnectivityUtils.kt
  69. +15 −0 libcore/src/main/kotlin/org.blokada/framework/android/AFrameworkComponents.kt
  70. +61 −0 libcore/src/main/kotlin/org.blokada/framework/android/APersistenceUtils.kt
  71. +3 −0 libcore/src/main/res/values/strings.xml
  72. +4 −0 libcore/src/main/res/xml/provider_update.xml
  73. +258 −0 libcore/src/test/java/org.blokada/app/AppModuleTest.kt
  74. +55 −0 libcore/src/test/java/org.blokada/app/FilterManagingTest.kt
  75. +203 −0 libcore/src/test/java/org.blokada/app/FilterSerialiserTest.kt
  76. +25 −0 libcore/src/test/java/org.blokada/framework/IdentityTest.kt
  77. +31 −0 libcore/src/test/java/org.blokada/framework/PromiseTest.kt
  78. +311 −0 libcore/src/test/java/org.blokada/framework/PropertyTest.kt
  79. +10 −0 libcore/src/test/java/org.blokada/framework/TestMocks.kt
  80. +18 −0 libcore/src/test/java/org.blokada/framework/TestUtil.kt
  81. +1 −0 libui/.gitignore
  82. +77 −0 libui/build.gradle
  83. +2 −0 libui/proguard-rules.pro
  84. +26 −0 libui/src/androidTest/java/org/blokada/lib/ExampleInstrumentedTest.java
  85. +38 −0 libui/src/main/AndroidManifest.xml
  86. +5 −0 libui/src/main/kotlin/org.blokada.ui/app/AppUiComponents.kt
  87. +69 −0 libui/src/main/kotlin/org.blokada.ui/app/AppUiModels.kt
  88. +51 −0 libui/src/main/kotlin/org.blokada.ui/app/AppUiModule.kt
  89. +16 −0 libui/src/main/kotlin/org.blokada.ui/app/UiState.kt
  90. +87 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AAppUiActors.kt
  91. +90 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AAppUiModule.kt
  92. +42 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AAppUiPersistence.kt
  93. +45 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AAppUiUtils.kt
  94. +110 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AContentActor.kt
  95. +69 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ADashActor.kt
  96. +138 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ADashView.kt
  97. +76 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AEngineAdapter.kt
  98. +88 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AEngineDashes.kt
  99. +34 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AEngineGridView.kt
  100. +80 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFabActor.kt
  101. +79 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFilterActor.kt
  102. +155 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFilterAddDialog.kt
  103. +146 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFilterDashes.kt
  104. +79 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFilterListView.kt
  105. +211 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFilterView.kt
  106. +177 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFiltersAddFileView.kt
  107. +141 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFiltersAddLinkView.kt
  108. +126 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFiltersAddSingleView.kt
  109. +102 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFiltersAddView.kt
  110. +78 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AFloaterView.kt
  111. +84 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AGridView.kt
  112. +66 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AInfoView.kt
  113. +32 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ALollipopEngine.kt
  114. +248 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AMainDashes.kt
  115. +85 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AMenuDashes.kt
  116. +62 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ANotificationDashes.kt
  117. +94 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ANotificationUtils.kt
  118. +21 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ANotificationsOffService.kt
  119. +44 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ANotificationsWhitelistService.kt
  120. +82 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AQuickSettingsService.kt
  121. +132 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ATopBarActor.kt
  122. +225 −0 libui/src/main/kotlin/org.blokada.ui/app/android/ATopBarView.kt
  123. +54 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AUiState.kt
  124. +121 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AUpdateDashes.kt
  125. +124 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AUpdateView.kt
  126. +93 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AWebViewActor.kt
  127. +150 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AWelcomeDialog.kt
  128. +65 −0 libui/src/main/kotlin/org.blokada.ui/app/android/AWelcomeView.kt
  129. +340 −0 libui/src/main/kotlin/org.blokada.ui/app/android/MainActivity.kt
  130. +63 −0 libui/src/main/kotlin/org.blokada.ui/framework/android/AFrameworkUiUtils.kt
  131. +24 −0 libui/src/main/kotlin/org.blokada.ui/framework/android/AResizeAnimation.kt
  132. +25 −0 libui/src/main/kotlin/org.blokada.ui/framework/android/ASwitchCompat.kt
  133. +4 −0 libui/src/main/res/color/fab_accent.xml
  134. +4 −0 libui/src/main/res/color/fab_active.xml
  135. BIN libui/src/main/res/drawable-hdpi-v11/ic_stat_blokada.png
  136. BIN libui/src/main/res/drawable-hdpi/bg_header.png
  137. BIN libui/src/main/res/drawable-hdpi/bg_window.png
  138. BIN libui/src/main/res/drawable-hdpi/ic_blokada.png
  139. BIN libui/src/main/res/drawable-hdpi/ic_blokada_shape.png
  140. BIN libui/src/main/res/drawable-hdpi/ic_stat_blokada.png
  141. BIN libui/src/main/res/drawable-hdpi/maker.png
  142. BIN libui/src/main/res/drawable-mdpi-v11/ic_stat_blokada.png
  143. BIN libui/src/main/res/drawable-mdpi/bg_header.png
  144. BIN libui/src/main/res/drawable-mdpi/bg_window.png
  145. BIN libui/src/main/res/drawable-mdpi/ic_blokada.png
  146. BIN libui/src/main/res/drawable-mdpi/ic_blokada_shape.png
  147. BIN libui/src/main/res/drawable-mdpi/ic_stat_blokada.png
  148. BIN libui/src/main/res/drawable-mdpi/maker.png
  149. BIN libui/src/main/res/drawable-xhdpi-v11/ic_stat_blokada.png
  150. BIN libui/src/main/res/drawable-xhdpi/bg_header.png
  151. BIN libui/src/main/res/drawable-xhdpi/bg_window.png
  152. BIN libui/src/main/res/drawable-xhdpi/ic_blokada.png
  153. BIN libui/src/main/res/drawable-xhdpi/ic_blokada_shape.png
  154. BIN libui/src/main/res/drawable-xhdpi/ic_stat_blokada.png
  155. BIN libui/src/main/res/drawable-xhdpi/maker.png
  156. BIN libui/src/main/res/drawable-xxhdpi-v11/ic_stat_blokada.png
  157. BIN libui/src/main/res/drawable-xxhdpi/bg_header.png
  158. BIN libui/src/main/res/drawable-xxhdpi/bg_window.png
  159. BIN libui/src/main/res/drawable-xxhdpi/ic_blokada.png
  160. BIN libui/src/main/res/drawable-xxhdpi/ic_blokada_shape.png
  161. BIN libui/src/main/res/drawable-xxhdpi/ic_stat_blokada.png
  162. BIN libui/src/main/res/drawable-xxhdpi/maker.png
  163. BIN libui/src/main/res/drawable-xxxhdpi-v11/ic_stat_blokada.png
  164. BIN libui/src/main/res/drawable-xxxhdpi/bg_header.png
  165. BIN libui/src/main/res/drawable-xxxhdpi/bg_window.png
  166. BIN libui/src/main/res/drawable-xxxhdpi/ic_blokada.png
  167. BIN libui/src/main/res/drawable-xxxhdpi/ic_stat_blokada.png
  168. BIN libui/src/main/res/drawable-xxxhdpi/maker.png
  169. +11 −0 libui/src/main/res/drawable/bg_infotext.xml
  170. +11 −0 libui/src/main/res/drawable/bg_shadow.xml
  171. +14 −0 libui/src/main/res/drawable/bg_window_nontransparent.xml
  172. +9 −0 libui/src/main/res/drawable/ic_add_circle.xml
  173. +9 −0 libui/src/main/res/drawable/ic_arrow_back.xml
  174. +9 −0 libui/src/main/res/drawable/ic_block.xml
  175. +9 −0 libui/src/main/res/drawable/ic_blocked.xml
  176. +9 −0 libui/src/main/res/drawable/ic_bug.xml
  177. +9 −0 libui/src/main/res/drawable/ic_comment_multiple_outline.xml
  178. +9 −0 libui/src/main/res/drawable/ic_counter.xml
  179. +9 −0 libui/src/main/res/drawable/ic_data_usage.xml
  180. +9 −0 libui/src/main/res/drawable/ic_delete.xml
  181. +9 −0 libui/src/main/res/drawable/ic_feedback.xml
  182. +9 −0 libui/src/main/res/drawable/ic_filter_add.xml
  183. +9 −0 libui/src/main/res/drawable/ic_heart_box.xml
  184. +9 −0 libui/src/main/res/drawable/ic_help_outline.xml
  185. +9 −0 libui/src/main/res/drawable/ic_hexagon.xml
  186. +9 −0 libui/src/main/res/drawable/ic_hexagon_multiple.xml
  187. +9 −0 libui/src/main/res/drawable/ic_info.xml
  188. +9 −0 libui/src/main/res/drawable/ic_info_outline.xml
  189. +9 −0 libui/src/main/res/drawable/ic_key_remove.xml
  190. +9 −0 libui/src/main/res/drawable/ic_mode_edit.xml
  191. +9 −0 libui/src/main/res/drawable/ic_more.xml
  192. +9 −0 libui/src/main/res/drawable/ic_new_releases.xml
  193. +9 −0 libui/src/main/res/drawable/ic_open_in_new.xml
  194. +9 −0 libui/src/main/res/drawable/ic_power.xml
  195. +9 −0 libui/src/main/res/drawable/ic_reload.xml
  196. +9 −0 libui/src/main/res/drawable/ic_settings.xml
  197. +9 −0 libui/src/main/res/drawable/ic_share.xml
  198. +9 −0 libui/src/main/res/drawable/ic_shield.xml
  199. +9 −0 libui/src/main/res/drawable/ic_shield_outline.xml
  200. +9 −0 libui/src/main/res/drawable/ic_timer_sand_empty.xml
  201. +9 −0 libui/src/main/res/drawable/ic_tune.xml
  202. +9 −0 libui/src/main/res/drawable/ic_update.xml
  203. +9 −0 libui/src/main/res/drawable/ic_verified.xml
  204. +9 −0 libui/src/main/res/drawable/ic_vpn_key.xml
  205. +92 −0 libui/src/main/res/layout/activity_main.xml
  206. +21 −0 libui/src/main/res/layout/content_webview.xml
  207. +10 −0 libui/src/main/res/layout/view_customlist.xml
  208. +35 −0 libui/src/main/res/layout/view_dash.xml
  209. +13 −0 libui/src/main/res/layout/view_enginegrid.xml
  210. +147 −0 libui/src/main/res/layout/view_filter.xml
  211. +21 −0 libui/src/main/res/layout/view_filtersadd.xml
  212. +82 −0 libui/src/main/res/layout/view_filtersadd_add.xml
  213. +104 −0 libui/src/main/res/layout/view_filtersadd_file.xml
  214. +105 −0 libui/src/main/res/layout/view_filtersadd_link.xml
  215. +8 −0 libui/src/main/res/layout/view_grid.xml
  216. +81 −0 libui/src/main/res/layout/view_topbar.xml
  217. +108 −0 libui/src/main/res/layout/view_update.xml
  218. +40 −0 libui/src/main/res/layout/view_welcome.xml
  219. BIN libui/src/main/res/mipmap-hdpi/ic_launcher.png
  220. BIN libui/src/main/res/mipmap-mdpi/ic_launcher.png
  221. BIN libui/src/main/res/mipmap-xhdpi/ic_launcher.png
  222. BIN libui/src/main/res/mipmap-xxhdpi/ic_launcher.png
  223. BIN libui/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  224. +59 −0 libui/src/main/res/values-cs/strings_filter.xml
  225. +107 −0 libui/src/main/res/values-cs/strings_main.xml
  226. +38 −0 libui/src/main/res/values-cs/strings_notification.xml
  227. +26 −0 libui/src/main/res/values-cs/strings_tunnel.xml
  228. +32 −0 libui/src/main/res/values-cs/strings_update.xml
  229. +53 −0 libui/src/main/res/values-de/strings_filter.xml
  230. +106 −0 libui/src/main/res/values-de/strings_main.xml
  231. +36 −0 libui/src/main/res/values-de/strings_notification.xml
  232. +22 −0 libui/src/main/res/values-de/strings_tunnel.xml
  233. +32 −0 libui/src/main/res/values-de/strings_update.xml
  234. +53 −0 libui/src/main/res/values-es/strings_filter.xml
  235. +106 −0 libui/src/main/res/values-es/strings_main.xml
  236. +36 −0 libui/src/main/res/values-es/strings_notification.xml
  237. +22 −0 libui/src/main/res/values-es/strings_tunnel.xml
  238. +32 −0 libui/src/main/res/values-es/strings_update.xml
  239. +53 −0 libui/src/main/res/values-fr/strings_filter.xml
  240. +106 −0 libui/src/main/res/values-fr/strings_main.xml
  241. +36 −0 libui/src/main/res/values-fr/strings_notification.xml
  242. +22 −0 libui/src/main/res/values-fr/strings_tunnel.xml
  243. +32 −0 libui/src/main/res/values-fr/strings_update.xml
  244. +53 −0 libui/src/main/res/values-nl/strings_filter.xml
  245. +106 −0 libui/src/main/res/values-nl/strings_main.xml
  246. +36 −0 libui/src/main/res/values-nl/strings_notification.xml
  247. +22 −0 libui/src/main/res/values-nl/strings_tunnel.xml
  248. +32 −0 libui/src/main/res/values-nl/strings_update.xml
  249. +59 −0 libui/src/main/res/values-pl/strings_filter.xml
  250. +106 −0 libui/src/main/res/values-pl/strings_main.xml
  251. +38 −0 libui/src/main/res/values-pl/strings_notification.xml
  252. +26 −0 libui/src/main/res/values-pl/strings_tunnel.xml
  253. +32 −0 libui/src/main/res/values-pl/strings_update.xml
  254. +53 −0 libui/src/main/res/values-pt/strings_filter.xml
  255. +106 −0 libui/src/main/res/values-pt/strings_main.xml
  256. +36 −0 libui/src/main/res/values-pt/strings_notification.xml
  257. +22 −0 libui/src/main/res/values-pt/strings_tunnel.xml
  258. +32 −0 libui/src/main/res/values-pt/strings_update.xml
  259. +24 −0 libui/src/main/res/values-v21/styles.xml
  260. +6 −0 libui/src/main/res/values-w820dp/dimens.xml
  261. +9 −0 libui/src/main/res/values/attrs.xml
  262. +45 −0 libui/src/main/res/values/colors.xml
  263. +18 −0 libui/src/main/res/values/dimens.xml
  264. +6 −0 libui/src/main/res/values/strings_branding.xml
  265. +59 −0 libui/src/main/res/values/strings_filter.xml
  266. +118 −0 libui/src/main/res/values/strings_main.xml
  267. +39 −0 libui/src/main/res/values/strings_notification.xml
  268. +23 −0 libui/src/main/res/values/strings_tunnel.xml
  269. +36 −0 libui/src/main/res/values/strings_update.xml
  270. +38 −0 libui/src/main/res/values/styles.xml
  271. +83 −0 make-flavor.sh
  272. +1 −0 makef
  273. +30 −0 release.md
  274. +1 −0 settings.gradle
  275. +73 −0 translation.sh
@@ -0,0 +1,12 @@
*.iml
.gradle
/version.gradle
.idea
.DS_Store
*.aar
vendor
/local.properties
/build
/captures
firebase.xml
google-services.json
674 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,57 @@
PACKAGE_PREFIX?=org.blokada
ACTIVITY_PREFIX?=org.blokada.ui.app.android
FLAVOR?=Dev
VARIANT?=Debug
PACKAGE?=.dev
GRADLE?=./gradlew
FLAVOR_LC=`echo $(FLAVOR) | tr A-Z a-z`
VARIANT_LC=`echo $(VARIANT) | tr A-Z a-z`
# Default target
all: ass in start
# Build ($(GRADLE)) aliases
ass:
$(GRADLE) assemble$(FLAVOR)$(VARIANT)
test:
$(GRADLE) lint$(FLAVOR)$(VARIANT) test$(FLAVOR)$(VARIANT)
atest:
$(GRADLE) androidTest$(FLAVOR)$(VARIANT)
clean:
$(GRADLE) clean
in:
adb install -r app/build/outputs/apk/app-$(FLAVOR_LC)-$(VARIANT_LC).apk
un:
adb uninstall $(PACKAGE_PREFIX)$(PACKAGE)
rein: un in
deps:
$(GRADLE) app:dependencies
# Git convenience
version-name:
git describe --tags --dirty
# ADB convenience
start:
adb shell am start -n $(PACKAGE_PREFIX)$(PACKAGE)/$(ACTIVITY_PREFIX).MainActivity
stop:
adb shell am force-stop $(PACKAGE_PREFIX)$(PACKAGE)
restart: stop start
cleandata:
adb shell pm clear $(PACKAGE_PREFIX)$(PACKAGE)
.PHONY: ass test atest clean in un rein deps version-name start stop restart cleardata
@@ -0,0 +1,33 @@
# Blokada v2.0
Blokada is a free, open source, compact, fast ad blocker for Android that works for all apps and does not require root.
Want to try out this app? Click here to [download Blokada](http://go.blokada.org/download_section). If you are experiencing problems, or want to give feedback, you are in the right place. Read on.
## Bugs and issues
All ongoing work for the project can be followed and commented on our bug tracker. We prioritise issues based on your votes and feedback so don't hesitate to participate.
- [Bug tracker](http://go.blokada.org/dev_issues)
- **[Add a new bug](http://go.blokada.org/dev_issues_new)**
## New ideas
You can propose new ideas and vote for new features on our ideas forum. We prioritise our efforts based on the votes.
- [Ideas forum](http://go.blokada.org/dev_ideas_popular)
- **[Add a new idea](http://go.blokada.org/dev_ideas_new)**
## Knowledge base
We maintain several lists based on your feedback, so other users have easier time if they are experiencing problems. Feel free to add new items or comment on existing ones that affect you.
- [Apps blacklist](http://go.blokada.org/dev_blacklist_apps) - A list of problematic apps that display some ads even if Blokada is on.
- [Devices blacklist](http://go.blokada.org/dev_blacklist_devices) - A list of problematic devices for which Blokada may not work properly.
- [Frequently Asked Questions](http://go.blokada.org/info_faq) - Answers to the most commonly asked questions about Blokada.
## Contact
You can always send an email with your feedback to hello@blokada.org.
Follow us: [Twitter](http://go.blokada.org/social_twitter), [Facebook](http://go.blokada.org/social_facebook), [Google+](http://go.blokada.org/social_gplus).
@@ -0,0 +1 @@
/build
@@ -0,0 +1,88 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: '../version.gradle'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "org.blokada"
minSdkVersion 21
targetSdkVersion 25
versionCode extVersionCode
versionName extVersionName
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
dev.java.srcDirs += 'src/dev/kotlin'
prod.java.srcDirs += 'src/prod/kotlin'
release.java.srcDirs += 'src/release/kotlin'
release.java.srcDirs += 'src/firebase/kotlin'
debug.java.srcDirs += 'src/debug/kotlin'
incognito.java.srcDirs += 'src/incognito/kotlin'
}
signingConfigs {
release {
keyAlias 'blokada'
keyPassword BLOKADA_KEY_PASSWORD
storeFile file(BLOKADA_KEY_PATH)
storePassword BLOKADA_STORE_PASSWORD
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
incognito {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
versionNameSuffix '-incognito'
}
debug {
versionNameSuffix '-debug'
}
}
productFlavors {
dev {
applicationIdSuffix ".dev"
}
prod {
applicationIdSuffix ".alarm"
minSdkVersion 21
}
}
}
dependencies {
// The UI Blokada library
debugCompile project(path: ':libui', configuration: 'debug')
incognitoCompile project(path: ':libui', configuration: 'release')
releaseCompile project(path: ':libui', configuration: 'release')
// Analytics and debugging
releaseCompile 'com.google.firebase:firebase-core:10.2.4'
releaseCompile 'com.google.firebase:firebase-crash:10.2.4'
// Test dependencies
testCompile 'junit:junit:4.12'
}
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
}
buildscript {
ext.kotlin_version = '1.1.2-3'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -0,0 +1,32 @@
-dontwarn rx.internal.util.unsafe.**
-dontwarn nl.komponents.kovenant.unsafe.**
# Kodein
-keepattributes Signature
-keepclassmembers class **$WhenMappings {
<fields>;
}
#-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
# static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
#}
# dnsjava
# See http://stackoverflow.com/questions/5701126
-optimizations !field/removal/writeonly,!field/marking/private,!class/merging/*,!code/allocation/variable
-dontnote org.xbill.DNS.spi.DNSJavaNameServiceDescriptor
-dontwarn org.xbill.DNS.spi.DNSJavaNameServiceDescriptor
-dontwarn sun.net.spi.nameservice.**
# pcap4j
-keep class org.slf4j.** { *; }
-keep class org.pcap4j.** { *; }
-dontwarn java.awt.*
-dontwarn org.slf4j.impl.StaticMDCBinder
-dontwarn org.slf4j.impl.StaticMarkerBinder
-dontwarn org.slf4j.impl.StaticLoggerBinder
-assumenosideeffects class org.slf4j.Logger {
public void debug(...);
public void trace(...);
}
@@ -0,0 +1,23 @@
package org.blokada.app.android
import android.app.Application
import com.github.salomonbrys.kodein.Kodein
import com.github.salomonbrys.kodein.KodeinAware
import com.github.salomonbrys.kodein.lazy
import org.blokada.app.newAppModule
import org.blokada.ui.app.android.newAndroidAppUiModule
import org.blokada.ui.app.newAppUiModule
/**
* MainApplication puts together all modules.
*/
class MainApplication: Application(), KodeinAware {
override val kodein by Kodein.lazy {
import(newAppModule())
import(newAndroidAppModule(this@MainApplication))
import(newAndroidAppDummyConfigModule())
import(newAppUiModule())
import(newAndroidAppUiModule(this@MainApplication))
import(newAndroidAppConfigModule(this@MainApplication), allowOverride = true)
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.blokada" android:sharedUserId="org.blokada"
xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="org.blokada.dev.update"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_update" />
</provider>
</application>
</manifest>
@@ -0,0 +1,3 @@
<resources>
<string name="branding_app_name">Blokada Dev</string>
</resources>
@@ -0,0 +1,29 @@
package org.blokada.app.android
import android.content.Context
import org.blokada.framework.IPersistence
import org.blokada.ui.app.android.DASH_ID_FIREBASE
/**
* We need this persistence because of a reason described below. Note that keys used here has to be
* in sync with ADashesPersistence.
*
* When dashes list is modified, it causes an immediate save to persistence. This would overwrite
* the active state of FirebaseDash (ie it would always be inactive), hence we need to manually
* read its persisted state before adding it to the dashes list.
*/
class AFirebaseDashPersistence(
val ctx: Context
) : IPersistence<Boolean> {
val p by lazy { ctx.getSharedPreferences("State", Context.MODE_PRIVATE) }
override fun read(current: Boolean): Boolean {
return p.getStringSet("dashes-active", setOf()).contains(DASH_ID_FIREBASE)
}
override fun write(source: Boolean) {
// This persistence is not used for writing.
}
}
@@ -0,0 +1,71 @@
package org.blokada.app.android
import android.os.Bundle
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.crash.FirebaseCrash
import org.blokada.app.Events
import org.blokada.framework.IJournal
/**
* Deps here need to be lazy to avoid dependency loop from KContext -> IJournal
*/
class AFirebaseJournal(
private val firebase: () -> FirebaseAnalytics,
private val fState: FirebaseState
) : IJournal {
private var userId: String? = null
private val userProperties = mutableMapOf<String, String>()
init {
fState.enabled.doWhen { fState.enabled(true) }.then {
if (userId != null) firebase().setUserId(userId)
userProperties.forEach { k, v -> firebase().setUserProperty(k, v) }
}
}
override fun setUserId(id: String) {
if (fState.enabled()) firebase().setUserId(id)
else userId = id
}
override fun setUserProperty(key: String, value: Any) {
if (fState.enabled()) firebase().setUserProperty(key, value.toString())
else userProperties.put(key, value.toString())
}
override fun event(vararg events: Any) {
if (fState.enabled(false)) return
events.forEach { event ->
when(event) {
is Events.EventInt -> {
val params = Bundle()
params.putLong(FirebaseAnalytics.Param.QUANTITY, event.value.toLong())
firebase().logEvent(event.toString(), params)
}
is Events.AdBlocked -> {
val params = Bundle()
params.putString(FirebaseAnalytics.Param.ITEM_NAME, event.host)
firebase().logEvent(event.name, params)
}
else -> firebase().logEvent(event.toString(), null)
}
}
}
override fun log(vararg errors: Any) {
if (fState.enabled(false)) return
errors.forEach { error ->
when (error) {
is Exception -> {
FirebaseCrash.report(error)
}
else -> {
FirebaseCrash.log(error.toString())
}
}
}
}
}
Oops, something went wrong.

0 comments on commit 69fed96

Please sign in to comment.