Advertisement
Guest User

Untitled

a guest
Apr 12th, 2018
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.96 KB | None | 0 0
  1. apply plugin: 'com.android.library'
  2.  
  3. def safeExtGet(prop, fallback) {
  4. rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  5. }
  6.  
  7. android {
  8. compileSdkVersion safeExtGet('compileSdkVersion', 23)
  9. buildToolsVersion safeExtGet('buildToolsVersion', '26.0.2')
  10.  
  11. defaultConfig {
  12. // Do NOT change these values here, set them in your android/app/build.gradle instead
  13. manifestPlaceholders = [onesignal_app_id: '', onesignal_google_project_number: 'REMOTE']
  14. minSdkVersion safeExtGet('minSdkVersion', 16)
  15. }
  16. buildTypes {
  17. release {
  18. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  19. }
  20. }
  21. }
  22.  
  23. dependencies {
  24. compile fileTree(include: ['*.jar'], dir: 'libs')
  25. compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
  26.  
  27. compile('com.onesignal:OneSignal:3.8.3') {
  28. // Exclude com.android.support(Android Support library) as the version range starts at 26.0.0
  29. // This is due to compileSdkVersion defaulting to 23 which cant' be lower than the support library version
  30. // And the fact that the default root project is missing the Google Maven repo required to pull down 26.0.0+
  31. exclude group: 'com.android.support'
  32. // Keeping com.google.android.gms(Google Play services library) as this version range starts at 10.2.1
  33. }
  34.  
  35. testCompile 'junit:junit:4.12'
  36. }
  37.  
  38. buildscript {
  39. repositories {
  40. maven { url 'https://maven.fabric.io/public' }
  41. }
  42.  
  43. dependencies {
  44. classpath 'io.fabric.tools:gradle:1.+'
  45. }
  46. }
  47. apply plugin: 'com.android.application'
  48. apply plugin: 'io.fabric'
  49.  
  50. repositories {
  51. maven { url 'https://maven.fabric.io/public' }
  52. }
  53.  
  54. android {
  55. flavorDimensions "default"
  56. compileSdkVersion 26
  57. buildToolsVersion '26.0.2'
  58.  
  59. defaultConfig {
  60. applicationId 'com.ferrometal'
  61. targetSdkVersion 25
  62. versionCode 1
  63. versionName '1.0.0'
  64. ndk {
  65. abiFilters 'armeabi-v7a', 'x86'
  66. }
  67. multiDexEnabled true
  68. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  69. // Deprecated. Used by net.openid:appauth
  70. manifestPlaceholders = [
  71. 'appAuthRedirectScheme': 'host.exp.exponent'
  72. ]
  73. }
  74. dexOptions {
  75. javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
  76. }
  77. productFlavors {
  78. // Define separate dev and prod product flavors.
  79. dev {
  80. // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
  81. // to pre-dex each module and produce an APK that can be tested on
  82. // Android Lollipop without time consuming dex merging processes.
  83. minSdkVersion 21
  84. }
  85. devRemoteKernel {
  86. minSdkVersion 21
  87. }
  88. dev19 {
  89. // For debugging / development on older SDK versions. Increases build
  90. // time so use 'dev' if not running on older SDKs.
  91. minSdkVersion 19
  92. }
  93. prod {
  94. // The actual minSdkVersion for the application.
  95. minSdkVersion 19
  96. }
  97. }
  98. buildTypes {
  99. debug {
  100. debuggable true
  101. }
  102. release {
  103. minifyEnabled true
  104. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  105. zipAlignEnabled true
  106. }
  107. }
  108. signingConfigs {
  109. debug {
  110. storeFile file('../debug.keystore')
  111. }
  112. }
  113. lintOptions {
  114. abortOnError false
  115. }
  116. packagingOptions {
  117. pickFirst "**"
  118. }
  119. }
  120.  
  121. // Don't use modern jsc-android since it still has some critical bugs that
  122. // crash applications when the string for the JS bundle is loaded and when
  123. // locale-specific date functions are called.
  124. // configurations.all {
  125. // resolutionStrategy {
  126. // force 'org.webkit:android-jsc:r216113'
  127. // }
  128. // }
  129.  
  130.  
  131. task exponentPrebuildStep(type: Exec) {
  132. workingDir '../'
  133. if (System.getProperty('os.name').toLowerCase().contains('windows')) {
  134. commandLine 'cmd', '/c', '.\detach-scripts\prepare-detached-build.bat'
  135. } else {
  136. commandLine './detach-scripts/prepare-detached-build.sh'
  137. }
  138. }
  139. preBuild.dependsOn exponentPrebuildStep
  140.  
  141.  
  142. dependencies {
  143. compile project(':react-native-onesignal')
  144. compile fileTree(dir: 'libs', include: ['*.jar'])
  145.  
  146. compile 'com.android.support:multidex:1.0.1'
  147.  
  148. // Our dependencies
  149. compile 'com.android.support:appcompat-v7:26.0.2'
  150.  
  151. // Our dependencies from ExpoView
  152. // DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
  153. compile 'com.android.support:appcompat-v7:26.0.1'
  154. compile 'com.facebook.android:facebook-android-sdk:4.7.0'
  155. compile('com.facebook.android:audience-network-sdk:4.22.1') {
  156. exclude module: 'play-services-ads'
  157. }
  158. provided 'org.glassfish:javax.annotation:3.1.1'
  159. annotationProcessor 'com.jakewharton:butterknife:7.0.1'
  160. compile 'de.greenrobot:eventbus:2.4.0'
  161. compile 'com.amplitude:android-sdk:2.9.2' // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
  162. compile 'com.squareup.picasso:picasso:2.5.2'
  163. compile 'com.google.android.gms:play-services-gcm:9.8.0'
  164. compile 'com.google.android.gms:play-services-analytics:9.8.0'
  165. compile 'com.google.android.gms:play-services-maps:9.8.0'
  166. compile 'com.google.android.gms:play-services-auth:9.8.0'
  167. compile 'com.google.android.gms:play-services-location:9.8.0'
  168. compile 'com.google.android.gms:play-services-ads:9.8.0'
  169.  
  170. compile "com.raizlabs.android:DBFlow-Core:2.2.1"
  171. compile "com.raizlabs.android:DBFlow:2.2.1"
  172. compile "com.madgag.spongycastle:core:1.53.0.0"
  173. compile "com.madgag.spongycastle:prov:1.53.0.0"
  174. debugCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  175. // debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
  176. releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  177. compile 'com.facebook.device.yearclass:yearclass:1.0.1'
  178. compile 'commons-io:commons-io:1.3.2'
  179. compile 'me.leolin:ShortcutBadger:1.1.4@aar'
  180. compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
  181. compile 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
  182. compile 'com.yqritc:android-scalablevideoview:1.0.1'
  183. compile 'commons-codec:commons-codec:1.10'
  184. compile 'com.segment.analytics.android:analytics:4.3.0'
  185. compile 'com.google.zxing:core:3.2.1'
  186. compile 'net.openid:appauth:0.4.1'
  187. compile 'com.airbnb.android:lottie:2.2.0'
  188. compile 'io.branch.sdk.android:library:2.6.1'
  189. compile('io.nlopez.smartlocation:library:3.2.11') {
  190. transitive = false
  191. }
  192. compile 'com.android.support:exifinterface:26.0.1'
  193. compile 'com.squareup.okhttp3:okhttp:3.4.1'
  194. compile 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
  195. compile 'com.squareup.okhttp3:okhttp-ws:3.4.1'
  196. compile 'com.squareup.okio:okio:1.9.0'
  197.  
  198. // Testing
  199. androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
  200. // We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
  201. androidTestCompile 'com.android.support.test:runner:1.0.1'
  202. androidTestCompile 'com.android.support:support-annotations:26.0.1'
  203. androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0'
  204. androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
  205. androidTestCompile 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
  206.  
  207.  
  208.  
  209. compile('host.exp.exponent:expoview:26.0.0@aar') {
  210. transitive = true
  211. }
  212.  
  213.  
  214. }
  215.  
  216. // This has to be down here for some reason
  217. apply plugin: 'com.google.gms.google-services'
  218.  
  219. <?xml version="1.0" encoding="utf-8"?>
  220. <manifest
  221. package="host.exp.exponent"
  222. xmlns:android="http://schemas.android.com/apk/res/android"
  223. xmlns:tools="http://schemas.android.com/tools">
  224.  
  225. <permission
  226. android:name="com.ferrometal.permission.C2D_MESSAGE"
  227. android:protectionLevel="signature"/>
  228.  
  229. <!-- These are required permissions to make the app run -->
  230. <uses-permission android:name="com.ferrometal.permission.C2D_MESSAGE" />
  231. <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
  232. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  233. <uses-permission android:name="android.permission.INTERNET" />
  234. <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
  235. <uses-permission android:name="android.permission.WAKE_LOCK" />
  236.  
  237. <!-- ADD PERMISSIONS HERE -->
  238. <!-- BEGIN OPTIONAL PERMISSIONS -->
  239. <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
  240. <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  241. <uses-permission android:name="android.permission.USE_FINGERPRINT" />
  242. <uses-permission android:name="android.permission.VIBRATE" />
  243. <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
  244.  
  245. <!-- These require runtime permissions on M -->
  246. <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  247. <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  248. <uses-permission android:name="android.permission.CAMERA" />
  249. <uses-permission android:name="android.permission.READ_CONTACTS" />
  250. <uses-permission android:name="android.permission.READ_CALENDAR" />
  251. <uses-permission android:name="android.permission.WRITE_CALENDAR" />
  252. <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  253. <uses-permission android:name="android.permission.RECORD_AUDIO" />
  254. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  255. <uses-permission android:name="android.permission.WRITE_SETTINGS" />
  256. <!-- END OPTIONAL PERMISSIONS -->
  257.  
  258. <!-- ADD TEST PERMISSIONS HERE -->
  259.  
  260. <uses-feature android:glEsVersion="0x00020000" android:required="false" />
  261.  
  262. <application
  263. android:name=".MainApplication"
  264. android:allowBackup="true"
  265. android:icon="@mipmap/ic_launcher"
  266. android:label="@string/app_name"
  267. android:largeHeap="true">
  268.  
  269. <activity
  270. android:name=".LauncherActivity"
  271. android:exported="true"
  272. android:launchMode="singleTop"
  273. android:screenOrientation="portrait"
  274. android:theme="@android:style/Theme.Translucent.NoTitleBar">
  275. <intent-filter>
  276. <data android:scheme="expac59f8b2959f4de3afc2b84696f00c3d"/>
  277.  
  278. <action android:name="android.intent.action.VIEW"/>
  279.  
  280. <category android:name="android.intent.category.DEFAULT"/>
  281. <category android:name="android.intent.category.BROWSABLE"/>
  282. </intent-filter>
  283. </activity>
  284.  
  285. <activity
  286. android:name=".experience.ExperienceActivity"
  287. android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
  288. android:theme="@style/Theme.Exponent.Light"
  289. android:windowSoftInputMode="adjustResize">
  290. </activity>
  291.  
  292. <activity
  293. android:name=".MainActivity"
  294. android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
  295. android:theme="@style/Theme.Exponent.Splash"
  296. android:windowSoftInputMode="adjustResize">
  297. <intent-filter>
  298. <action android:name="android.intent.action.MAIN"/>
  299.  
  300. <category android:name="android.intent.category.LAUNCHER"/>
  301. </intent-filter>
  302. </activity>
  303.  
  304. <activity
  305. android:name=".experience.ShellAppActivity"
  306. android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
  307. android:theme="@style/Theme.Exponent.Splash"
  308. android:windowSoftInputMode="adjustResize">
  309. <!-- ADD SHELL INTENT FILTERS HERE -->
  310. </activity>
  311.  
  312. <activity
  313. android:name=".experience.HomeActivity"
  314. android:label="@string/app_name"
  315. android:launchMode="singleTask"
  316. android:screenOrientation="portrait"
  317. android:theme="@style/Theme.Exponent.Light">
  318. </activity>
  319.  
  320. <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
  321. <!-- ADD DEV SETTINGS HERE -->
  322. <activity android:name="abi26_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
  323. <activity android:name="abi25_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
  324. <activity android:name="abi24_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
  325. <activity android:name="abi23_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
  326. <activity android:name="abi22_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
  327. <activity android:name="abi21_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
  328. <activity android:name="abi20_0_0.com.facebook.react.devsupport.DevSettingsActivity"/>
  329.  
  330. <activity
  331. android:name=".ExponentDevActivity"
  332. android:exported="true"
  333. android:label="@string/dev_activity_name"
  334. android:screenOrientation="portrait"
  335. android:theme="@style/Theme.Exponent.Dark"
  336. android:windowSoftInputMode="adjustPan">
  337. </activity>
  338.  
  339. <activity
  340. android:name=".oauth.OAuthWebViewActivity"
  341. android:screenOrientation="portrait"
  342. android:theme="@style/Theme.Exponent.Light">
  343. </activity>
  344.  
  345. <activity
  346. android:name="net.openid.appauth.RedirectUriReceiverActivity"
  347. tools:node="replace">
  348. <intent-filter>
  349. <action android:name="android.intent.action.VIEW"/>
  350. <category android:name="android.intent.category.DEFAULT"/>
  351. <category android:name="android.intent.category.BROWSABLE"/>
  352. <data android:scheme="com.ferrometal" android:path="oauthredirect"/>
  353. </intent-filter>
  354. </activity>
  355.  
  356. <activity
  357. android:name=".oauth.OAuthResultActivity">
  358. </activity>
  359.  
  360. <activity
  361. android:name=".chrometabs.ChromeTabsManagerActivity">
  362. </activity>
  363.  
  364. <activity
  365. android:name=".experience.ErrorActivity"
  366. android:theme="@style/Theme.Exponent.Dark"
  367. android:screenOrientation="portrait">
  368. </activity>
  369.  
  370. <activity
  371. android:name=".experience.InfoActivity"
  372. android:screenOrientation="portrait"
  373. android:theme="@style/Theme.Exponent.Light">
  374. </activity>
  375.  
  376. <activity
  377. android:name="com.facebook.FacebookActivity"
  378. android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
  379. android:label="@string/app_name"
  380. android:theme="@android:style/Theme.Translucent.NoTitleBar"
  381. tools:replace="android:theme" />
  382.  
  383. <activity
  384. android:name="com.facebook.ads.InterstitialAdActivity"
  385. android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
  386. android:label="@string/app_name"
  387. android:theme="@android:style/Theme.Translucent.NoTitleBar" />
  388.  
  389. <service
  390. android:name=".ExponentIntentService"
  391. android:exported="false" />
  392.  
  393. <!-- Analytics -->
  394. <receiver
  395. android:name="host.exp.exponent.referrer.InstallReferrerReceiver"
  396. android:exported="true">
  397. <intent-filter>
  398. <action android:name="com.android.vending.INSTALL_REFERRER" />
  399. </intent-filter>
  400. </receiver>
  401.  
  402. <!--
  403. This crashes: https://code.google.com/p/analytics-issues/issues/detail?id=667
  404. TODO: turn it back on when it's fixed
  405. <service
  406. android:name="com.google.android.gms.analytics.CampaignTrackingService"
  407. android:enabled="true"
  408. android:exported="false" />-->
  409.  
  410. <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
  411. android:enabled="true">
  412. <intent-filter>
  413. <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
  414. </intent-filter>
  415. </receiver>
  416.  
  417. <service android:name="com.google.android.gms.analytics.AnalyticsService"
  418. android:enabled="true"
  419. android:exported="false"/>
  420.  
  421. <!-- GCM -->
  422. <receiver
  423. android:name="com.google.android.gms.gcm.GcmReceiver"
  424. android:exported="true"
  425. android:permission="com.google.android.c2dm.permission.SEND">
  426. <intent-filter>
  427. <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
  428. <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
  429.  
  430. <category android:name="com.ferrometal"/>
  431. </intent-filter>
  432. </receiver>
  433.  
  434. <service
  435. android:name=".gcm.ExponentGcmListenerService"
  436. android:exported="false">
  437. <intent-filter>
  438. <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
  439. </intent-filter>
  440. </service>
  441. <service
  442. android:name=".gcm.ExponentInstanceIDListenerService"
  443. android:exported="false">
  444. <intent-filter>
  445. <action android:name="com.google.android.gms.iid.InstanceID"/>
  446. </intent-filter>
  447. </service>
  448. <service
  449. android:name=".gcm.RegistrationIntentService"
  450. android:exported="false">
  451. </service>
  452.  
  453. <!-- ImagePicker native module -->
  454. <activity
  455. android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
  456. android:theme="@style/Base.Theme.AppCompat">
  457. </activity>
  458.  
  459.  
  460. <!-- ADD FABRIC CONFIG HERE -->
  461. <!-- BEGIN FABRIC CONFIG -->
  462. <meta-data
  463. android:name="io.fabric.ApiKey"
  464. android:value="a25fafe9f9edee11a9882b32e0cd7a26df6e2c42"/>
  465. <!-- END FABRIC CONFIG -->
  466.  
  467. <!-- ADD GOOGLE MAPS CONFIG HERE -->
  468. <!-- BEGIN GOOGLE MAPS CONFIG -->
  469. <meta-data
  470. android:name="com.google.android.geo.API_KEY"
  471. android:value="AIzaSyCPyKmt6in3JwAsogYikNNjor8qgU9stRQ"/>
  472. <!-- END GOOGLE MAPS CONFIG -->
  473.  
  474. <!-- ADD BRANCH CONFIG HERE -->
  475.  
  476. <!-- The Facebook SDK runs FacebookInitProvider on startup and crashes if there isn't an ID here -->
  477. <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb0"/>
  478. </application>
  479.  
  480. </manifest>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement