Pārlūkot izejas kodu

what have I done?

dev
jfinn 5 gadus atpakaļ
vecāks
revīzija
b57cf0e2dd
100 mainītis faili ar 3582 papildinājumiem un 0 dzēšanām
  1. 6
    0
      .buckconfig
  2. 13
    0
      .editorconfig
  3. 12
    0
      .eslintignore
  4. 5
    0
      .eslintrc.js
  5. 118
    0
      .flowconfig
  6. 3
    0
      .gitattributes
  7. 28
    0
      .github/ISSUE_TEMPLATE/1-bug-report.md
  8. 10
    0
      .github/ISSUE_TEMPLATE/2-help.md
  9. 23
    0
      .github/ISSUE_TEMPLATE/3-feature-request.md
  10. 11
    0
      .github/ISSUE_TEMPLATE/4-security-issues.md
  11. 16
    0
      .github/stale.yml
  12. 16
    0
      .github/workflows/ci.yml
  13. 86
    0
      .gitignore
  14. 6
    0
      .travis.yml
  15. 1
    0
      .watchmanconfig
  16. 29
    0
      CONTRIBUTING.md
  17. 11
    0
      ConferenceEvents.js
  18. 219
    0
      LICENSE
  19. 90
    0
      Makefile
  20. 86
    0
      README.md
  21. 163
    0
      analytics-ga.js
  22. 380
    0
      android/README.md
  23. 6
    0
      android/app/.classpath
  24. 23
    0
      android/app/.project
  25. 2
    0
      android/app/.settings/org.eclipse.buildship.core.prefs
  26. 179
    0
      android/app/build.gradle
  27. 6
    0
      android/app/proguard-rules-release.pro
  28. 92
    0
      android/app/proguard-rules.pro
  29. 39
    0
      android/app/src/main/AndroidManifest.xml
  30. 40
    0
      android/app/src/main/java/org/jitsi/meet/GoogleServicesHelper.java
  31. 150
    0
      android/app/src/main/java/org/jitsi/meet/MainActivity.java
  32. Binārs
      android/app/src/main/res/drawable-hdpi/ic_notification.png
  33. Binārs
      android/app/src/main/res/drawable-mdpi/ic_notification.png
  34. Binārs
      android/app/src/main/res/drawable-xhdpi/ic_notification.png
  35. Binārs
      android/app/src/main/res/drawable-xxhdpi/ic_notification.png
  36. Binārs
      android/app/src/main/res/drawable-xxxhdpi/ic_notification.png
  37. 5
    0
      android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  38. 5
    0
      android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  39. Binārs
      android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  40. Binārs
      android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
  41. Binārs
      android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  42. Binārs
      android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  43. Binārs
      android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
  44. Binārs
      android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  45. Binārs
      android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  46. Binārs
      android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
  47. Binārs
      android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  48. Binārs
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  49. Binārs
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
  50. Binārs
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  51. Binārs
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  52. Binārs
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  53. Binārs
      android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  54. 4
    0
      android/app/src/main/res/values/ic_launcher_background.xml
  55. 3
    0
      android/app/src/main/res/values/strings.xml
  56. 7
    0
      android/app/src/main/res/values/styles.xml
  57. 6
    0
      android/app/src/main/res/xml/network_security_config.xml
  58. 179
    0
      android/build.gradle
  59. 2
    0
      android/fastlane/Appfile
  60. 34
    0
      android/fastlane/Fastfile
  61. 29
    0
      android/fastlane/README.md
  62. Binārs
      android/fastlane/screenshots/Feature-Graphic-1024x500-1-1.png
  63. Binārs
      android/fastlane/screenshots/Feature-Graphic-1024x500-1.png
  64. Binārs
      android/fastlane/screenshots/Feature-Graphic-1024x500-2.png
  65. Binārs
      android/fastlane/screenshots/Feature-Graphic-1024x500-3.png
  66. Binārs
      android/fastlane/screenshots/GroupCall.png
  67. Binārs
      android/fastlane/screenshots/GroupCall_framed.png
  68. Binārs
      android/fastlane/screenshots/More Menu.png
  69. Binārs
      android/fastlane/screenshots/More Menu_framed.png
  70. Binārs
      android/fastlane/screenshots/Nexus 9 Body.png
  71. Binārs
      android/fastlane/screenshots/Nexus-9-Landscape.png
  72. Binārs
      android/fastlane/screenshots/Nexus-9-Portrait.png
  73. Binārs
      android/fastlane/screenshots/Video-Call-1-1024x768.png
  74. Binārs
      android/fastlane/screenshots/Video-Call-1-1280x720.png
  75. Binārs
      android/fastlane/screenshots/Video-Call-2-1024x768.png
  76. Binārs
      android/fastlane/screenshots/Video-Call-2-1280x720.png
  77. Binārs
      android/fastlane/screenshots/WelcomePage-Calendar.png
  78. Binārs
      android/fastlane/screenshots/WelcomePage-Calendar_framed.png
  79. Binārs
      android/fastlane/screenshots/WelcomeScreen-1024x768.png
  80. Binārs
      android/fastlane/screenshots/WelcomeScreen-1280x720.png
  81. 24
    0
      android/gradle.properties
  82. Binārs
      android/gradle/wrapper/gradle-wrapper.jar
  83. 6
    0
      android/gradle/wrapper/gradle-wrapper.properties
  84. 172
    0
      android/gradlew
  85. 84
    0
      android/gradlew.bat
  86. 8
    0
      android/keystores/BUCK
  87. 4
    0
      android/keystores/debug.keystore.properties
  88. 111
    0
      android/scripts/release-sdk.sh
  89. 26
    0
      android/scripts/run-packager.sh
  90. 6
    0
      android/sdk/.classpath
  91. 23
    0
      android/sdk/.project
  92. 2
    0
      android/sdk/.settings/org.eclipse.buildship.core.prefs
  93. 250
    0
      android/sdk/build.gradle
  94. 52
    0
      android/sdk/src/main/AndroidManifest.xml
  95. 114
    0
      android/sdk/src/main/java/org/jitsi/meet/sdk/AmplitudeModule.java
  96. 56
    0
      android/sdk/src/main/java/org/jitsi/meet/sdk/AndroidSettingsModule.java
  97. 87
    0
      android/sdk/src/main/java/org/jitsi/meet/sdk/AppInfoModule.java
  98. 183
    0
      android/sdk/src/main/java/org/jitsi/meet/sdk/AudioDeviceHandlerConnectionService.java
  99. 231
    0
      android/sdk/src/main/java/org/jitsi/meet/sdk/AudioDeviceHandlerGeneric.java
  100. 0
    0
      android/sdk/src/main/java/org/jitsi/meet/sdk/AudioDeviceHandlerLegacy.java

+ 6
- 0
.buckconfig Parādīt failu

@@ -0,0 +1,6 @@
1
+
2
+[android]
3
+  target = Google Inc.:Google APIs:23
4
+
5
+[maven_repositories]
6
+  central = https://repo1.maven.org/maven2

+ 13
- 0
.editorconfig Parādīt failu

@@ -0,0 +1,13 @@
1
+# http://editorconfig.org
2
+root = true
3
+
4
+[*]
5
+charset = utf-8
6
+end_of_line = lf
7
+indent_size = 4
8
+indent_style = space
9
+max_line_length = 80
10
+trim_trailing_whitespace = true
11
+
12
+[Makefile]
13
+indent_style = tab

+ 12
- 0
.eslintignore Parādīt failu

@@ -0,0 +1,12 @@
1
+# The build artifacts of the jitsi-meet project.
2
+build/*
3
+
4
+# Third-party source code which we (1) do not want to modify or (2) try to
5
+# modify as little as possible.
6
+flow-typed/*
7
+libs/*
8
+
9
+# ESLint will by default ignore its own configuration file. However, there does
10
+# not seem to be a reason why we will want to risk being inconsistent with our
11
+# remaining JavaScript source code.
12
+!.eslintrc.js

+ 5
- 0
.eslintrc.js Parādīt failu

@@ -0,0 +1,5 @@
1
+module.exports = {
2
+    'extends': [
3
+        'eslint-config-jitsi'
4
+    ]
5
+};

+ 118
- 0
.flowconfig Parādīt failu

@@ -0,0 +1,118 @@
1
+[ignore]
2
+; We fork some components by platform
3
+.*/*[.]android.js
4
+
5
+; Ignore unexpected extra "@providesModule"
6
+.*/node_modules/.*/node_modules/fbjs/.*
7
+node_modules/react-native/Libraries/react-native/React.js
8
+
9
+; Ignore duplicate module providers
10
+; For RN Apps installed via npm, "Libraries" folder is inside
11
+; "node_modules/react-native" but in the source repo it is in the root
12
+node_modules/react-native/Libraries/react-native/React.js
13
+
14
+; Flow doesn't support platforms
15
+.*/Libraries/Utilities/LoadingView.js
16
+
17
+; Ignore polyfills
18
+node_modules/react-native/Libraries/polyfills/.*
19
+
20
+; These should not be required directly
21
+; require from fbjs/lib instead: require('fbjs/lib/warning')
22
+node_modules/warning/.*
23
+
24
+; Flow doesn't support platforms
25
+.*/Libraries/Utilities/HMRLoadingView.js
26
+
27
+[untyped]
28
+.*/node_modules/@react-native-community/cli/.*/.*
29
+
30
+; Ignore packages in node_modules which we (i.e. the jitsi-meet project) have
31
+; seen to cause errors and we have chosen not to fix.
32
+.*/node_modules/@atlaskit/.*/*.js.flow
33
+.*/node_modules/react-native-keep-awake/.*
34
+.*/node_modules/react-native-permissions/.*
35
+.*/node_modules/styled-components/.*
36
+
37
+.*/\.git/.*
38
+
39
+[include]
40
+
41
+[libs]
42
+node_modules/react-native/Libraries/react-native/react-native-interface.js
43
+node_modules/react-native/flow/
44
+
45
+[options]
46
+emoji=true
47
+
48
+esproposal.optional_chaining=enable
49
+esproposal.nullish_coalescing=enable
50
+
51
+; We (i.e. the jitsi-meet project) are using the haste module system on Web as
52
+; well, not only on React Native. Unfortunately, Flow does not support .web.js
53
+; by default. Override Flow's defaults to include .web.js as well. Technically,
54
+; we have .native.js as well so the choice of .web.js may lead to errors.
55
+; Practically though, it is a potential future problem that we do not have at
56
+; the time of this writing.
57
+module.file_ext=.web.js
58
+; Flow's defaults:
59
+module.file_ext=.js
60
+module.file_ext=.json
61
+module.file_ext=.ios.js
62
+
63
+module.system=haste
64
+module.system.haste.use_name_reducers=true
65
+# get basename
66
+module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
67
+# strip .js or .js.flow suffix
68
+module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
69
+# strip .ios suffix
70
+module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
71
+module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
72
+module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
73
+module.system.haste.paths.blacklist=.*/__tests__/.*
74
+module.system.haste.paths.blacklist=.*/__mocks__/.*
75
+module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
76
+module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
77
+module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
78
+module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
79
+module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
80
+
81
+munge_underscores=true
82
+
83
+module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
84
+
85
+suppress_type=$FlowIssue
86
+suppress_type=$FlowFixMe
87
+suppress_type=$FlowFixMeProps
88
+suppress_type=$FlowFixMeState
89
+
90
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
91
+suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
92
+
93
+suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
94
+
95
+[lints]
96
+sketchy-null-number=warn
97
+sketchy-null-mixed=warn
98
+sketchy-number=warn
99
+untyped-type-import=warn
100
+nonstrict-import=warn
101
+deprecated-type=warn
102
+unsafe-getters-setters=warn
103
+inexact-spread=warn
104
+unnecessary-invariant=warn
105
+signature-verification-failure=warn
106
+deprecated-utility=error
107
+
108
+[strict]
109
+deprecated-type
110
+nonstrict-import
111
+sketchy-null
112
+unclear-type
113
+unsafe-getters-setters
114
+untyped-import
115
+untyped-type-import
116
+
117
+[version]
118
+^0.104.0

+ 3
- 0
.gitattributes Parādīt failu

@@ -0,0 +1,3 @@
1
+*.bundle.js -text -diff
2
+*.pbxproj -text
3
+lib-jitsi-meet.js -text -diff

+ 28
- 0
.github/ISSUE_TEMPLATE/1-bug-report.md Parādīt failu

@@ -0,0 +1,28 @@
1
+---
2
+name: Bug report
3
+about: Create a report to help us improve
4
+
5
+---
6
+
7
+*This Issue tracker is only for reporting bugs and tracking code related issues.*
8
+
9
+Before posting, please make sure you check community.jitsi.org to see if the same or similar bugs have already been discussed.
10
+General questions, installation help, and feature requests can also be posted to community.jitsi.org.
11
+
12
+## Description
13
+---
14
+
15
+## Current behavior
16
+---
17
+
18
+## Expected Behavior
19
+---
20
+
21
+## Possible Solution
22
+---
23
+
24
+## Steps to reproduce
25
+---
26
+
27
+# Environment details
28
+---

+ 10
- 0
.github/ISSUE_TEMPLATE/2-help.md Parādīt failu

@@ -0,0 +1,10 @@
1
+---
2
+name: Need help with Jitsi Meet?
3
+about: Please ask it in our community at https://community.jitsi.org
4
+
5
+---
6
+
7
+If you have a question about Jitsi Meet that is not a bug report or feature
8
+request, please post it in https://community.jitsi.org
9
+
10
+Questions posted to this repository will be closed.

+ 23
- 0
.github/ISSUE_TEMPLATE/3-feature-request.md Parādīt failu

@@ -0,0 +1,23 @@
1
+---
2
+name: "Feature request"
3
+about: Suggest an idea for this project
4
+
5
+---
6
+
7
+<!--
8
+Thank you for suggesting an idea to make Jitsi Meet better.
9
+
10
+Please fill in as much of the template below as you're able.
11
+
12
+Note that the ultimate decission for implementing features lies on the Jitsi team, not all feature requests shall be accepted.
13
+-->
14
+
15
+**Is your feature request related to a problem you are facing?**
16
+Please describe the problem you are trying to solve.
17
+
18
+**Describe the solution you'd like**
19
+Please describe the desired behavior.
20
+
21
+**Describe alternatives you've considered**
22
+Please describe alternative solutions or features you have considered.
23
+

+ 11
- 0
.github/ISSUE_TEMPLATE/4-security-issues.md Parādīt failu

@@ -0,0 +1,11 @@
1
+---
2
+name: Security issues
3
+about: Please email security@jitsi.org
4
+
5
+---
6
+
7
+We take security very seriously and develop all Jitsi projects to be secure and safe.
8
+
9
+If you find (or simply suspect) a security issue in any of the Jitsi projects, please send us an email to security@jitsi.org.
10
+
11
+We encourage responsible disclosure for the sake of our users, so please reach out before posting in a public space.

+ 16
- 0
.github/stale.yml Parādīt failu

@@ -0,0 +1,16 @@
1
+# Number of days of inactivity before an issue becomes stale
2
+daysUntilStale: 90
3
+# Number of days of inactivity before a stale issue is closed
4
+daysUntilClose: 7
5
+# Issues with these labels will never be considered stale
6
+exemptLabels:
7
+  - confirmed
8
+staleLabel: wontfix
9
+# Comment to post when marking an issue as stale. Set to `false` to disable
10
+markComment: >
11
+  This issue has been automatically marked as stale because it has not had
12
+  recent activity. It will be closed if no further activity occurs. Thank you
13
+  for your contributions.
14
+# Comment to post when closing a stale issue. Set to `false` to disable
15
+closeComment: false
16
+

+ 16
- 0
.github/workflows/ci.yml Parādīt failu

@@ -0,0 +1,16 @@
1
+name: Simple CI
2
+
3
+on: [pull_request]
4
+
5
+jobs:
6
+  run-ci:
7
+    name: Build Frontend
8
+    runs-on: ubuntu-latest
9
+    steps:
10
+    - uses: actions/checkout@v2
11
+    - uses: actions/setup-node@v1
12
+      with:
13
+        node-version: '12.x'
14
+    - run: npm install
15
+    - run: npm run lint
16
+    - run: make

+ 86
- 0
.gitignore Parādīt failu

@@ -0,0 +1,86 @@
1
+*.swp
2
+.*.tmp
3
+deploy-local.sh
4
+libs/
5
+all.css
6
+*css.map
7
+.remote-sync.json
8
+.sync-config.cson
9
+
10
+# CocoaPods
11
+Pods/
12
+
13
+# The following are automatically generated by the react-native command line
14
+# utility (either with the init or upgrade option which pull in the latest
15
+# template files recommended by Facebook for React Native).
16
+
17
+# OSX
18
+#
19
+.DS_Store
20
+
21
+# Xcode
22
+#
23
+build/
24
+*.pbxuser
25
+!default.pbxuser
26
+*.mode1v3
27
+!default.mode1v3
28
+*.mode2v3
29
+!default.mode2v3
30
+*.perspectivev3
31
+!default.perspectivev3
32
+xcuserdata
33
+*.xccheckout
34
+*.moved-aside
35
+DerivedData
36
+*.hmap
37
+*.ipa
38
+*.dSYM.zip
39
+*.xcuserstate
40
+project.xcworkspace
41
+
42
+# Android/IntelliJ
43
+#
44
+build/
45
+.idea
46
+.gradle
47
+local.properties
48
+*.iml
49
+
50
+# node.js
51
+#
52
+node_modules/
53
+npm-debug.log
54
+yarn-error.log
55
+
56
+# BUCK
57
+#
58
+buck-out/
59
+\.buckd/
60
+*.keystore
61
+
62
+# fastlane
63
+#
64
+*/fastlane/report.xml
65
+*/fastlane/Preview.html
66
+
67
+# Build artifacts
68
+*.jsbundle
69
+*.framework
70
+android/app/debug
71
+android/app/release
72
+
73
+# precommit-hook
74
+.jshintignore
75
+.jshintrc
76
+
77
+# VSCode files
78
+android/.project
79
+android/.settings/org.eclipse.buildship.core.prefs
80
+
81
+# Secrets
82
+android/app/dropbox.key
83
+android/app/google-services.json
84
+ios/app/dropbox.key
85
+ios/app/GoogleService-Info.plist
86
+

+ 6
- 0
.travis.yml Parādīt failu

@@ -0,0 +1,6 @@
1
+osx_image: xcode11.1
2
+language: objective-c
3
+script:
4
+- "./ios/travis-ci/build-ipa.sh"
5
+after_script:
6
+  - sleep 10

+ 1
- 0
.watchmanconfig Parādīt failu

@@ -0,0 +1 @@
1
+{}

+ 29
- 0
CONTRIBUTING.md Parādīt failu

@@ -0,0 +1,29 @@
1
+# How to contribute
2
+We would love to have your help. Before you start working however, please read
3
+and follow this short guide.
4
+
5
+# Reporting Issues
6
+Provide as much information as possible. Mention the version of Jitsi Meet, 
7
+Jicofo and JVB you are using, and explain (as detailed as you can) how the 
8
+problem can be reproduced.
9
+
10
+# Code contributions
11
+Found a bug and know how to fix it? Great! Please read on.
12
+
13
+## Contributor License Agreement
14
+While the Jitsi projects are released under the
15
+[Apache License 2.0](https://github.com/jitsi/jitsi-meet/blob/master/LICENSE), the copyright
16
+holder and principal creator is [8x8](https://www.8x8.com/). To
17
+ensure that we can continue making these projects available under an Open Source license,
18
+we need you to sign our Apache-based contributor
19
+license agreement as either a [corporation](https://jitsi.org/ccla) or an
20
+[individual](https://jitsi.org/icla). If you cannot accept the terms laid out
21
+in the agreement, unfortunately, we cannot accept your contribution.
22
+
23
+## Creating Pull Requests
24
+- Make sure your code passes the linter rules beforehand. The linter is executed
25
+  automatically when committing code.
26
+- Perform **one** logical change per pull request.
27
+- Maintain a clean list of commits, squash them if necessary.
28
+- Rebase your topic branch on top of the master branch before creating the pull
29
+ request.

+ 11
- 0
ConferenceEvents.js Parādīt failu

@@ -0,0 +1,11 @@
1
+/**
2
+ * Notifies interested parties that hangup procedure will start.
3
+ */
4
+export const BEFORE_HANGUP = 'conference.before_hangup';
5
+
6
+/**
7
+ * Notifies interested parties that desktop sharing enable/disable state is
8
+ * changed.
9
+ */
10
+export const DESKTOP_SHARING_ENABLED_CHANGED
11
+    = 'conference.desktop_sharing_enabled_changed';

+ 219
- 0
LICENSE Parādīt failu

@@ -0,0 +1,219 @@
1
+                                 Apache License
2
+                           Version 2.0, January 2004
3
+                        http://www.apache.org/licenses/
4
+
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+
177
+   END OF TERMS AND CONDITIONS
178
+
179
+   APPENDIX: How to apply the Apache License to your work.
180
+
181
+      To apply the Apache License to your work, attach the following
182
+      boilerplate notice, with the fields enclosed by brackets "[]"
183
+      replaced with your own identifying information. (Don't include
184
+      the brackets!)  The text should be enclosed in the appropriate
185
+      comment syntax for the file format. We also recommend that a
186
+      file or class name and description of purpose be included on the
187
+      same "printed page" as the copyright notice for easier
188
+      identification within third-party archives.
189
+
190
+   Copyright [yyyy] [name of copyright owner]
191
+
192
+   Licensed under the Apache License, Version 2.0 (the "License");
193
+   you may not use this file except in compliance with the License.
194
+   You may obtain a copy of the License at
195
+
196
+       http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+   Unless required by applicable law or agreed to in writing, software
199
+   distributed under the License is distributed on an "AS IS" BASIS,
200
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+   See the License for the specific language governing permissions and
202
+   limitations under the License.
203
+   
204
+   
205
+
206
+Note:
207
+
208
+This project was originally contributed to the community under the MIT license and with the following notice:
209
+
210
+The MIT License (MIT)
211
+
212
+Copyright (c) 2013 ESTOS GmbH 
213
+Copyright (c) 2013 BlueJimp SARL
214
+
215
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
216
+
217
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
218
+
219
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 90
- 0
Makefile Parādīt failu

@@ -0,0 +1,90 @@
1
+BUILD_DIR = build
2
+CLEANCSS = ./node_modules/.bin/cleancss
3
+DEPLOY_DIR = libs
4
+LIBJITSIMEET_DIR = node_modules/lib-jitsi-meet/
5
+LIBFLAC_DIR = node_modules/libflacjs/dist/min/
6
+RNNOISE_WASM_DIR = node_modules/rnnoise-wasm/dist/
7
+NODE_SASS = ./node_modules/.bin/node-sass
8
+NPM = npm
9
+OUTPUT_DIR = .
10
+STYLES_BUNDLE = css/all.bundle.css
11
+STYLES_DESTINATION = css/all.css
12
+STYLES_MAIN = css/main.scss
13
+WEBPACK = ./node_modules/.bin/webpack
14
+WEBPACK_DEV_SERVER = ./node_modules/.bin/webpack-dev-server
15
+
16
+all: compile deploy clean
17
+
18
+compile:
19
+	$(WEBPACK) -p
20
+
21
+clean:
22
+	rm -fr $(BUILD_DIR)
23
+
24
+deploy: deploy-init deploy-appbundle deploy-rnnoise-binary deploy-lib-jitsi-meet deploy-libflac deploy-css deploy-local
25
+
26
+deploy-init:
27
+	rm -fr $(DEPLOY_DIR)
28
+	mkdir -p $(DEPLOY_DIR)
29
+
30
+deploy-appbundle:
31
+	cp \
32
+		$(BUILD_DIR)/app.bundle.min.js \
33
+		$(BUILD_DIR)/app.bundle.min.map \
34
+		$(BUILD_DIR)/do_external_connect.min.js \
35
+		$(BUILD_DIR)/do_external_connect.min.map \
36
+		$(BUILD_DIR)/external_api.min.js \
37
+		$(BUILD_DIR)/external_api.min.map \
38
+		$(BUILD_DIR)/flacEncodeWorker.min.js \
39
+		$(BUILD_DIR)/flacEncodeWorker.min.map \
40
+		$(BUILD_DIR)/device_selection_popup_bundle.min.js \
41
+		$(BUILD_DIR)/device_selection_popup_bundle.min.map \
42
+		$(BUILD_DIR)/dial_in_info_bundle.min.js \
43
+		$(BUILD_DIR)/dial_in_info_bundle.min.map \
44
+		$(BUILD_DIR)/alwaysontop.min.js \
45
+		$(BUILD_DIR)/alwaysontop.min.map \
46
+		$(OUTPUT_DIR)/analytics-ga.js \
47
+		$(BUILD_DIR)/analytics-ga.min.js \
48
+		$(BUILD_DIR)/analytics-ga.min.map \
49
+		$(BUILD_DIR)/video-blur-effect.min.js \
50
+		$(BUILD_DIR)/video-blur-effect.min.map \
51
+		$(BUILD_DIR)/rnnoise-processor.min.js \
52
+		$(BUILD_DIR)/rnnoise-processor.min.map \
53
+		$(DEPLOY_DIR)
54
+
55
+deploy-lib-jitsi-meet:
56
+	cp \
57
+		$(LIBJITSIMEET_DIR)/lib-jitsi-meet.min.js \
58
+		$(LIBJITSIMEET_DIR)/lib-jitsi-meet.min.map \
59
+		$(LIBJITSIMEET_DIR)/connection_optimization/external_connect.js \
60
+		$(LIBJITSIMEET_DIR)/modules/browser/capabilities.json \
61
+		$(DEPLOY_DIR)
62
+
63
+deploy-libflac:
64
+	cp \
65
+		$(LIBFLAC_DIR)/libflac4-1.3.2.min.js \
66
+		$(LIBFLAC_DIR)/libflac4-1.3.2.min.js.mem \
67
+		$(DEPLOY_DIR)
68
+
69
+deploy-rnnoise-binary:
70
+	cp \
71
+		$(RNNOISE_WASM_DIR)/rnnoise.wasm \
72
+		$(DEPLOY_DIR)
73
+
74
+deploy-css:
75
+	$(NODE_SASS) $(STYLES_MAIN) $(STYLES_BUNDLE) && \
76
+	$(CLEANCSS) $(STYLES_BUNDLE) > $(STYLES_DESTINATION) ; \
77
+	rm $(STYLES_BUNDLE)
78
+
79
+deploy-local:
80
+	([ ! -x deploy-local.sh ] || ./deploy-local.sh)
81
+
82
+dev: deploy-init deploy-css deploy-rnnoise-binary deploy-lib-jitsi-meet deploy-libflac
83
+	$(WEBPACK_DEV_SERVER)
84
+
85
+source-package:
86
+	mkdir -p source_package/jitsi-meet/css && \
87
+	cp -r *.js *.html resources/*.txt connection_optimization favicon.ico fonts images libs static sounds LICENSE lang source_package/jitsi-meet && \
88
+	cp css/all.css source_package/jitsi-meet/css && \
89
+	(cd source_package ; tar cjf ../jitsi-meet.tar.bz2 jitsi-meet) && \
90
+	rm -rf source_package

+ 86
- 0
README.md Parādīt failu

@@ -0,0 +1,86 @@
1
+# Jitsi Meet - Secure, Simple and Scalable Video Conferences
2
+
3
+Jitsi Meet is an open-source (Apache) WebRTC JavaScript application that uses [Jitsi Videobridge](https://jitsi.org/videobridge) to provide high quality, [secure](#security) and scalable video conferences. Jitsi Meet in action can be seen at [here at the session #482 of the VoIP Users Conference](http://youtu.be/7vFUVClsNh0).
4
+
5
+The Jitsi Meet client runs in your browser, without installing anything else on your computer. You can try it out at https://meet.jit.si.
6
+
7
+Jitsi Meet allows very efficient collaboration. Users can stream their desktop or only some windows. It also supports shared document editing with Etherpad.
8
+
9
+## Installation
10
+
11
+On the client side, no installation is necessary. You just point your browser to the URL of your deployment. This section is about installing a Jitsi Meet suite on your server and hosting your own conferencing service.
12
+
13
+Installing Jitsi Meet is a simple experience. For Debian-based system, following the [quick-install](https://github.com/jitsi/jitsi-meet/blob/master/doc/quick-install.md) document, which uses the package system. You can also see a demonstration of the process in [this tutorial video](https://jitsi.org/tutorial).
14
+
15
+For other systems, or if you wish to install all components manually, see the [detailed manual installation instructions](https://github.com/jitsi/jitsi-meet/blob/master/doc/manual-install.md).
16
+
17
+## Download
18
+
19
+| Latest stable release | [![release](https://img.shields.io/badge/release-latest-green.svg)](https://github.com/jitsi/jitsi-meet/releases/latest) |
20
+|---|---|
21
+
22
+You can download Debian/Ubuntu binaries:
23
+* [stable](https://download.jitsi.org/stable/) ([instructions](https://jitsi.org/downloads/ubuntu-debian-installations-instructions/))
24
+* [testing](https://download.jitsi.org/testing/) ([instructions](https://jitsi.org/downloads/ubuntu-debian-installations-instructions-for-testing/))
25
+* [nightly](https://download.jitsi.org/unstable/) ([instructions](https://jitsi.org/downloads/ubuntu-debian-installations-instructions-nightly/))
26
+
27
+You can download source archives (produced by ```make source-package```):
28
+* [source builds](https://download.jitsi.org/jitsi-meet/src/)
29
+
30
+### Mobile apps
31
+
32
+* [Android](https://play.google.com/store/apps/details?id=org.jitsi.meet)
33
+
34
+[<img src="resources/img/google-play-badge.png" height="50">](https://play.google.com/store/apps/details?id=org.jitsi.meet)
35
+
36
+* [Android (F-Droid)](https://f-droid.org/en/packages/org.jitsi.meet/)
37
+
38
+[<img src="resources/img/f-droid-badge.png" height="50">](https://f-droid.org/en/packages/org.jitsi.meet/)
39
+
40
+* [iOS](https://itunes.apple.com/us/app/jitsi-meet/id1165103905)
41
+
42
+[<img src="resources/img/appstore-badge.png" height="50">](https://itunes.apple.com/us/app/jitsi-meet/id1165103905)
43
+
44
+You can also sign up for our open beta testing here:
45
+
46
+* [Android](https://play.google.com/apps/testing/org.jitsi.meet)
47
+* [iOS](https://testflight.apple.com/join/isy6ja7S)
48
+
49
+## Development
50
+
51
+For web development see [here](doc/development.md), and for mobile see [here](doc/mobile.md).
52
+
53
+## Contributing
54
+
55
+If you are looking to contribute to Jitsi Meet, first of all, thank you! Please
56
+see our [guidelines for contributing](CONTRIBUTING.md).
57
+
58
+## Embedding in external applications
59
+
60
+Jitsi Meet provides a very flexible way of embedding in external applications by using the [Jitsi Meet API](doc/api.md).
61
+
62
+## Security
63
+
64
+WebRTC does not (yet) provide a way of conducting multi-party conversations with end-to-end encryption. 
65
+Unless you consistently compare DTLS fingerprints with your peers vocally, the same goes for one-to-one calls.
66
+As a result, your stream is encrypted on the network but decrypted on the machine that hosts the bridge when using Jitsi Meet.
67
+
68
+The Jitsi Meet architecture allows you to deploy your own version, including
69
+all server components. In that case, your security guarantees will be roughly
70
+equivalent to a direct one-to-one WebRTC call. This is the uniqueness of
71
+Jitsi Meet in terms of security.
72
+
73
+The [meet.jit.si](https://meet.jit.si) service is maintained by the Jitsi team
74
+at [8x8](https://8x8.com).
75
+
76
+## Security issues
77
+
78
+We take security very seriously and develop all Jitsi projects to be secure and safe.
79
+
80
+If you find (or simply suspect) a security issue in any of the Jitsi projects, please send us an email to security@jitsi.org.
81
+
82
+**We encourage responsible disclosure for the sake of our users, so please reach out before posting in a public space.**
83
+
84
+## Acknowledgements
85
+
86
+Jitsi Meet started out as a sample conferencing application using Jitsi Videobridge. It was originally developed by ESTOS' developer Philipp Hancke who then contributed it to the community where development continues with joint forces!

+ 163
- 0
analytics-ga.js Parādīt failu

@@ -0,0 +1,163 @@
1
+/* global ga */
2
+
3
+(function(ctx) {
4
+    /**
5
+     *
6
+     */
7
+    function Analytics(options) {
8
+        /* eslint-disable */
9
+
10
+        if (!options.googleAnalyticsTrackingId) {
11
+            console.log(
12
+                'Failed to initialize Google Analytics handler, no tracking ID');
13
+             return;
14
+        }
15
+
16
+        /**
17
+         * Google Analytics
18
+         * TODO: Keep this local, there's no need to add it to window.
19
+         */
20
+        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
21
+            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
22
+        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
23
+        ga('create', options.googleAnalyticsTrackingId, 'auto');
24
+        ga('send', 'pageview');
25
+
26
+        /* eslint-enable */
27
+    }
28
+
29
+    /**
30
+     * Extracts the integer to use for a Google Analytics event's value field
31
+     * from a lib-jitsi-meet analytics event.
32
+     * @param {Object} event - The lib-jitsi-meet analytics event.
33
+     * @returns {Object} - The integer to use for the 'value' of a Google
34
+     * Analytics event.
35
+     * @private
36
+     */
37
+    Analytics.prototype._extractAction = function(event) {
38
+        // Page events have a single 'name' field.
39
+        if (event.type === 'page') {
40
+            return event.name;
41
+        }
42
+
43
+        // All other events have action, actionSubject, and source fields. All
44
+        // three fields are required, and the often jitsi-meet and
45
+        // lib-jitsi-meet use the same value when separate values are not
46
+        // necessary (i.e. event.action == event.actionSubject).
47
+        // Here we concatenate these three fields, but avoid adding the same
48
+        // value twice, because it would only make the GA event's action harder
49
+        // to read.
50
+        let action = event.action;
51
+
52
+        if (event.actionSubject && event.actionSubject !== event.action) {
53
+            // Intentionally use string concatenation as analytics needs to
54
+            // work on IE but this file does not go through babel. For some
55
+            // reason disabling this globally for the file does not have an
56
+            // effect.
57
+            // eslint-disable-next-line prefer-template
58
+            action = event.actionSubject + '.' + action;
59
+        }
60
+        if (event.source && event.source !== event.action
61
+                && event.source !== event.action) {
62
+            // eslint-disable-next-line prefer-template
63
+            action = event.source + '.' + action;
64
+        }
65
+
66
+        return action;
67
+    };
68
+
69
+    /**
70
+     * Extracts the integer to use for a Google Analytics event's value field
71
+     * from a lib-jitsi-meet analytics event.
72
+     * @param {Object} event - The lib-jitsi-meet analytics event.
73
+     * @returns {Object} - The integer to use for the 'value' of a Google
74
+     * Analytics event, or NaN if the lib-jitsi-meet event doesn't contain a
75
+     * suitable value.
76
+     * @private
77
+     */
78
+    Analytics.prototype._extractValue = function(event) {
79
+        let value = event && event.attributes && event.attributes.value;
80
+
81
+        // Try to extract an integer from the "value" attribute.
82
+        value = Math.round(parseFloat(value));
83
+
84
+        return value;
85
+    };
86
+
87
+    /**
88
+     * Extracts the string to use for a Google Analytics event's label field
89
+     * from a lib-jitsi-meet analytics event.
90
+     * @param {Object} event - The lib-jitsi-meet analytics event.
91
+     * @returns {string} - The string to use for the 'label' of a Google
92
+     * Analytics event.
93
+     * @private
94
+     */
95
+    Analytics.prototype._extractLabel = function(event) {
96
+        let label = '';
97
+
98
+        // The label field is limited to 500B. We will concatenate all
99
+        // attributes of the event, except the user agent because it may be
100
+        // lengthy and is probably included from elsewhere.
101
+        for (const property in event.attributes) {
102
+            if (property !== 'permanent_user_agent'
103
+                && property !== 'permanent_callstats_name'
104
+                && event.attributes.hasOwnProperty(property)) {
105
+                // eslint-disable-next-line prefer-template
106
+                label += property + '=' + event.attributes[property] + '&';
107
+            }
108
+        }
109
+
110
+        if (label.length > 0) {
111
+            label = label.slice(0, -1);
112
+        }
113
+
114
+        return label;
115
+    };
116
+
117
+    /**
118
+     * This is the entry point of the API. The function sends an event to
119
+     * google analytics. The format of the event is described in
120
+     * AnalyticsAdapter in lib-jitsi-meet.
121
+     * @param {Object} event - the event in the format specified by
122
+     * lib-jitsi-meet.
123
+     */
124
+    Analytics.prototype.sendEvent = function(event) {
125
+        if (!event || !ga) {
126
+            return;
127
+        }
128
+
129
+        const ignoredEvents
130
+            = [ 'e2e_rtt', 'rtp.stats', 'rtt.by.region', 'available.device',
131
+                'stream.switch.delay', 'ice.state.changed', 'ice.duration' ];
132
+
133
+        // Temporary removing some of the events that are too noisy.
134
+        if (ignoredEvents.indexOf(event.action) !== -1) {
135
+            return;
136
+        }
137
+
138
+        const gaEvent = {
139
+            'eventCategory': 'jitsi-meet',
140
+            'eventAction': this._extractAction(event),
141
+            'eventLabel': this._extractLabel(event)
142
+        };
143
+        const value = this._extractValue(event);
144
+
145
+        if (!isNaN(value)) {
146
+            gaEvent.eventValue = value;
147
+        }
148
+
149
+        ga('send', 'event', gaEvent);
150
+    };
151
+
152
+    if (typeof ctx.JitsiMeetJS === 'undefined') {
153
+        ctx.JitsiMeetJS = {};
154
+    }
155
+    if (typeof ctx.JitsiMeetJS.app === 'undefined') {
156
+        ctx.JitsiMeetJS.app = {};
157
+    }
158
+    if (typeof ctx.JitsiMeetJS.app.analyticsHandlers === 'undefined') {
159
+        ctx.JitsiMeetJS.app.analyticsHandlers = [];
160
+    }
161
+    ctx.JitsiMeetJS.app.analyticsHandlers.push(Analytics);
162
+})(window);
163
+/* eslint-enable prefer-template */

+ 380
- 0
android/README.md Parādīt failu

@@ -0,0 +1,380 @@
1
+# Jitsi Meet SDK for Android
2
+
3
+## Sample applications using the SDK
4
+
5
+If you want to see how easy integrating the Jitsi Meet SDK into a native application is, take a look at the
6
+[sample applications repository](https://github.com/jitsi/jitsi-meet-sdk-samples).
7
+
8
+## Build your own, or use a pre-build SDK artifacts/binaries
9
+
10
+Jitsi conveniently provides a pre-build SDK artifacts/binaries in its Maven repository. When you do not require any
11
+modification to the SDK itself or any of its dependencies, it's suggested to use the pre-build SDK. This avoids the
12
+complexity of building and installing your own SDK artifacts/binaries.
13
+
14
+### Use pre-build SDK artifacts/binaries
15
+
16
+In your project, add the Maven repository
17
+`https://github.com/jitsi/jitsi-maven-repository/raw/master/releases` and the
18
+dependency `org.jitsi.react:jitsi-meet-sdk` into your `build.gradle` files.
19
+
20
+The repository typically goes into the `build.gradle` file in the root of your project:
21
+
22
+```gradle
23
+allprojects {
24
+    repositories {
25
+        google()
26
+        jcenter()
27
+        maven {
28
+            url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
29
+        }
30
+    }
31
+}
32
+```
33
+
34
+Dependency definitions belong in the individual module `build.gradle` files:
35
+
36
+```gradle
37
+dependencies {
38
+    // (other dependencies)
39
+    implementation ('org.jitsi.react:jitsi-meet-sdk:2.+') { transitive = true }
40
+}
41
+```
42
+
43
+### Build and use your own SDK artifacts/binaries
44
+
45
+<details>
46
+<summary>Show building instructions</summary>
47
+
48
+Start by making sure that your development environment [is set up correctly](https://github.com/jitsi/jitsi-meet/blob/master/doc/mobile.md).
49
+
50
+A note on dependencies: Apart from the SDK, Jitsi also publishes a binary Maven artifact for some of the SDK dependencies (that are not otherwise publicly available) to the Jitsi Maven repository. When you're planning to use a SDK that is built from source, you'll likely use a version of the source code that is newer (or at least _different_) than the version of the source that was used to create the binary SDK artifact. As a consequence, the dependencies that your project will need, might also be different from those that are published in the Jitsi Maven repository. This might lead to build problems, caused by dependencies that are unavailable.
51
+
52
+If you want to use a SDK that is built from source, you will likely benefit from composing a local Maven repository that contains these dependencies. The text below describes how you create a repository that includes both the SDK as well as these dependencies. For illustration purposes, we'll define the location of this local Maven repository as `/tmp/repo`
53
+
54
+In source code form, the Android SDK dependencies are locked/pinned by package.json and package-lock.json of the Jitsi Meet project. To obtain the data, execute NPM in the jitsi-meet project directory:
55
+
56
+    npm install
57
+
58
+This will pull in the dependencies in either binary format, or in source code format, somewhere under /node_modules/
59
+
60
+Third-party React Native _modules_, which Jitsi Meet SDK for Android depends on, are download by NPM in source code 
61
+or binary form. These need to be assembled into Maven artifacts, and then published to your local Maven repository.
62
+A script is provided to facilitate this. From the root of the jitsi-meet project repository, run:
63
+
64
+    ./android/scripts/release-sdk.sh /tmp/repo
65
+
66
+This will build and publish the SDK, and all of its dependencies to the specified Maven repository (`/tmp/repo`) in
67
+this example.
68
+
69
+You're now ready to use the artifacts. In _your_ project, add the Maven repository that you used above (`/tmp/repo`) into your top-level `build.gradle` file:
70
+
71
+    allprojects {
72
+        repositories {
73
+            maven { url "file:/tmp/repo" }
74
+            google()
75
+            jcenter()
76
+        }
77
+    }
78
+
79
+You can use your local repository to replace the Jitsi repository (`maven { url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases" }`) when you published _all_ subprojects. If you didn't do that, you'll have to add both repositories. Make sure your local repository is listed first!
80
+
81
+Then, define the dependency `org.jitsi.react:jitsi-meet-sdk` into the `build.gradle` file of your module:
82
+
83
+    implementation ('org.jitsi.react:jitsi-meet-sdk:+') { transitive = true }
84
+
85
+Note that there should not be a need to explicitly add the other dependencies, as they will be pulled in as transitive
86
+dependencies of `jitsi-meet-sdk`.
87
+
88
+</details>
89
+
90
+## Using the API
91
+
92
+Jitsi Meet SDK is an Android library which embodies the whole Jitsi Meet
93
+experience and makes it reusable by third-party apps.
94
+
95
+First, add Java 1.8 compatibility support to your project by adding the
96
+following lines into your `build.gradle` file:
97
+
98
+```
99
+compileOptions {
100
+    sourceCompatibility JavaVersion.VERSION_1_8
101
+    targetCompatibility JavaVersion.VERSION_1_8
102
+}
103
+```
104
+
105
+To get started, extends your `android.app.Activity` from
106
+`org.jitsi.meet.sdk.JitsiMeetActivity`:
107
+
108
+```java
109
+package org.jitsi.example;
110
+
111
+import org.jitsi.meet.sdk.JitsiMeetActivity;
112
+
113
+public class MainActivity extends JitsiMeetActivity {
114
+}
115
+```
116
+
117
+Alternatively, you can use the `org.jitsi.meet.sdk.JitsiMeetView` class which
118
+extends `android.view.View`.
119
+
120
+Note that this should only be needed when `JitsiMeetActivity` cannot be used for
121
+some reason. Extending `JitsiMeetView` requires manual wiring of the view to
122
+the activity, using a lot of boilerplate code. Using the Activity instead of the
123
+View is strongly recommended.
124
+
125
+<details>
126
+<summary>Show example</summary>
127
+
128
+```java
129
+package org.jitsi.example;
130
+
131
+import android.os.Bundle;
132
+import android.support.v4.app.FragmentActivity;
133
+
134
+import org.jitsi.meet.sdk.JitsiMeetView;
135
+import org.jitsi.meet.sdk.ReactActivityLifecycleCallbacks;
136
+
137
+// Example
138
+//
139
+public class MainActivity extends FragmentActivity implements JitsiMeetActivityInterface {
140
+    private JitsiMeetView view;
141
+
142
+    @Override
143
+    protected void onActivityResult(
144
+            int requestCode,
145
+            int resultCode,
146
+            Intent data) {
147
+        JitsiMeetActivityDelegate.onActivityResult(
148
+                this, requestCode, resultCode, data);
149
+    }
150
+
151
+    @Override
152
+    public void onBackPressed() {
153
+        JitsiMeetActivityDelegate.onBackPressed();
154
+    }
155
+
156
+    @Override
157
+    protected void onCreate(Bundle savedInstanceState) {
158
+        super.onCreate(savedInstanceState);
159
+
160
+        view = new JitsiMeetView(this);
161
+        JitsiMeetConferenceOptions options = new JitsiMeetConferenceOptions.Builder()
162
+            .setRoom("https://meet.jit.si/test123")
163
+            .build();
164
+        view.join(options);
165
+
166
+        setContentView(view);
167
+    }
168
+
169
+    @Override
170
+    protected void onDestroy() {
171
+        super.onDestroy();
172
+
173
+        view.dispose();
174
+        view = null;
175
+
176
+        JitsiMeetActivityDelegate.onHostDestroy(this);
177
+    }
178
+
179
+    @Override
180
+    public void onNewIntent(Intent intent) {
181
+        JitsiMeetActivityDelegate.onNewIntent(intent);
182
+    }
183
+
184
+    @Override
185
+    public void onRequestPermissionsResult(
186
+            final int requestCode,
187
+            final String[] permissions,
188
+            final int[] grantResults) {
189
+        JitsiMeetActivityDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);
190
+    }
191
+
192
+    @Override
193
+    protected void onResume() {
194
+        super.onResume();
195
+
196
+        JitsiMeetActivityDelegate.onHostResume(this);
197
+    }
198
+
199
+    @Override
200
+    protected void onStop() {
201
+        super.onStop();
202
+
203
+        JitsiMeetActivityDelegate.onHostPause(this);
204
+    }
205
+}
206
+```
207
+
208
+</details>
209
+
210
+### JitsiMeetActivity
211
+
212
+This class encapsulates a high level API in the form of an Android `FragmentActivity`
213
+which displays a single `JitsiMeetView`. You can pass a URL as a `ACTION_VIEW`
214
+on the Intent when starting it and it will join the conference, and will be
215
+automatically terminated (finish() will be called on the activity) when the
216
+conference ends or fails.
217
+
218
+### JitsiMeetView
219
+
220
+The `JitsiMeetView` class is the core of Jitsi Meet SDK. It's designed to
221
+display a Jitsi Meet conference (or a welcome page).
222
+
223
+#### join(options)
224
+
225
+Joins the conference specified by the given `JitsiMeetConferenceOptions`.
226
+
227
+#### leave()
228
+
229
+Leaves the currently active conference. If the welcome page is enabled it will
230
+go back to it, otherwise a black window will be shown.
231
+
232
+#### dispose()
233
+
234
+Releases all resources associated with this view. This method MUST be called
235
+when the Activity holding this view is going to be destroyed, usually in the
236
+`onDestroy()` method.
237
+
238
+#### getListener()
239
+
240
+Returns the `JitsiMeetViewListener` instance attached to the view.
241
+
242
+#### setListener(listener)
243
+
244
+Sets the given listener (class implementing the `JitsiMeetViewListener`
245
+interface) on the view.
246
+
247
+### JitsiMeetConferenceOptions
248
+
249
+This object encapsulates all the options that can be tweaked when joining
250
+a conference.
251
+
252
+Example:
253
+
254
+```java
255
+JitsiMeetConferenceOptions options = new JitsiMeetConferenceOptions.Builder()
256
+    .setServerURL(new URL("https://meet.jit.si"))
257
+    .setRoom("test123")
258
+    .setAudioMuted(false)
259
+    .setVideoMuted(false)
260
+    .setAudioOnly(false)
261
+    .setWelcomePageEnabled(false)
262
+    .build();
263
+```
264
+
265
+See the `JitsiMeetConferenceOptions` implementation for all available options.
266
+
267
+### JitsiMeetActivityDelegate
268
+
269
+This class handles the interaction between `JitsiMeetView` and its enclosing
270
+`Activity`. Generally this shouldn't be consumed by users, because they'd be
271
+using `JitsiMeetActivity` instead, which is already completely integrated.
272
+
273
+All its methods are static.
274
+
275
+#### onActivityResult(...)
276
+
277
+Helper method to handle results of auxiliary activities launched by the SDK.
278
+Should be called from the activity method of the same name.
279
+
280
+#### onBackPressed()
281
+
282
+Helper method which should be called from the activity's `onBackPressed` method.
283
+If this function returns `true`, it means the action was handled and thus no
284
+extra processing is required; otherwise the app should call the parent's
285
+`onBackPressed` method.
286
+
287
+#### onHostDestroy(...)
288
+
289
+Helper method which should be called from the activity's `onDestroy` method.
290
+
291
+#### onHostResume(...)
292
+
293
+Helper method which should be called from the activity's `onResume` or `onStop`
294
+method.
295
+
296
+#### onHostStop(...)
297
+
298
+Helper method which should be called from the activity's `onSstop` method.
299
+
300
+#### onNewIntent(...)
301
+
302
+Helper method for integrating the *deep linking* functionality. If your app's
303
+activity is launched in "singleTask" mode this method should be called from the
304
+activity's `onNewIntent` method.
305
+
306
+#### onRequestPermissionsResult(...)
307
+
308
+Helper method to handle permission requests inside the SDK. It should be called
309
+from the activity method of the same name.
310
+
311
+#### onUserLeaveHint()
312
+
313
+Helper method for integrating automatic Picture-in-Picture. It should be called
314
+from the activity's `onUserLeaveHint` method.
315
+
316
+This is a static method.
317
+
318
+#### JitsiMeetViewListener
319
+
320
+`JitsiMeetViewListener` provides an interface apps can implement to listen to
321
+the state of the Jitsi Meet conference displayed in a `JitsiMeetView`.
322
+
323
+#### onConferenceJoined
324
+
325
+Called when a conference was joined.
326
+
327
+The `data` `Map` contains a "url" key with the conference URL.
328
+
329
+#### onConferenceTerminated
330
+
331
+Called when a conference was terminated either by user choice or due to a
332
+failure.
333
+
334
+The `data` `Map` contains an "error" key with the error and a "url" key
335
+with the conference URL. If the conference finished gracefully no `error`
336
+key will be present.
337
+
338
+#### onConferenceWillJoin
339
+
340
+Called before a conference is joined.
341
+
342
+The `data` `Map` contains a "url" key with the conference URL.
343
+
344
+## ProGuard rules
345
+
346
+When using the SDK on a project some proguard rules have to be added in order
347
+to avoid necessary code being stripped. Add the following to your project's
348
+rules file: https://github.com/jitsi/jitsi-meet/blob/master/android/app/proguard-rules.pro
349
+
350
+## Picture-in-Picture
351
+
352
+`JitsiMeetView` will automatically adjust its UI when presented in a
353
+Picture-in-Picture style scenario, in a rectangle too small to accommodate its
354
+"full" UI.
355
+
356
+## Dropbox integration
357
+
358
+To setup the Dropbox integration, follow these steps:
359
+
360
+1. Add the following to the app's AndroidManifest.xml and change `<APP_KEY>` to
361
+your Dropbox app key:
362
+```
363
+<activity
364
+    android:configChanges="keyboard|orientation"
365
+    android:launchMode="singleTask"
366
+    android:name="com.dropbox.core.android.AuthActivity">
367
+  <intent-filter>
368
+    <action android:name="android.intent.action.VIEW" />
369
+    <category android:name="android.intent.category.BROWSABLE" />
370
+    <category android:name="android.intent.category.DEFAULT" />
371
+    <data android:scheme="db-<APP_KEY>" />
372
+  </intent-filter>
373
+</activity>
374
+```
375
+
376
+2. Add the following to the app's strings.xml and change `<APP_KEY>` to your
377
+Dropbox app key:
378
+```
379
+<string name="dropbox_app_key"><APP_KEY></string>
380
+```

+ 6
- 0
android/app/.classpath Parādīt failu

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<classpath>
3
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
4
+	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5
+	<classpathentry kind="output" path="bin/default"/>
6
+</classpath>

+ 23
- 0
android/app/.project Parādīt failu

@@ -0,0 +1,23 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<projectDescription>
3
+	<name>app</name>
4
+	<comment>Project app created by Buildship.</comment>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+		<buildCommand>
9
+			<name>org.eclipse.jdt.core.javabuilder</name>
10
+			<arguments>
11
+			</arguments>
12
+		</buildCommand>
13
+		<buildCommand>
14
+			<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15
+			<arguments>
16
+			</arguments>
17
+		</buildCommand>
18
+	</buildSpec>
19
+	<natures>
20
+		<nature>org.eclipse.jdt.core.javanature</nature>
21
+		<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22
+	</natures>
23
+</projectDescription>

+ 2
- 0
android/app/.settings/org.eclipse.buildship.core.prefs Parādīt failu

@@ -0,0 +1,2 @@
1
+connection.project.dir=..
2
+eclipse.preferences.version=1

+ 179
- 0
android/app/build.gradle Parādīt failu

@@ -0,0 +1,179 @@
1
+apply plugin: 'com.android.application'
2
+
3
+boolean googleServicesEnabled \
4
+    = project.file('google-services.json').exists() && !rootProject.ext.libreBuild
5
+
6
+// Crashlytics integration is done as part of Firebase now, so it gets
7
+// automagically activated with google-services.json
8
+if (googleServicesEnabled) {
9
+    apply plugin: 'io.fabric'
10
+}
11
+
12
+// Use the number of seconds/10 since Jan 1 2019 as the versionCode.
13
+// This lets us upload a new build at most every 10 seconds for the
14
+// next ~680 years.
15
+// https://stackoverflow.com/a/38643838
16
+def vcode = (int)(((new Date().getTime()/1000) - 1546297200) / 10)
17
+
18
+android {
19
+    compileSdkVersion rootProject.ext.compileSdkVersion
20
+    buildToolsVersion rootProject.ext.buildToolsVersion
21
+
22
+    defaultConfig {
23
+        applicationId 'org.jitsi.meet'
24
+        versionCode vcode
25
+        versionName project.appVersion
26
+
27
+        minSdkVersion rootProject.ext.minSdkVersion
28
+        targetSdkVersion rootProject.ext.targetSdkVersion
29
+
30
+        ndk {
31
+            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
32
+        }
33
+    }
34
+
35
+    signingConfigs {
36
+        debug {
37
+            storeFile file('debug.keystore')
38
+            storePassword 'android'
39
+            keyAlias 'androiddebugkey'
40
+            keyPassword 'android'
41
+        }
42
+    }
43
+
44
+    buildTypes {
45
+        debug {
46
+            buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
47
+            buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
48
+        }
49
+        release {
50
+            // Uncomment the following line for singing a test release build.
51
+            //signingConfig signingConfigs.debug
52
+            minifyEnabled true
53
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
54
+            buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
55
+            buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
56
+        }
57
+    }
58
+
59
+    sourceSets {
60
+        main {
61
+            java {
62
+                if (rootProject.ext.libreBuild) {
63
+                    srcDir "src"
64
+                    exclude "**/GoogleServicesHelper.java"
65
+                }
66
+            }
67
+        }
68
+    }
69
+
70
+    compileOptions {
71
+        sourceCompatibility JavaVersion.VERSION_1_8
72
+        targetCompatibility JavaVersion.VERSION_1_8
73
+    }
74
+}
75
+
76
+repositories {
77
+    maven { url 'https://maven.fabric.io/public' }
78
+}
79
+
80
+dependencies {
81
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
82
+    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
83
+    implementation 'androidx.appcompat:appcompat:1.1.0'
84
+
85
+    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-5'
86
+
87
+    if (!rootProject.ext.libreBuild) {
88
+        implementation 'com.google.android.gms:play-services-auth:16.0.1'
89
+
90
+        // Firebase
91
+        //  - Crashlytics
92
+        //  - Dynamic Links
93
+        implementation 'com.google.firebase:firebase-core:16.0.6'
94
+        implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
95
+        implementation 'com.google.firebase:firebase-dynamic-links:16.1.5'
96
+    }
97
+
98
+    implementation project(':sdk')
99
+}
100
+
101
+gradle.projectsEvaluated {
102
+    // Dropbox integration
103
+    //
104
+
105
+    def dropboxAppKey
106
+    if (project.file('dropbox.key').exists()) {
107
+        dropboxAppKey = project.file('dropbox.key').text.trim() - 'db-'
108
+    }
109
+
110
+    if (dropboxAppKey) {
111
+        android.defaultConfig.resValue('string', 'dropbox_app_key', "${dropboxAppKey}")
112
+
113
+        def dropboxActivity = """
114
+          <activity
115
+              android:configChanges="keyboard|orientation"
116
+              android:launchMode="singleTask"
117
+              android:name="com.dropbox.core.android.AuthActivity">
118
+            <intent-filter>
119
+              <action android:name="android.intent.action.VIEW" />
120
+              <category android:name="android.intent.category.BROWSABLE" />
121
+              <category android:name="android.intent.category.DEFAULT" />
122
+              <data android:scheme="db-${dropboxAppKey}" />
123
+            </intent-filter>
124
+          </activity>"""
125
+
126
+        android.applicationVariants.all { variant ->
127
+            variant.outputs.each { output ->
128
+                output.getProcessManifestProvider().get().doLast {
129
+                    def outputDir = manifestOutputDirectory.get().asFile
130
+                    def manifestPath = new File(outputDir, 'AndroidManifest.xml')
131
+                    def charset = 'UTF-8'
132
+                    def text
133
+                    text = manifestPath.getText(charset)
134
+                    text = text.replace('</application>', "${dropboxActivity}</application>")
135
+                    manifestPath.write(text, charset)
136
+                }
137
+            }
138
+        }
139
+    }
140
+
141
+    // Run React packager
142
+    android.applicationVariants.all { variant ->
143
+        def targetName = variant.name.capitalize()
144
+
145
+        def currentRunPackagerTask = tasks.create(
146
+                name: "run${targetName}ReactPackager",
147
+                type: Exec) {
148
+            group = "react"
149
+            description = "Run the React packager."
150
+
151
+            doFirst {
152
+                println "Starting the React packager..."
153
+
154
+                def androidRoot = file("${projectDir}/../")
155
+
156
+                // Set up the call to the script
157
+                workingDir androidRoot
158
+
159
+                // Run the packager
160
+                commandLine("scripts/run-packager.sh")
161
+            }
162
+
163
+            // Set up dev mode
164
+            def devEnabled = !targetName.toLowerCase().contains("release")
165
+
166
+            // Only enable for dev builds
167
+            enabled devEnabled
168
+        }
169
+
170
+        def packageTask = variant.packageApplicationProvider.get()
171
+
172
+        packageTask.dependsOn(currentRunPackagerTask)
173
+    }
174
+
175
+}
176
+
177
+if (googleServicesEnabled) {
178
+   apply plugin: 'com.google.gms.google-services'
179
+}

+ 6
- 0
android/app/proguard-rules-release.pro Parādīt failu

@@ -0,0 +1,6 @@
1
+-include proguard-rules.pro
2
+
3
+# Crashlytics
4
+-keepattributes *Annotation*
5
+-keepattributes SourceFile,LineNumberTable
6
+-keep public class * extends java.lang.Exception

+ 92
- 0
android/app/proguard-rules.pro Parādīt failu

@@ -0,0 +1,92 @@
1
+# Add project specific ProGuard rules here.
2
+# By default, the flags in this file are appended to flags specified
3
+# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+# You can edit the include path and order by changing the proguardFiles
5
+# directive in build.gradle.
6
+#
7
+# For more details, see
8
+#   http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+# Add any project specific keep options here:
11
+
12
+# React Native
13
+
14
+# Keep our interfaces so they can be used by other ProGuard rules.
15
+# See http://sourceforge.net/p/proguard/bugs/466/
16
+-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
17
+-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
18
+-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
19
+
20
+# Do not strip any method/class that is annotated with @DoNotStrip
21
+-keep @com.facebook.proguard.annotations.DoNotStrip class *
22
+-keep @com.facebook.common.internal.DoNotStrip class *
23
+-keepclassmembers class * {
24
+    @com.facebook.proguard.annotations.DoNotStrip *;
25
+    @com.facebook.common.internal.DoNotStrip *;
26
+}
27
+
28
+-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
29
+  void set*(***);
30
+  *** get*();
31
+}
32
+
33
+-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
34
+-keep class * extends com.facebook.react.bridge.NativeModule { *; }
35
+-keepclassmembers,includedescriptorclasses class * { native <methods>; }
36
+-keepclassmembers class *  { @com.facebook.react.uimanager.UIProp <fields>; }
37
+-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
38
+-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
39
+
40
+-dontwarn com.facebook.react.**
41
+-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }
42
+
43
+# okhttp
44
+
45
+-keepattributes Signature
46
+-keepattributes *Annotation*
47
+-keep class okhttp3.** { *; }
48
+-keep interface okhttp3.** { *; }
49
+-dontwarn okhttp3.**
50
+
51
+# okio
52
+
53
+-keep class sun.misc.Unsafe { *; }
54
+-dontwarn java.nio.file.*
55
+-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
56
+-keep class okio.** { *; }
57
+-dontwarn okio.**
58
+
59
+# WebRTC
60
+
61
+-keep class org.webrtc.** { *; }
62
+-dontwarn org.chromium.build.BuildHooksAndroid
63
+
64
+# Jisti Meet SDK
65
+
66
+-keep class org.jitsi.meet.** { *; }
67
+-keep class org.jitsi.meet.sdk.** { *; }
68
+
69
+# We added the following when we switched minifyEnabled on. Probably because we
70
+# ran the app and hit problems...
71
+
72
+-keep class com.facebook.react.bridge.CatalystInstanceImpl { *; }
73
+-keep class com.facebook.react.bridge.ExecutorToken { *; }
74
+-keep class com.facebook.react.bridge.JavaScriptExecutor { *; }
75
+-keep class com.facebook.react.bridge.ModuleRegistryHolder { *; }
76
+-keep class com.facebook.react.bridge.ReadableType { *; }
77
+-keep class com.facebook.react.bridge.queue.NativeRunnable { *; }
78
+-keep class com.facebook.react.devsupport.** { *; }
79
+
80
+-dontwarn com.facebook.react.devsupport.**
81
+-dontwarn com.google.appengine.**
82
+-dontwarn com.squareup.okhttp.**
83
+-dontwarn javax.servlet.**
84
+
85
+# ^^^ We added the above when we switched minifyEnabled on.
86
+
87
+# Rule to avoid build errors related to SVGs.
88
+-keep public class com.horcrux.svg.** {*;}
89
+
90
+# Hermes
91
+-keep class com.facebook.hermes.unicode.** { *; }
92
+

+ 39
- 0
android/app/src/main/AndroidManifest.xml Parādīt failu

@@ -0,0 +1,39 @@
1
+<manifest
2
+    xmlns:android="http://schemas.android.com/apk/res/android"
3
+    package="org.jitsi.meet">
4
+  <application
5
+      android:allowBackup="true"
6
+      android:icon="@mipmap/ic_launcher"
7
+      android:label="@string/app_name"
8
+      android:networkSecurityConfig="@xml/network_security_config"
9
+      android:theme="@style/AppTheme">
10
+    <activity
11
+        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize"
12
+        android:label="@string/app_name"
13
+        android:launchMode="singleTask"
14
+        android:name=".MainActivity"
15
+        android:resizeableActivity="true"
16
+        android:supportsPictureInPicture="true"
17
+        android:windowSoftInputMode="adjustResize">
18
+      <meta-data android:name="firebase_crashlytics_collection_enabled" android:value="false" />
19
+      <intent-filter>
20
+        <action android:name="android.intent.action.MAIN" />
21
+        <category android:name="android.intent.category.LAUNCHER" />
22
+      </intent-filter>
23
+      <intent-filter>
24
+        <action android:name="android.intent.action.VIEW" />
25
+        <category android:name="android.intent.category.BROWSABLE" />
26
+        <category android:name="android.intent.category.DEFAULT" />
27
+        <data android:host="alpha.jitsi.net" android:scheme="https" />
28
+        <data android:host="beta.meet.jit.si" android:scheme="https" />
29
+        <data android:host="meet.jit.si" android:scheme="https" />
30
+      </intent-filter>
31
+      <intent-filter>
32
+        <action android:name="android.intent.action.VIEW" />
33
+        <category android:name="android.intent.category.BROWSABLE" />
34
+        <category android:name="android.intent.category.DEFAULT" />
35
+        <data android:scheme="org.jitsi.meet" />
36
+      </intent-filter>
37
+    </activity>
38
+  </application>
39
+</manifest>

+ 40
- 0
android/app/src/main/java/org/jitsi/meet/GoogleServicesHelper.java Parādīt failu

@@ -0,0 +1,40 @@
1
+package org.jitsi.meet;
2
+
3
+import android.net.Uri;
4
+import android.util.Log;
5
+
6
+import com.crashlytics.android.Crashlytics;
7
+import com.google.firebase.dynamiclinks.FirebaseDynamicLinks;
8
+import io.fabric.sdk.android.Fabric;
9
+
10
+import org.jitsi.meet.sdk.JitsiMeetActivity;
11
+
12
+/**
13
+ * Helper class to initialize Google related services and functionality.
14
+ * This functionality is compiled conditionally and called via reflection, that's why it was
15
+ * extracted here.
16
+ *
17
+ * "Libre builds" (builds with the LIBRE_BUILD flag set) will not include this file.
18
+ */
19
+final class GoogleServicesHelper {
20
+    public static void initialize(JitsiMeetActivity activity) {
21
+        if (BuildConfig.GOOGLE_SERVICES_ENABLED) {
22
+            Log.d(activity.getClass().getSimpleName(), "Initializing Google Services");
23
+
24
+            Fabric.with(activity, new Crashlytics());
25
+
26
+            FirebaseDynamicLinks.getInstance().getDynamicLink(activity.getIntent())
27
+                .addOnSuccessListener(activity, pendingDynamicLinkData -> {
28
+                    Uri dynamicLink = null;
29
+
30
+                    if (pendingDynamicLinkData != null) {
31
+                        dynamicLink = pendingDynamicLinkData.getLink();
32
+                    }
33
+
34
+                    if (dynamicLink != null) {
35
+                        activity.join(dynamicLink.toString());
36
+                    }
37
+                });
38
+        }
39
+    }
40
+}

+ 150
- 0
android/app/src/main/java/org/jitsi/meet/MainActivity.java Parādīt failu

@@ -0,0 +1,150 @@
1
+/*
2
+ * Copyright @ 2017-present 8x8, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package org.jitsi.meet;
18
+
19
+import android.content.Intent;
20
+import android.net.Uri;
21
+import android.os.Build;
22
+import android.provider.Settings;
23
+import android.util.Log;
24
+import android.view.KeyEvent;
25
+import androidx.annotation.Nullable;
26
+
27
+import org.jitsi.meet.sdk.JitsiMeet;
28
+import org.jitsi.meet.sdk.JitsiMeetActivity;
29
+import org.jitsi.meet.sdk.JitsiMeetConferenceOptions;
30
+
31
+import java.lang.reflect.Method;
32
+import java.net.MalformedURLException;
33
+import java.net.URL;
34
+import java.util.Map;
35
+
36
+/**
37
+ * The one and only Activity that the Jitsi Meet app needs. The
38
+ * {@code Activity} is launched in {@code singleTask} mode, so it will be
39
+ * created upon application initialization and there will be a single instance
40
+ * of it. Further attempts at launching the application once it was already
41
+ * launched will result in {@link MainActivity#onNewIntent(Intent)} being called.
42
+ */
43
+public class MainActivity extends JitsiMeetActivity {
44
+    /**
45
+     * The request code identifying requests for the permission to draw on top
46
+     * of other apps. The value must be 16-bit and is arbitrarily chosen here.
47
+     */
48
+    private static final int OVERLAY_PERMISSION_REQUEST_CODE
49
+        = (int) (Math.random() * Short.MAX_VALUE);
50
+
51
+    // JitsiMeetActivity overrides
52
+    //
53
+
54
+    @Override
55
+    protected boolean extraInitialize() {
56
+        Log.d(this.getClass().getSimpleName(), "LIBRE_BUILD="+BuildConfig.LIBRE_BUILD);
57
+
58
+        // Setup Crashlytics and Firebase Dynamic Links
59
+        // Here we are using reflection since it may have been disabled at compile time.
60
+        try {
61
+            Class<?> cls = Class.forName("org.jitsi.meet.GoogleServicesHelper");
62
+            Method m = cls.getMethod("initialize", JitsiMeetActivity.class);
63
+            m.invoke(null, this);
64
+        } catch (Exception e) {
65
+            // Ignore any error, the module is not compiled when LIBRE_BUILD is enabled.
66
+        }
67
+
68
+        // In Debug builds React needs permission to write over other apps in
69
+        // order to display the warning and error overlays.
70
+        if (BuildConfig.DEBUG) {
71
+            if (canRequestOverlayPermission() && !Settings.canDrawOverlays(this)) {
72
+                Intent intent
73
+                    = new Intent(
74
+                    Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
75
+                    Uri.parse("package:" + getPackageName()));
76
+
77
+                startActivityForResult(intent, OVERLAY_PERMISSION_REQUEST_CODE);
78
+
79
+                return true;
80
+            }
81
+        }
82
+
83
+        return false;
84
+    }
85
+
86
+    @Override
87
+    protected void initialize() {
88
+        // Set default options
89
+        JitsiMeetConferenceOptions defaultOptions
90
+            = new JitsiMeetConferenceOptions.Builder()
91
+                .setWelcomePageEnabled(true)
92
+                .setServerURL(buildURL("https://meet.jit.si"))
93
+                .setFeatureFlag("call-integration.enabled", false)
94
+                .build();
95
+        JitsiMeet.setDefaultConferenceOptions(defaultOptions);
96
+
97
+        super.initialize();
98
+    }
99
+
100
+    @Override
101
+    public void onConferenceTerminated(Map<String, Object> data) {
102
+        Log.d(TAG, "Conference terminated: " + data);
103
+    }
104
+
105
+    // Activity lifecycle method overrides
106
+    //
107
+
108
+    @Override
109
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
110
+        if (requestCode == OVERLAY_PERMISSION_REQUEST_CODE
111
+                && canRequestOverlayPermission()) {
112
+            if (Settings.canDrawOverlays(this)) {
113
+                initialize();
114
+                return;
115
+            }
116
+
117
+            throw new RuntimeException("Overlay permission is required when running in Debug mode.");
118
+        }
119
+
120
+        super.onActivityResult(requestCode, resultCode, data);
121
+    }
122
+
123
+    // ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java
124
+    @Override
125
+    public boolean onKeyUp(int keyCode, KeyEvent event) {
126
+        if (BuildConfig.DEBUG && keyCode == KeyEvent.KEYCODE_MENU) {
127
+            JitsiMeet.showDevOptions();
128
+            return true;
129
+        }
130
+
131
+        return super.onKeyUp(keyCode, event);
132
+    }
133
+
134
+    // Helper methods
135
+    //
136
+
137
+    private @Nullable URL buildURL(String urlStr) {
138
+        try {
139
+            return new URL(urlStr);
140
+        } catch (MalformedURLException e) {
141
+            return null;
142
+        }
143
+    }
144
+
145
+    private boolean canRequestOverlayPermission() {
146
+        return
147
+            Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
148
+                && getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.M;
149
+    }
150
+}

Binārs
android/app/src/main/res/drawable-hdpi/ic_notification.png Parādīt failu


Binārs
android/app/src/main/res/drawable-mdpi/ic_notification.png Parādīt failu


Binārs
android/app/src/main/res/drawable-xhdpi/ic_notification.png Parādīt failu


Binārs
android/app/src/main/res/drawable-xxhdpi/ic_notification.png Parādīt failu


Binārs
android/app/src/main/res/drawable-xxxhdpi/ic_notification.png Parādīt failu


+ 5
- 0
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml Parādīt failu

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <background android:drawable="@color/ic_launcher_background"/>
4
+    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5
+</adaptive-icon>

+ 5
- 0
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml Parādīt failu

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <background android:drawable="@color/ic_launcher_background"/>
4
+    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5
+</adaptive-icon>

Binārs
android/app/src/main/res/mipmap-hdpi/ic_launcher.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-mdpi/ic_launcher.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png Parādīt failu


Binārs
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png Parādīt failu


+ 4
- 0
android/app/src/main/res/values/ic_launcher_background.xml Parādīt failu

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<resources>
3
+    <color name="ic_launcher_background">#66A8DD</color>
4
+</resources>

+ 3
- 0
android/app/src/main/res/values/strings.xml Parādīt failu

@@ -0,0 +1,3 @@
1
+<resources>
2
+    <string name="app_name">Jitsi Meet</string>
3
+</resources>

+ 7
- 0
android/app/src/main/res/values/styles.xml Parādīt failu

@@ -0,0 +1,7 @@
1
+<resources>
2
+    <!-- Base application theme. -->
3
+    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
4
+        <!-- Customize your theme here. -->
5
+        <item name="android:navigationBarColor">#1081B2</item>
6
+    </style>
7
+</resources>

+ 6
- 0
android/app/src/main/res/xml/network_security_config.xml Parādīt failu

@@ -0,0 +1,6 @@
1
+<network-security-config>
2
+    <domain-config cleartextTrafficPermitted="true">
3
+        <domain includeSubdomains="false">localhost</domain>
4
+        <domain includeSubdomains="false">10.0.2.2</domain>
5
+    </domain-config>
6
+</network-security-config>

+ 179
- 0
android/build.gradle Parādīt failu

@@ -0,0 +1,179 @@
1
+import groovy.json.JsonSlurper
2
+
3
+// Top-level build file where you can add configuration options common to all
4
+// sub-projects/modules.
5
+
6
+buildscript {
7
+    repositories {
8
+        google()
9
+        jcenter()
10
+        repositories {
11
+            maven { url 'https://maven.fabric.io/public' }
12
+        }
13
+    }
14
+    dependencies {
15
+        classpath 'com.android.tools.build:gradle:3.3.2'
16
+        classpath 'com.google.gms:google-services:4.3.3'
17
+        classpath 'io.fabric.tools:gradle:1.28.1'
18
+
19
+        // NOTE: Do not place your application dependencies here; they belong
20
+        // in the individual module build.gradle files.
21
+    }
22
+}
23
+
24
+allprojects {
25
+    repositories {
26
+        google()
27
+        jcenter()
28
+        // React Native (JS, Obj-C sources, Android binaries) is installed from npm.
29
+        maven { url "$rootDir/../node_modules/react-native/android" }
30
+    }
31
+
32
+    // Make sure we use the react-native version in node_modules and not the one
33
+    // published in jcenter / elsewhere.
34
+    configurations.all {
35
+        resolutionStrategy {
36
+            eachDependency { DependencyResolveDetails details ->
37
+                if (details.requested.group == 'com.facebook.react'
38
+                        && details.requested.name == 'react-native') {
39
+                    def file = new File("$rootDir/../node_modules/react-native/package.json")
40
+                    def version = new JsonSlurper().parseText(file.text).version
41
+                    details.useVersion version
42
+                }
43
+            }
44
+        }
45
+    }
46
+
47
+    // Third-party react-native modules which Jitsi Meet SDK for Android depends
48
+    // on and which are not available in third-party Maven repositories need to
49
+    // be deployed in a Maven repository of ours.
50
+    //
51
+
52
+    if (project.name.startsWith('react-native-')) {
53
+        apply plugin: 'maven-publish'
54
+        publishing {
55
+            publications {}
56
+            repositories {
57
+                maven {
58
+                    url rootProject.ext.mavenRepo
59
+                    if (!rootProject.ext.mavenRepo.startsWith("file")) {
60
+                        credentials {
61
+                            username rootProject.ext.mavenUser
62
+                            password rootProject.ext.mavenPassword
63
+                        }
64
+                    }
65
+                }
66
+            }
67
+        }
68
+    }
69
+
70
+    // Use the number of seconds/10 since Jan 1 2019 as the version qualifier number.
71
+    // This will last for the next ~680 years.
72
+    // https://stackoverflow.com/a/38643838
73
+    def versionQualifierNumber = (int)(((new Date().getTime()/1000) - 1546297200) / 10)
74
+
75
+    afterEvaluate { project ->
76
+        if (project.plugins.hasPlugin('android') || project.plugins.hasPlugin('android-library')) {
77
+            project.android {
78
+                compileSdkVersion rootProject.ext.compileSdkVersion
79
+                buildToolsVersion rootProject.ext.buildToolsVersion
80
+            }
81
+        }
82
+
83
+        if (project.name.startsWith('react-native-')) {
84
+            def npmManifest = project.file('../package.json')
85
+            def json = new JsonSlurper().parseText(npmManifest.text)
86
+
87
+            // Release every dependency the SDK has with a -jitsi-XXX qualified version. This allows
88
+            // us to pin the dependencies and make sure they are always updated, no matter what.
89
+
90
+            project.version = "${json.version}-jitsi-${versionQualifierNumber}"
91
+
92
+            task androidSourcesJar(type: Jar) {
93
+                classifier = 'sources'
94
+                from android.sourceSets.main.java.source
95
+            }
96
+
97
+            publishing.publications {
98
+                aarArchive(MavenPublication) {
99
+                    groupId rootProject.ext.moduleGroupId
100
+                    artifactId project.name
101
+                    version project.version
102
+
103
+                    artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") {
104
+                        extension "aar"
105
+                    }
106
+                    artifact(androidSourcesJar)
107
+                    pom.withXml {
108
+                        def pomXml = asNode()
109
+                        pomXml.appendNode('name', project.name)
110
+                        pomXml.appendNode('description', json.description)
111
+                        pomXml.appendNode('url', json.homepage)
112
+                        if (json.license) {
113
+                            def license = pomXml.appendNode('licenses').appendNode('license')
114
+                            license.appendNode('name', json.license)
115
+                            license.appendNode('distribution', 'repo')
116
+                        }
117
+
118
+                        def dependencies = pomXml.appendNode('dependencies')
119
+                        configurations.getByName('releaseCompileClasspath').getResolvedConfiguration().getFirstLevelModuleDependencies().each {
120
+                            def artifactId = it.moduleName
121
+                            def version = it.moduleVersion
122
+                            // React Native signals breaking changes by
123
+                            // increasing the minor version number. So the
124
+                            // (third-party) React Native modules we utilize can
125
+                            // depend not on a specific react-native release but
126
+                            // a wider range.
127
+                            if (artifactId == 'react-native') {
128
+                                def versionNumber = VersionNumber.parse(version)
129
+                                version = "${versionNumber.major}.${versionNumber.minor}"
130
+                            }
131
+
132
+                            def dependency = dependencies.appendNode('dependency')
133
+                            dependency.appendNode('groupId', it.moduleGroup)
134
+                            dependency.appendNode('artifactId', artifactId)
135
+                            dependency.appendNode('version', version)
136
+                        }
137
+                    }
138
+                }
139
+            }
140
+        }
141
+    }
142
+}
143
+
144
+ext {
145
+    buildToolsVersion = "28.0.3"
146
+    compileSdkVersion = 28
147
+    minSdkVersion    = 21
148
+    targetSdkVersion = 28
149
+    supportLibVersion = "28.0.0"
150
+
151
+    // The Maven artifact groupdId of the third-party react-native modules which
152
+    // Jitsi Meet SDK for Android depends on and which are not available in
153
+    // third-party Maven repositories so we have to deploy to a Maven repository
154
+    // of ours.
155
+    moduleGroupId = 'com.facebook.react'
156
+
157
+    // Maven repo where artifacts will be published
158
+    mavenRepo = System.env.MVN_REPO ?: ""
159
+    mavenUser = System.env.MVN_USER ?: ""
160
+    mavenPassword = System.env.MVN_PASSWORD ?: ""
161
+
162
+    // Libre build
163
+    libreBuild = (System.env.LIBRE_BUILD ?: "false").toBoolean()
164
+}
165
+
166
+// Force the version of the Android build tools we have chosen on all
167
+// subprojects. The forcing was introduced for react-native and the third-party
168
+// modules that we utilize such as react-native-background-timer.
169
+subprojects { subproject ->
170
+    afterEvaluate{
171
+        if ((subproject.plugins.hasPlugin('android')
172
+                    || subproject.plugins.hasPlugin('android-library'))
173
+                && rootProject.ext.has('buildToolsVersion')) {
174
+            android {
175
+                buildToolsVersion rootProject.ext.buildToolsVersion
176
+            }
177
+        }
178
+    }
179
+}

+ 2
- 0
android/fastlane/Appfile Parādīt failu

@@ -0,0 +1,2 @@
1
+json_key_file("")
2
+package_name("org.jitsi.meet")

+ 34
- 0
android/fastlane/Fastfile Parādīt failu

@@ -0,0 +1,34 @@
1
+ENV["FASTLANE_SKIP_UPDATE_CHECK"] = "1"
2
+opt_out_usage
3
+
4
+default_platform(:android)
5
+
6
+platform :android do
7
+    desc "Deploy a new version to Goolge Play (Closed Beta)"
8
+    lane :deploy do
9
+        # Cleanup
10
+        gradle(task: "clean")
11
+
12
+        # Build and sign the app
13
+        gradle(
14
+            task: "assemble",
15
+            build_type: "Release",
16
+            print_command: false,
17
+            properties: {
18
+                "android.injected.signing.store.file" => ENV["JITSI_KEYSTORE"],
19
+                "android.injected.signing.store.password" => ENV["JITSI_KEYSTORE_PASSWORD"],
20
+                "android.injected.signing.key.alias" => ENV["JITSI_KEY_ALIAS"],
21
+                "android.injected.signing.key.password" => ENV["JITSI_KEY_PASSWORD"],
22
+            }
23
+        )
24
+
25
+        # Upload built artifact to the Closed Beta track
26
+        upload_to_play_store(
27
+            track: "beta",
28
+            json_key: ENV["JITSI_JSON_KEY_FILE"],
29
+            skip_upload_metadata: true,
30
+            skip_upload_images: true,
31
+            skip_upload_screenshots: true
32
+        )
33
+    end
34
+end

+ 29
- 0
android/fastlane/README.md Parādīt failu

@@ -0,0 +1,29 @@
1
+fastlane documentation
2
+================
3
+# Installation
4
+
5
+Make sure you have the latest version of the Xcode command line tools installed:
6
+
7
+```
8
+xcode-select --install
9
+```
10
+
11
+Install _fastlane_ using
12
+```
13
+[sudo] gem install fastlane -NV
14
+```
15
+or alternatively using `brew cask install fastlane`
16
+
17
+# Available Actions
18
+## Android
19
+### android deploy
20
+```
21
+fastlane android deploy
22
+```
23
+Deploy a new version to Goolge Play (Closed Beta)
24
+
25
+----
26
+
27
+This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
28
+More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
29
+The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

Binārs
android/fastlane/screenshots/Feature-Graphic-1024x500-1-1.png Parādīt failu


Binārs
android/fastlane/screenshots/Feature-Graphic-1024x500-1.png Parādīt failu


Binārs
android/fastlane/screenshots/Feature-Graphic-1024x500-2.png Parādīt failu


Binārs
android/fastlane/screenshots/Feature-Graphic-1024x500-3.png Parādīt failu


Binārs
android/fastlane/screenshots/GroupCall.png Parādīt failu


Binārs
android/fastlane/screenshots/GroupCall_framed.png Parādīt failu


Binārs
android/fastlane/screenshots/More Menu.png Parādīt failu


Binārs
android/fastlane/screenshots/More Menu_framed.png Parādīt failu


Binārs
android/fastlane/screenshots/Nexus 9 Body.png Parādīt failu


Binārs
android/fastlane/screenshots/Nexus-9-Landscape.png Parādīt failu


Binārs
android/fastlane/screenshots/Nexus-9-Portrait.png Parādīt failu


Binārs
android/fastlane/screenshots/Video-Call-1-1024x768.png Parādīt failu


Binārs
android/fastlane/screenshots/Video-Call-1-1280x720.png Parādīt failu


Binārs
android/fastlane/screenshots/Video-Call-2-1024x768.png Parādīt failu


Binārs
android/fastlane/screenshots/Video-Call-2-1280x720.png Parādīt failu


Binārs
android/fastlane/screenshots/WelcomePage-Calendar.png Parādīt failu


Binārs
android/fastlane/screenshots/WelcomePage-Calendar_framed.png Parādīt failu


Binārs
android/fastlane/screenshots/WelcomeScreen-1024x768.png Parādīt failu


Binārs
android/fastlane/screenshots/WelcomeScreen-1280x720.png Parādīt failu


+ 24
- 0
android/gradle.properties Parādīt failu

@@ -0,0 +1,24 @@
1
+# Project-wide Gradle settings.
2
+
3
+# IDE (e.g. Android Studio) users:
4
+# Gradle settings configured through the IDE *will override*
5
+# any settings specified in this file.
6
+
7
+# For more details on how to configure your build environment visit
8
+# http://www.gradle.org/docs/current/userguide/build_environment.html
9
+
10
+# Specifies the JVM arguments used for the daemon process.
11
+# The setting is particularly useful for tweaking memory settings.
12
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
13
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14
+
15
+# When configured, Gradle will run in incubating parallel mode.
16
+# This option should only be used with decoupled projects. More details, visit
17
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
+# org.gradle.parallel=true
19
+
20
+android.useAndroidX=true
21
+android.enableJetifier=true
22
+
23
+appVersion=20.2.0
24
+sdkVersion=2.8.0

Binārs
android/gradle/wrapper/gradle-wrapper.jar Parādīt failu


+ 6
- 0
android/gradle/wrapper/gradle-wrapper.properties Parādīt failu

@@ -0,0 +1,6 @@
1
+#Fri Mar 08 13:36:51 CET 2019
2
+distributionBase=GRADLE_USER_HOME
3
+distributionPath=wrapper/dists
4
+zipStoreBase=GRADLE_USER_HOME
5
+zipStorePath=wrapper/dists
6
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

+ 172
- 0
android/gradlew Parādīt failu

@@ -0,0 +1,172 @@
1
+#!/usr/bin/env sh
2
+
3
+##############################################################################
4
+##
5
+##  Gradle start up script for UN*X
6
+##
7
+##############################################################################
8
+
9
+# Attempt to set APP_HOME
10
+# Resolve links: $0 may be a link
11
+PRG="$0"
12
+# Need this for relative symlinks.
13
+while [ -h "$PRG" ] ; do
14
+    ls=`ls -ld "$PRG"`
15
+    link=`expr "$ls" : '.*-> \(.*\)$'`
16
+    if expr "$link" : '/.*' > /dev/null; then
17
+        PRG="$link"
18
+    else
19
+        PRG=`dirname "$PRG"`"/$link"
20
+    fi
21
+done
22
+SAVED="`pwd`"
23
+cd "`dirname \"$PRG\"`/" >/dev/null
24
+APP_HOME="`pwd -P`"
25
+cd "$SAVED" >/dev/null
26
+
27
+APP_NAME="Gradle"
28
+APP_BASE_NAME=`basename "$0"`
29
+
30
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
+DEFAULT_JVM_OPTS=""
32
+
33
+# Use the maximum available, or set MAX_FD != -1 to use that value.
34
+MAX_FD="maximum"
35
+
36
+warn () {
37
+    echo "$*"
38
+}
39
+
40
+die () {
41
+    echo
42
+    echo "$*"
43
+    echo
44
+    exit 1
45
+}
46
+
47
+# OS specific support (must be 'true' or 'false').
48
+cygwin=false
49
+msys=false
50
+darwin=false
51
+nonstop=false
52
+case "`uname`" in
53
+  CYGWIN* )
54
+    cygwin=true
55
+    ;;
56
+  Darwin* )
57
+    darwin=true
58
+    ;;
59
+  MINGW* )
60
+    msys=true
61
+    ;;
62
+  NONSTOP* )
63
+    nonstop=true
64
+    ;;
65
+esac
66
+
67
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68
+
69
+# Determine the Java command to use to start the JVM.
70
+if [ -n "$JAVA_HOME" ] ; then
71
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72
+        # IBM's JDK on AIX uses strange locations for the executables
73
+        JAVACMD="$JAVA_HOME/jre/sh/java"
74
+    else
75
+        JAVACMD="$JAVA_HOME/bin/java"
76
+    fi
77
+    if [ ! -x "$JAVACMD" ] ; then
78
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79
+
80
+Please set the JAVA_HOME variable in your environment to match the
81
+location of your Java installation."
82
+    fi
83
+else
84
+    JAVACMD="java"
85
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86
+
87
+Please set the JAVA_HOME variable in your environment to match the
88
+location of your Java installation."
89
+fi
90
+
91
+# Increase the maximum file descriptors if we can.
92
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93
+    MAX_FD_LIMIT=`ulimit -H -n`
94
+    if [ $? -eq 0 ] ; then
95
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96
+            MAX_FD="$MAX_FD_LIMIT"
97
+        fi
98
+        ulimit -n $MAX_FD
99
+        if [ $? -ne 0 ] ; then
100
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
101
+        fi
102
+    else
103
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104
+    fi
105
+fi
106
+
107
+# For Darwin, add options to specify how the application appears in the dock
108
+if $darwin; then
109
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110
+fi
111
+
112
+# For Cygwin, switch paths to Windows format before running java
113
+if $cygwin ; then
114
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116
+    JAVACMD=`cygpath --unix "$JAVACMD"`
117
+
118
+    # We build the pattern for arguments to be converted via cygpath
119
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120
+    SEP=""
121
+    for dir in $ROOTDIRSRAW ; do
122
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
123
+        SEP="|"
124
+    done
125
+    OURCYGPATTERN="(^($ROOTDIRS))"
126
+    # Add a user-defined pattern to the cygpath arguments
127
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129
+    fi
130
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
131
+    i=0
132
+    for arg in "$@" ; do
133
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
135
+
136
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
137
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138
+        else
139
+            eval `echo args$i`="\"$arg\""
140
+        fi
141
+        i=$((i+1))
142
+    done
143
+    case $i in
144
+        (0) set -- ;;
145
+        (1) set -- "$args0" ;;
146
+        (2) set -- "$args0" "$args1" ;;
147
+        (3) set -- "$args0" "$args1" "$args2" ;;
148
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154
+    esac
155
+fi
156
+
157
+# Escape application args
158
+save () {
159
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160
+    echo " "
161
+}
162
+APP_ARGS=$(save "$@")
163
+
164
+# Collect all arguments for the java command, following the shell quoting and substitution rules
165
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166
+
167
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169
+  cd "$(dirname "$0")"
170
+fi
171
+
172
+exec "$JAVACMD" "$@"

+ 84
- 0
android/gradlew.bat Parādīt failu

@@ -0,0 +1,84 @@
1
+@if "%DEBUG%" == "" @echo off
2
+@rem ##########################################################################
3
+@rem
4
+@rem  Gradle startup script for Windows
5
+@rem
6
+@rem ##########################################################################
7
+
8
+@rem Set local scope for the variables with windows NT shell
9
+if "%OS%"=="Windows_NT" setlocal
10
+
11
+set DIRNAME=%~dp0
12
+if "%DIRNAME%" == "" set DIRNAME=.
13
+set APP_BASE_NAME=%~n0
14
+set APP_HOME=%DIRNAME%
15
+
16
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
+set DEFAULT_JVM_OPTS=
18
+
19
+@rem Find java.exe
20
+if defined JAVA_HOME goto findJavaFromJavaHome
21
+
22
+set JAVA_EXE=java.exe
23
+%JAVA_EXE% -version >NUL 2>&1
24
+if "%ERRORLEVEL%" == "0" goto init
25
+
26
+echo.
27
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28
+echo.
29
+echo Please set the JAVA_HOME variable in your environment to match the
30
+echo location of your Java installation.
31
+
32
+goto fail
33
+
34
+:findJavaFromJavaHome
35
+set JAVA_HOME=%JAVA_HOME:"=%
36
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
+
38
+if exist "%JAVA_EXE%" goto init
39
+
40
+echo.
41
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42
+echo.
43
+echo Please set the JAVA_HOME variable in your environment to match the
44
+echo location of your Java installation.
45
+
46
+goto fail
47
+
48
+:init
49
+@rem Get command-line arguments, handling Windows variants
50
+
51
+if not "%OS%" == "Windows_NT" goto win9xME_args
52
+
53
+:win9xME_args
54
+@rem Slurp the command line arguments.
55
+set CMD_LINE_ARGS=
56
+set _SKIP=2
57
+
58
+:win9xME_args_slurp
59
+if "x%~1" == "x" goto execute
60
+
61
+set CMD_LINE_ARGS=%*
62
+
63
+:execute
64
+@rem Setup the command line
65
+
66
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67
+
68
+@rem Execute Gradle
69
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70
+
71
+:end
72
+@rem End local scope for the variables with windows NT shell
73
+if "%ERRORLEVEL%"=="0" goto mainEnd
74
+
75
+:fail
76
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77
+rem the _cmd.exe /c_ return code!
78
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79
+exit /b 1
80
+
81
+:mainEnd
82
+if "%OS%"=="Windows_NT" endlocal
83
+
84
+:omega

+ 8
- 0
android/keystores/BUCK Parādīt failu

@@ -0,0 +1,8 @@
1
+keystore(
2
+    name = "debug",
3
+    properties = "debug.keystore.properties",
4
+    store = "debug.keystore",
5
+    visibility = [
6
+        "PUBLIC",
7
+    ],
8
+)

+ 4
- 0
android/keystores/debug.keystore.properties Parādīt failu

@@ -0,0 +1,4 @@
1
+key.store=debug.keystore
2
+key.alias=androiddebugkey
3
+key.store.password=android
4
+key.alias.password=android

+ 111
- 0
android/scripts/release-sdk.sh Parādīt failu

@@ -0,0 +1,111 @@
1
+#!/bin/bash
2
+
3
+set -e -u
4
+
5
+
6
+THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
7
+DEFAULT_MVN_REPO="${THIS_DIR}/../../../jitsi-maven-repository/releases"
8
+THE_MVN_REPO=${MVN_REPO:-${1:-$DEFAULT_MVN_REPO}}
9
+MVN_HTTP=0
10
+DEFAULT_SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
11
+SDK_VERSION=${OVERRIDE_SDK_VERSION:-${DEFAULT_SDK_VERSION}}
12
+RN_VERSION=$(jq -r '.version' ${THIS_DIR}/../../node_modules/react-native/package.json)
13
+HERMES_VERSION=$(jq -r '.dependencies."hermes-engine"' ${THIS_DIR}/../../node_modules/react-native/package.json | cut -c 2-)
14
+DO_GIT_TAG=${GIT_TAG:-0}
15
+
16
+if [[ $THE_MVN_REPO == http* ]]; then
17
+    MVN_HTTP=1
18
+else
19
+    MVN_REPO_PATH=$(realpath $THE_MVN_REPO)
20
+    THE_MVN_REPO="file:${MVN_REPO_PATH}"
21
+fi
22
+
23
+export MVN_REPO=$THE_MVN_REPO
24
+
25
+echo "Releasing Jitsi Meet SDK ${SDK_VERSION}"
26
+echo "Using ${MVN_REPO} as the Maven repo"
27
+
28
+if [[ $MVN_HTTP == 1 ]]; then
29
+    # Push React Native
30
+    echo "Pushing React Native ${RN_VERSION} to the Maven repo"
31
+    pushd ${THIS_DIR}/../../node_modules/react-native/android/com/facebook/react/react-native/${RN_VERSION}
32
+    mvn \
33
+        deploy:deploy-file \
34
+        -Durl=${MVN_REPO} \
35
+        -DrepositoryId=${MVN_REPO_ID} \
36
+        -Dfile=react-native-${RN_VERSION}.aar \
37
+        -Dpackaging=aar \
38
+        -DgeneratePom=false \
39
+        -DpomFile=react-native-${RN_VERSION}.pom || true
40
+    popd
41
+    # Push Hermes
42
+    echo "Pushing Hermes ${HERMES_VERSION} to the Maven repo"
43
+    pushd ${THIS_DIR}/../../node_modules/hermes-engine/android/
44
+    mvn \
45
+        deploy:deploy-file \
46
+        -Durl=${MVN_REPO} \
47
+        -DrepositoryId=${MVN_REPO_ID} \
48
+        -Dfile=hermes-release.aar \
49
+        -Dpackaging=aar \
50
+        -DgroupId=com.facebook \
51
+        -DartifactId=hermes \
52
+        -Dversion=${HERMES_VERSION} \
53
+        -DgeneratePom=true || true
54
+    popd
55
+else
56
+    # Push React Native, if necessary
57
+    if [[ ! -d ${MVN_REPO}/com/facebook/react/react-native/${RN_VERSION} ]]; then
58
+        echo "Pushing React Native ${RN_VERSION} to the Maven repo"
59
+        pushd ${THIS_DIR}/../../node_modules/react-native/android/com/facebook/react/react-native/${RN_VERSION}
60
+        mvn \
61
+            deploy:deploy-file \
62
+            -Durl=${MVN_REPO} \
63
+            -Dfile=react-native-${RN_VERSION}.aar \
64
+            -Dpackaging=aar \
65
+            -DgeneratePom=false \
66
+            -DpomFile=react-native-${RN_VERSION}.pom
67
+        popd
68
+    fi
69
+
70
+    # Push Hermes, if necessary
71
+    if [[ ! -d ${MVN_REPO}/com/facebook/hermes/${HERMES_VERSION} ]]; then
72
+        echo "Pushing Hermes ${HERMES_VERSION} to the Maven repo"
73
+        pushd ${THIS_DIR}/../../node_modules/hermes-engine/android/
74
+        mvn \
75
+            deploy:deploy-file \
76
+            -Durl=${MVN_REPO} \
77
+            -Dfile=hermes-release.aar \
78
+            -Dpackaging=aar \
79
+            -DgroupId=com.facebook \
80
+            -DartifactId=hermes \
81
+            -Dversion=${HERMES_VERSION} \
82
+            -DgeneratePom=true
83
+        popd
84
+    fi
85
+
86
+    # Check if an SDK with that same version has already been released
87
+    if [[ -d ${MVN_REPO}/org/jitsi/react/jitsi-meet-sdk/${SDK_VERSION} ]]; then
88
+        echo "There is already a release with that version in the Maven repo!"
89
+        exit 1
90
+    fi
91
+fi
92
+
93
+# Now build and publish the Jitsi Meet SDK and its dependencies
94
+echo "Building and publishing the Jitsi Meet SDK"
95
+pushd ${THIS_DIR}/../
96
+./gradlew clean assembleRelease publish
97
+popd
98
+
99
+if [[ $DO_GIT_TAG == 1 ]]; then
100
+    # The artifacts are now on the Maven repo, commit them
101
+    pushd ${MVN_REPO_PATH}
102
+    git add -A .
103
+    git commit -m "Jitsi Meet SDK + dependencies: ${SDK_VERSION}"
104
+    popd
105
+
106
+    # Tag the release
107
+    git tag android-sdk-${SDK_VERSION}
108
+fi
109
+
110
+# Done!
111
+echo "Finished! Don't forget to push the tag and the Maven repo artifacts."

+ 26
- 0
android/scripts/run-packager.sh Parādīt failu

@@ -0,0 +1,26 @@
1
+#!/bin/bash
2
+
3
+# This script is executed bt Gradle to start the React packager for Debug
4
+# targets.
5
+
6
+THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
7
+
8
+export RCT_METRO_PORT="${RCT_METRO_PORT:=8081}"
9
+echo "export RCT_METRO_PORT=${RCT_METRO_PORT}" > "${THIS_DIR}/../../node_modules/react-native/scripts/.packager.env"
10
+
11
+adb reverse tcp:8081 tcp:8081
12
+
13
+if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then
14
+  if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then
15
+    echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly"
16
+    exit 2
17
+  fi
18
+else
19
+    CMD="${THIS_DIR}/../../node_modules/react-native/scripts/launchPackager.command"
20
+    if [[ `uname` == "Darwin"  ]]; then
21
+        open -g "${CMD}" || echo "Can't start packager automatically"
22
+    else
23
+        xdg-open "${CMD}" || echo "Can't start packager automatically"
24
+    fi
25
+fi
26
+

+ 6
- 0
android/sdk/.classpath Parādīt failu

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<classpath>
3
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
4
+	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5
+	<classpathentry kind="output" path="bin/default"/>
6
+</classpath>

+ 23
- 0
android/sdk/.project Parādīt failu

@@ -0,0 +1,23 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<projectDescription>
3
+	<name>sdk</name>
4
+	<comment>Project sdk created by Buildship.</comment>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+		<buildCommand>
9
+			<name>org.eclipse.jdt.core.javabuilder</name>
10
+			<arguments>
11
+			</arguments>
12
+		</buildCommand>
13
+		<buildCommand>
14
+			<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15
+			<arguments>
16
+			</arguments>
17
+		</buildCommand>
18
+	</buildSpec>
19
+	<natures>
20
+		<nature>org.eclipse.jdt.core.javanature</nature>
21
+		<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22
+	</natures>
23
+</projectDescription>

+ 2
- 0
android/sdk/.settings/org.eclipse.buildship.core.prefs Parādīt failu

@@ -0,0 +1,2 @@
1
+connection.project.dir=..
2
+eclipse.preferences.version=1

+ 250
- 0
android/sdk/build.gradle Parādīt failu

@@ -0,0 +1,250 @@
1
+import groovy.json.JsonSlurper
2
+
3
+apply plugin: 'com.android.library'
4
+apply plugin: 'maven-publish'
5
+
6
+android {
7
+    compileSdkVersion rootProject.ext.compileSdkVersion
8
+
9
+    defaultConfig {
10
+        minSdkVersion rootProject.ext.minSdkVersion
11
+        targetSdkVersion rootProject.ext.targetSdkVersion
12
+    }
13
+
14
+    buildTypes {
15
+        debug {
16
+            buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
17
+        }
18
+        release {
19
+            minifyEnabled false
20
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21
+            buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
22
+        }
23
+    }
24
+
25
+    sourceSets {
26
+        main {
27
+            java {
28
+                if (rootProject.ext.libreBuild) {
29
+                    srcDir "src"
30
+                    exclude "**/AmplitudeModule.java"
31
+                }
32
+                exclude "test/"
33
+            }
34
+        }
35
+    }
36
+
37
+    packagingOptions {
38
+        pickFirst '**/libc++_shared.so'
39
+    }
40
+}
41
+
42
+dependencies {
43
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
44
+
45
+    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
46
+    implementation 'androidx.appcompat:appcompat:1.1.0'
47
+    implementation 'androidx.fragment:fragment:1.2.0'
48
+
49
+    //noinspection GradleDynamicVersion
50
+    api 'com.facebook.react:react-native:+'
51
+
52
+    // Hermes JS engine
53
+    def hermesPath = "../../node_modules/hermes-engine/android/"
54
+    debugImplementation files(hermesPath + "hermes-debug.aar")
55
+    releaseImplementation files(hermesPath + "hermes-release.aar")
56
+
57
+    implementation 'com.dropbox.core:dropbox-core-sdk:3.0.8'
58
+    implementation 'com.jakewharton.timber:timber:4.7.1'
59
+    implementation 'com.squareup.duktape:duktape-android:1.3.0'
60
+
61
+    if (!rootProject.ext.libreBuild) {
62
+        implementation 'com.amplitude:android-sdk:2.14.1'
63
+        implementation(project(":react-native-google-signin")) {
64
+            exclude group: 'com.google.android.gms'
65
+            exclude group: 'androidx'
66
+        }
67
+    }
68
+
69
+    implementation project(':react-native-background-timer')
70
+    implementation project(':react-native-calendar-events')
71
+    implementation project(':react-native-community-async-storage')
72
+    implementation project(':react-native-community_netinfo')
73
+    implementation project(':react-native-immersive')
74
+    implementation project(':react-native-keep-awake')
75
+    implementation project(':react-native-linear-gradient')
76
+    implementation project(':react-native-sound')
77
+    implementation project(':react-native-svg')
78
+    implementation project(':react-native-webrtc')
79
+    implementation project(':react-native-webview')
80
+
81
+    testImplementation 'junit:junit:4.12'
82
+}
83
+
84
+
85
+// Here we bundle all assets, resources and React files. We cannot use the
86
+// react.gradle file provided by react-native because it's designed to be used
87
+// in an application (it taps into applicationVariants, but the SDK is a library
88
+// so we need libraryVariants instead).
89
+android.libraryVariants.all { def variant ->
90
+    // Create variant and target names
91
+    def targetName = variant.name.capitalize()
92
+    def targetPath = variant.dirName
93
+
94
+    // React js bundle directories
95
+    def jsBundleDir = file("$buildDir/generated/assets/react/${targetPath}")
96
+    def resourcesDir = file("$buildDir/generated/res/react/${targetPath}")
97
+
98
+    def jsBundleFile = file("$jsBundleDir/index.android.bundle")
99
+
100
+    def currentBundleTask = tasks.create(
101
+            name: "bundle${targetName}JsAndAssets",
102
+            type: Exec) {
103
+        group = "react"
104
+        description = "bundle JS and assets for ${targetName}."
105
+
106
+        // Create dirs if they are not there (e.g. the "clean" task just ran)
107
+        doFirst {
108
+            jsBundleDir.deleteDir()
109
+            jsBundleDir.mkdirs()
110
+            resourcesDir.deleteDir()
111
+            resourcesDir.mkdirs()
112
+        }
113
+
114
+        // Set up inputs and outputs so gradle can cache the result
115
+        def reactRoot = file("${projectDir}/../../")
116
+        inputs.files fileTree(dir: reactRoot, excludes: ["android/**", "ios/**"])
117
+        outputs.dir jsBundleDir
118
+        outputs.dir resourcesDir
119
+
120
+        // Set up the call to the react-native cli
121
+        workingDir reactRoot
122
+
123
+        // Set up dev mode
124
+        def devEnabled = !targetName.toLowerCase().contains("release")
125
+
126
+        // Run the bundler
127
+        commandLine(
128
+                "node",
129
+                "node_modules/react-native/local-cli/cli.js",
130
+                "bundle",
131
+                "--platform", "android",
132
+                "--dev", "${devEnabled}",
133
+                "--reset-cache",
134
+                "--entry-file", "index.android.js",
135
+                "--bundle-output", jsBundleFile,
136
+                "--assets-dest", resourcesDir)
137
+
138
+        // Disable bundling on dev builds
139
+        enabled !devEnabled
140
+    }
141
+
142
+    currentBundleTask.ext.generatedResFolders = files(resourcesDir).builtBy(currentBundleTask)
143
+    currentBundleTask.ext.generatedAssetsFolders = files(jsBundleDir).builtBy(currentBundleTask)
144
+    variant.registerGeneratedResFolders(currentBundleTask.generatedResFolders)
145
+
146
+    def mergeAssetsTask = variant.mergeAssetsProvider.get()
147
+    def mergeResourcesTask = variant.mergeResourcesProvider.get()
148
+
149
+    mergeAssetsTask.dependsOn(currentBundleTask)
150
+    mergeResourcesTask.dependsOn(currentBundleTask)
151
+
152
+    mergeAssetsTask.doLast {
153
+        def assetsDir = mergeAssetsTask.outputDir
154
+
155
+        // Bundle sounds
156
+        //
157
+        copy {
158
+            from("${projectDir}/../../sounds/incomingMessage.wav")
159
+            from("${projectDir}/../../sounds/joined.wav")
160
+            from("${projectDir}/../../sounds/left.wav")
161
+            from("${projectDir}/../../sounds/liveStreamingOn.mp3")
162
+            from("${projectDir}/../../sounds/liveStreamingOff.mp3")
163
+            from("${projectDir}/../../sounds/outgoingRinging.wav")
164
+            from("${projectDir}/../../sounds/outgoingStart.wav")
165
+            from("${projectDir}/../../sounds/recordingOn.mp3")
166
+            from("${projectDir}/../../sounds/recordingOff.mp3")
167
+            from("${projectDir}/../../sounds/rejected.wav")
168
+            into("${assetsDir}/sounds")
169
+        }
170
+
171
+        // Copy React assets
172
+        //
173
+        if (currentBundleTask.enabled) {
174
+            copy {
175
+                from(jsBundleFile)
176
+                into(assetsDir)
177
+            }
178
+        }
179
+    }
180
+
181
+    mergeResourcesTask.doLast {
182
+        // Copy React resources
183
+        //
184
+        if (currentBundleTask.enabled) {
185
+            copy {
186
+                from(resourcesDir)
187
+                into(mergeResourcesTask.outputDir)
188
+            }
189
+        }
190
+    }
191
+}
192
+
193
+
194
+publishing {
195
+    publications {
196
+        aarArchive(MavenPublication) {
197
+            groupId 'org.jitsi.react'
198
+            artifactId 'jitsi-meet-sdk'
199
+            version System.env.OVERRIDE_SDK_VERSION ?: project.sdkVersion
200
+
201
+            artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") {
202
+                extension "aar"
203
+            }
204
+            pom.withXml {
205
+                def pomXml = asNode()
206
+                pomXml.appendNode('name', 'jitsi-meet-sdk')
207
+                pomXml.appendNode('description', 'Jitsi Meet SDK for Android')
208
+                def dependencies = pomXml.appendNode('dependencies')
209
+                configurations.getByName('releaseCompileClasspath').getResolvedConfiguration().getFirstLevelModuleDependencies().each {
210
+                    // The (third-party) React Native modules that we depend on
211
+                    // are in source code form and do not have groupId. That is
212
+                    // why we have a dedicated groupId for them. But the other
213
+                    // dependencies come through Maven and, consequently, have
214
+                    // groupId.
215
+                    def groupId = it.moduleGroup
216
+                    def artifactId = it.moduleName
217
+
218
+                    if (artifactId.startsWith('react-native-') && groupId.equals('jitsi-meet')) {
219
+                        groupId = rootProject.ext.moduleGroupId
220
+                    }
221
+
222
+                    def dependency = dependencies.appendNode('dependency')
223
+                    dependency.appendNode('groupId', groupId)
224
+                    dependency.appendNode('artifactId', artifactId)
225
+                    dependency.appendNode('version', it.moduleVersion)
226
+                }
227
+
228
+                // Add Hermes dependency.
229
+                def hermesPkg = new File("$rootDir/../node_modules/hermes-engine/package.json")
230
+                def hermesVersion = new JsonSlurper().parseText(hermesPkg.text).version
231
+                def hermesDependency = dependencies.appendNode('dependency')
232
+                hermesDependency.appendNode('groupId', "com.facebook")
233
+                hermesDependency.appendNode('artifactId', "hermes")
234
+                hermesDependency.appendNode('version', hermesVersion)
235
+            }
236
+        }
237
+
238
+    }
239
+    repositories {
240
+        maven {
241
+            url rootProject.ext.mavenRepo
242
+            if (!rootProject.ext.mavenRepo.startsWith("file")) {
243
+                credentials {
244
+                    username rootProject.ext.mavenUser
245
+                    password rootProject.ext.mavenPassword
246
+                }
247
+            }
248
+        }
249
+    }
250
+}

+ 52
- 0
android/sdk/src/main/AndroidManifest.xml Parādīt failu

@@ -0,0 +1,52 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+    package="org.jitsi.meet.sdk">
4
+    <!-- XXX ACCESS_NETWORK_STATE is required by WebRTC. -->
5
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6
+    <uses-permission android:name="android.permission.BLUETOOTH" />
7
+    <uses-permission android:name="android.permission.CAMERA" />
8
+    <uses-permission android:name="android.permission.INTERNET" />
9
+    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
10
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
11
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
12
+    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
13
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
14
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
15
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
16
+
17
+    <uses-feature
18
+        android:glEsVersion="0x00020000"
19
+        android:required="true" />
20
+    <uses-feature
21
+        android:name="android.hardware.camera"
22
+        android:required="false" />
23
+    <uses-feature
24
+        android:name="android.hardware.camera.autofocus"
25
+        android:required="false" />
26
+
27
+    <application
28
+        android:allowBackup="true"
29
+        android:label="@string/app_name"
30
+        android:supportsRtl="true">
31
+        <activity
32
+            android:name=".JitsiMeetActivity"
33
+            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize"
34
+            android:launchMode="singleTask"
35
+            android:resizeableActivity="true"
36
+            android:supportsPictureInPicture="true"
37
+            android:windowSoftInputMode="adjustResize">
38
+        </activity>
39
+        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
40
+
41
+        <service
42
+            android:name=".ConnectionService"
43
+            android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE">
44
+            <intent-filter>
45
+                <action android:name="android.telecom.ConnectionService" />
46
+            </intent-filter>
47
+        </service>
48
+
49
+        <service android:name="org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService" />
50
+    </application>
51
+
52
+</manifest>

+ 114
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/AmplitudeModule.java Parādīt failu

@@ -0,0 +1,114 @@
1
+/*
2
+ * Copyright @ 2019-present 8x8, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package org.jitsi.meet.sdk;
18
+
19
+import android.annotation.SuppressLint;
20
+import android.provider.Settings;
21
+import android.text.TextUtils;
22
+
23
+import com.facebook.react.bridge.ReactApplicationContext;
24
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
25
+import com.facebook.react.bridge.ReactMethod;
26
+import com.facebook.react.bridge.ReadableMap;
27
+
28
+import com.amplitude.api.Amplitude;
29
+import com.facebook.react.module.annotations.ReactModule;
30
+
31
+import org.jitsi.meet.sdk.log.JitsiMeetLogger;
32
+import org.json.JSONException;
33
+import org.json.JSONObject;
34
+
35
+/**
36
+ * Implements the react-native module for the Amplitude integration.
37
+ */
38
+@ReactModule(name = AmplitudeModule.NAME)
39
+class AmplitudeModule
40
+        extends ReactContextBaseJavaModule {
41
+
42
+    public static final String NAME = "Amplitude";
43
+
44
+    public AmplitudeModule(ReactApplicationContext reactContext) {
45
+        super(reactContext);
46
+    }
47
+
48
+    /**
49
+     * Initializes the Amplitude SDK.
50
+     *
51
+     * @param instanceName The name of the Amplitude instance. Should
52
+     * be used only for multi-project logging.
53
+     * @param apiKey The API_KEY of the Amplitude project.
54
+     */
55
+    @ReactMethod
56
+    @SuppressLint("HardwareIds")
57
+    public void init(String instanceName, String apiKey) {
58
+        Amplitude.getInstance(instanceName).initialize(getCurrentActivity(), apiKey);
59
+
60
+        // Set the device ID to something consistent.
61
+        String android_id
62
+            = Settings.Secure.getString(getReactApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);
63
+        if (!TextUtils.isEmpty(android_id)) {
64
+            Amplitude.getInstance(instanceName).setDeviceId(android_id);
65
+        }
66
+    }
67
+
68
+    /**
69
+     * Sets the user ID for an Amplitude instance.
70
+     *
71
+     * @param instanceName The name of the Amplitude instance.
72
+     * @param userId The new value for the user ID.
73
+     */
74
+    @ReactMethod
75
+    public void setUserId(String instanceName, String userId) {
76
+            Amplitude.getInstance(instanceName).setUserId(userId);
77
+    }
78
+
79
+    /**
80
+     * Sets the user properties for an Amplitude instance.
81
+     *
82
+     * @param instanceName The name of the Amplitude instance.
83
+     * @param userProps JSON string with user properties to be set.
84
+     */
85
+    @ReactMethod
86
+    public void setUserProperties(String instanceName, ReadableMap userProps) {
87
+        if (userProps != null) {
88
+            Amplitude.getInstance(instanceName).setUserProperties(
89
+                    new JSONObject(userProps.toHashMap()));
90
+        }
91
+    }
92
+
93
+    /**
94
+     * Log an analytics event.
95
+     *
96
+     * @param instanceName The name of the Amplitude instance.
97
+     * @param eventType The event type.
98
+     * @param eventPropsString JSON string with the event properties.
99
+     */
100
+    @ReactMethod
101
+    public void logEvent(String instanceName, String eventType, String eventPropsString) {
102
+        try {
103
+            JSONObject eventProps = new JSONObject(eventPropsString);
104
+            Amplitude.getInstance(instanceName).logEvent(eventType, eventProps);
105
+        } catch (JSONException e) {
106
+            JitsiMeetLogger.e(e, "Error logging event");
107
+        }
108
+    }
109
+
110
+    @Override
111
+    public String getName() {
112
+        return NAME;
113
+    }
114
+}

+ 56
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/AndroidSettingsModule.java Parādīt failu

@@ -0,0 +1,56 @@
1
+/**
2
+ * Adapted from
3
+ * {@link https://github.com/Aleksandern/react-native-android-settings-library}.
4
+ */
5
+
6
+package org.jitsi.meet.sdk;
7
+
8
+import android.content.ActivityNotFoundException;
9
+import android.content.Context;
10
+import android.content.Intent;
11
+import android.net.Uri;
12
+import android.provider.Settings;
13
+
14
+import com.facebook.react.bridge.Promise;
15
+import com.facebook.react.bridge.ReactApplicationContext;
16
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
17
+import com.facebook.react.bridge.ReactMethod;
18
+import com.facebook.react.module.annotations.ReactModule;
19
+
20
+@ReactModule(name = AndroidSettingsModule.NAME)
21
+class AndroidSettingsModule
22
+    extends ReactContextBaseJavaModule {
23
+
24
+    public static final String NAME = "AndroidSettings";
25
+
26
+    public AndroidSettingsModule(ReactApplicationContext reactContext) {
27
+        super(reactContext);
28
+    }
29
+
30
+    @Override
31
+    public String getName() {
32
+        return NAME;
33
+    }
34
+
35
+    @ReactMethod
36
+    public void open(Promise promise) {
37
+        Context context = getReactApplicationContext();
38
+        Intent intent = new Intent();
39
+
40
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
41
+        intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
42
+        intent.setData(
43
+            Uri.fromParts("package", context.getPackageName(), null));
44
+
45
+        try {
46
+            context.startActivity(intent);
47
+        } catch (ActivityNotFoundException e) {
48
+            // Some devices may give an error here.
49
+            // https://developer.android.com/reference/android/provider/Settings.html#ACTION_APPLICATION_DETAILS_SETTINGS
50
+            promise.reject(e);
51
+            return;
52
+        }
53
+
54
+        promise.resolve(null);
55
+    }
56
+}

+ 87
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/AppInfoModule.java Parādīt failu

@@ -0,0 +1,87 @@
1
+/*
2
+ * Copyright @ 2017-present Atlassian Pty Ltd
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package org.jitsi.meet.sdk;
18
+
19
+import android.content.Context;
20
+import android.content.pm.ApplicationInfo;
21
+import android.content.pm.PackageInfo;
22
+import android.content.pm.PackageManager;
23
+
24
+import com.facebook.react.bridge.ReactApplicationContext;
25
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
26
+import com.facebook.react.module.annotations.ReactModule;
27
+
28
+import java.util.HashMap;
29
+import java.util.Map;
30
+
31
+@ReactModule(name = AppInfoModule.NAME)
32
+class AppInfoModule
33
+    extends ReactContextBaseJavaModule {
34
+
35
+    public static final String NAME = "AppInfo";
36
+
37
+    public AppInfoModule(ReactApplicationContext reactContext) {
38
+        super(reactContext);
39
+    }
40
+
41
+    /**
42
+     * Gets a {@code Map} of constants this module exports to JS. Supports JSON
43
+     * types.
44
+     *
45
+     * @return a {@link Map} of constants this module exports to JS
46
+     */
47
+    @Override
48
+    public Map<String, Object> getConstants() {
49
+        Context context = getReactApplicationContext();
50
+        PackageManager packageManager = context.getPackageManager();
51
+        ApplicationInfo applicationInfo;
52
+        PackageInfo packageInfo;
53
+
54
+        try {
55
+             String packageName = context.getPackageName();
56
+
57
+             applicationInfo
58
+                 = packageManager.getApplicationInfo(packageName, 0);
59
+             packageInfo = packageManager.getPackageInfo(packageName, 0);
60
+        } catch (PackageManager.NameNotFoundException e) {
61
+             applicationInfo = null;
62
+             packageInfo = null;
63
+        }
64
+
65
+        Map<String, Object> constants = new HashMap<>();
66
+
67
+        constants.put(
68
+            "buildNumber",
69
+            packageInfo == null ? "" : String.valueOf(packageInfo.versionCode));
70
+        constants.put(
71
+            "name",
72
+            applicationInfo == null
73
+                ? ""
74
+                : packageManager.getApplicationLabel(applicationInfo));
75
+        constants.put(
76
+            "version",
77
+            packageInfo == null ? "" : packageInfo.versionName);
78
+        constants.put("LIBRE_BUILD", BuildConfig.LIBRE_BUILD);
79
+
80
+        return constants;
81
+    }
82
+
83
+    @Override
84
+    public String getName() {
85
+        return NAME;
86
+    }
87
+}

+ 183
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/AudioDeviceHandlerConnectionService.java Parādīt failu

@@ -0,0 +1,183 @@
1
+/*
2
+ * Copyright @ 2017-present 8x8, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package org.jitsi.meet.sdk;
18
+
19
+import android.content.Context;
20
+import android.media.AudioManager;
21
+import android.os.Build;
22
+import android.telecom.CallAudioState;
23
+import androidx.annotation.RequiresApi;
24
+
25
+import java.util.HashSet;
26
+import java.util.Set;
27
+
28
+import org.jitsi.meet.sdk.log.JitsiMeetLogger;
29
+
30
+
31
+/**
32
+ * {@link AudioModeModule.AudioDeviceHandlerInterface} module implementing device handling for
33
+ * Android versions >= O when ConnectionService is enabled.
34
+ */
35
+@RequiresApi(Build.VERSION_CODES.O)
36
+class AudioDeviceHandlerConnectionService implements
37
+        AudioModeModule.AudioDeviceHandlerInterface,
38
+        RNConnectionService.CallAudioStateListener {
39
+
40
+    private final static String TAG = AudioDeviceHandlerConnectionService.class.getSimpleName();
41
+
42
+    /**
43
+     * {@link AudioManager} instance used to interact with the Android audio subsystem.
44
+     */
45
+    private AudioManager audioManager;
46
+
47
+    /**
48
+     * Reference to the main {@code AudioModeModule}.
49
+     */
50
+    private AudioModeModule module;
51
+
52
+    /**
53
+     * Converts any of the "DEVICE_" constants into the corresponding
54
+     * {@link android.telecom.CallAudioState} "ROUTE_" number.
55
+     *
56
+     * @param audioDevice one of the "DEVICE_" constants.
57
+     * @return a route number {@link android.telecom.CallAudioState#ROUTE_EARPIECE} if
58
+     * no match is found.
59
+     */
60
+    private static int audioDeviceToRouteInt(String audioDevice) {
61
+        if (audioDevice == null) {
62
+            return CallAudioState.ROUTE_SPEAKER;
63
+        }
64
+        switch (audioDevice) {
65
+            case AudioModeModule.DEVICE_BLUETOOTH:
66
+                return CallAudioState.ROUTE_BLUETOOTH;
67
+            case AudioModeModule.DEVICE_EARPIECE:
68
+                return CallAudioState.ROUTE_EARPIECE;
69
+            case AudioModeModule.DEVICE_HEADPHONES:
70
+                return CallAudioState.ROUTE_WIRED_HEADSET;
71
+            case AudioModeModule.DEVICE_SPEAKER:
72
+                return CallAudioState.ROUTE_SPEAKER;
73
+            default:
74
+                JitsiMeetLogger.e(TAG + " Unsupported device name: " + audioDevice);
75
+                return CallAudioState.ROUTE_SPEAKER;
76
+        }
77
+    }
78
+
79
+    /**
80
+     * Populates given route mask into the "DEVICE_" list.
81
+     *
82
+     * @param supportedRouteMask an integer coming from
83
+     * {@link android.telecom.CallAudioState#getSupportedRouteMask()}.
84
+     * @return a list of device names.
85
+     */
86
+    private static Set<String> routesToDeviceNames(int supportedRouteMask) {
87
+        Set<String> devices = new HashSet<>();
88
+        if ((supportedRouteMask & CallAudioState.ROUTE_EARPIECE) == CallAudioState.ROUTE_EARPIECE) {
89
+            devices.add(AudioModeModule.DEVICE_EARPIECE);
90
+        }
91
+        if ((supportedRouteMask & CallAudioState.ROUTE_BLUETOOTH) == CallAudioState.ROUTE_BLUETOOTH) {
92
+            devices.add(AudioModeModule.DEVICE_BLUETOOTH);
93
+        }
94
+        if ((supportedRouteMask & CallAudioState.ROUTE_SPEAKER) == CallAudioState.ROUTE_SPEAKER) {
95
+            devices.add(AudioModeModule.DEVICE_SPEAKER);
96
+        }
97
+        if ((supportedRouteMask & CallAudioState.ROUTE_WIRED_HEADSET) == CallAudioState.ROUTE_WIRED_HEADSET) {
98
+            devices.add(AudioModeModule.DEVICE_HEADPHONES);
99
+        }
100
+        return devices;
101
+    }
102
+
103
+    /**
104
+     * Used to store the most recently reported audio devices.
105
+     * Makes it easier to compare for a change, because the devices are stored
106
+     * as a mask in the {@link android.telecom.CallAudioState}. The mask is populated into
107
+     * the {@code availableDevices} on each update.
108
+     */
109
+    private int supportedRouteMask = -1;
110
+
111
+    public AudioDeviceHandlerConnectionService(AudioManager audioManager) {
112
+        this.audioManager = audioManager;
113
+    }
114
+
115
+    @Override
116
+    public void onCallAudioStateChange(final CallAudioState state) {
117
+        module.runInAudioThread(new Runnable() {
118
+            @Override
119
+            public void run() {
120
+                boolean audioRouteChanged
121
+                    = audioDeviceToRouteInt(module.getSelectedDevice()) != state.getRoute();
122
+                int newSupportedRoutes = state.getSupportedRouteMask();
123
+                boolean audioDevicesChanged = supportedRouteMask != newSupportedRoutes;
124
+                if (audioDevicesChanged) {
125
+                    supportedRouteMask = newSupportedRoutes;
126
+                    Set<String> devices = routesToDeviceNames(supportedRouteMask);
127
+                    module.replaceDevices(devices);
128
+                    JitsiMeetLogger.i(TAG + " Available audio devices: " + devices.toString());
129
+                }
130
+
131
+                if (audioRouteChanged || audioDevicesChanged) {
132
+                    module.resetSelectedDevice();
133
+                    module.updateAudioRoute();
134
+                }
135
+            }
136
+        });
137
+    }
138
+
139
+    @Override
140
+    public void start(AudioModeModule audioModeModule) {
141
+        JitsiMeetLogger.i("Using " + TAG + " as the audio device handler");
142
+
143
+        module = audioModeModule;
144
+
145
+        RNConnectionService rcs = ReactInstanceManagerHolder.getNativeModule(RNConnectionService.class);
146
+        if (rcs != null) {
147
+            rcs.setCallAudioStateListener(this);
148
+        } else {
149
+            JitsiMeetLogger.w(TAG + " Couldn't set call audio state listener, module is null");
150
+        }
151
+    }
152
+
153
+    @Override
154
+    public void stop() {
155
+        RNConnectionService rcs = ReactInstanceManagerHolder.getNativeModule(RNConnectionService.class);
156
+        if (rcs != null) {
157
+            rcs.setCallAudioStateListener(null);
158
+        } else {
159
+            JitsiMeetLogger.w(TAG + " Couldn't set call audio state listener, module is null");
160
+        }
161
+    }
162
+
163
+    public void setAudioRoute(String audioDevice) {
164
+        int newAudioRoute = audioDeviceToRouteInt(audioDevice);
165
+
166
+        RNConnectionService.setAudioRoute(newAudioRoute);
167
+    }
168
+
169
+    @Override
170
+    public boolean setMode(int mode) {
171
+        if (mode != AudioModeModule.DEFAULT) {
172
+            // This shouldn't be needed when using ConnectionService, but some devices have been
173
+            // observed not doing it.
174
+            try {
175
+                audioManager.setMicrophoneMute(false);
176
+            } catch (Throwable tr) {
177
+                JitsiMeetLogger.w(tr, TAG + " Failed to unmute the microphone");
178
+            }
179
+        }
180
+
181
+        return true;
182
+    }
183
+}

+ 231
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/AudioDeviceHandlerGeneric.java Parādīt failu

@@ -0,0 +1,231 @@
1
+/*
2
+ * Copyright @ 2017-present 8x8, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package org.jitsi.meet.sdk;
18
+
19
+import android.content.Context;
20
+import android.media.AudioDeviceInfo;
21
+import android.media.AudioManager;
22
+import android.os.Build;
23
+import androidx.annotation.RequiresApi;
24
+
25
+import java.util.HashSet;
26
+import java.util.Set;
27
+
28
+import org.jitsi.meet.sdk.log.JitsiMeetLogger;
29
+
30
+
31
+/**
32
+ * {@link AudioModeModule.AudioDeviceHandlerInterface} module implementing device handling for
33
+ * all post-M Android versions. This handler can be used on any Android versions >= M, but by
34
+ * default it's only used on versions < O, since versions >= O use ConnectionService, but it
35
+ * can be disabled.
36
+ */
37
+@RequiresApi(Build.VERSION_CODES.M)
38
+class AudioDeviceHandlerGeneric implements
39
+        AudioModeModule.AudioDeviceHandlerInterface,
40
+        AudioManager.OnAudioFocusChangeListener {
41
+
42
+    private final static String TAG = AudioDeviceHandlerGeneric.class.getSimpleName();
43
+
44
+    /**
45
+     * Reference to the main {@code AudioModeModule}.
46
+     */
47
+    private AudioModeModule module;
48
+
49
+    /**
50
+     * Constant defining a USB headset. Only available on API level >= 26.
51
+     * The value of: AudioDeviceInfo.TYPE_USB_HEADSET
52
+     */
53
+    private static final int TYPE_USB_HEADSET = 22;
54
+
55
+    /**
56
+     * Indicator that we have lost audio focus.
57
+     */
58
+    private boolean audioFocusLost = false;
59
+
60
+    /**
61
+     * {@link AudioManager} instance used to interact with the Android audio
62
+     * subsystem.
63
+     */
64
+    private AudioManager audioManager;
65
+
66
+    /**
67
+     * {@link Runnable} for running audio device detection the main thread.
68
+     * This is only used on Android >= M.
69
+     */
70
+    private final Runnable onAudioDeviceChangeRunner = new Runnable() {
71
+        @Override
72
+        public void run() {
73
+            Set<String> devices = new HashSet<>();
74
+            AudioDeviceInfo[] deviceInfos = audioManager.getDevices(AudioManager.GET_DEVICES_ALL);
75
+
76
+            for (AudioDeviceInfo info: deviceInfos) {
77
+                switch (info.getType()) {
78
+                    case AudioDeviceInfo.TYPE_BLUETOOTH_SCO:
79
+                        devices.add(AudioModeModule.DEVICE_BLUETOOTH);
80
+                        break;
81
+                    case AudioDeviceInfo.TYPE_BUILTIN_EARPIECE:
82
+                        devices.add(AudioModeModule.DEVICE_EARPIECE);
83
+                        break;
84
+                    case AudioDeviceInfo.TYPE_BUILTIN_SPEAKER:
85
+                        devices.add(AudioModeModule.DEVICE_SPEAKER);
86
+                        break;
87
+                    case AudioDeviceInfo.TYPE_WIRED_HEADPHONES:
88
+                    case AudioDeviceInfo.TYPE_WIRED_HEADSET:
89
+                    case TYPE_USB_HEADSET:
90
+                        devices.add(AudioModeModule.DEVICE_HEADPHONES);
91
+                        break;
92
+                }
93
+            }
94
+
95
+            module.replaceDevices(devices);
96
+
97
+            JitsiMeetLogger.i(TAG + " Available audio devices: " + devices.toString());
98
+
99
+            module.updateAudioRoute();
100
+        }
101
+    };
102
+
103
+    private final android.media.AudioDeviceCallback audioDeviceCallback =
104
+        new android.media.AudioDeviceCallback() {
105
+            @Override
106
+            public void onAudioDevicesAdded(
107
+                AudioDeviceInfo[] addedDevices) {
108
+                JitsiMeetLogger.d(TAG + " Audio devices added");
109
+                onAudioDeviceChange();
110
+            }
111
+
112
+            @Override
113
+            public void onAudioDevicesRemoved(
114
+                AudioDeviceInfo[] removedDevices) {
115
+                JitsiMeetLogger.d(TAG + " Audio devices removed");
116
+                onAudioDeviceChange();
117
+            }
118
+        };
119
+
120
+    public AudioDeviceHandlerGeneric(AudioManager audioManager) {
121
+        this.audioManager = audioManager;
122
+    }
123
+
124
+    /**
125
+     * Helper method to trigger an audio route update when devices change. It
126
+     * makes sure the operation is performed on the audio thread.
127
+     */
128
+    private void onAudioDeviceChange() {
129
+        module.runInAudioThread(onAudioDeviceChangeRunner);
130
+    }
131
+
132
+    /**
133
+     * {@link AudioManager.OnAudioFocusChangeListener} interface method. Called
134
+     * when the audio focus of the system is updated.
135
+     *
136
+     * @param focusChange - The type of focus change.
137
+     */
138
+    @Override
139
+    public void onAudioFocusChange(final int focusChange) {
140
+        module.runInAudioThread(new Runnable() {
141
+            @Override
142
+            public void run() {
143
+                switch (focusChange) {
144
+                    case AudioManager.AUDIOFOCUS_GAIN: {
145
+                        JitsiMeetLogger.d(TAG + " Audio focus gained");
146
+                        // Some other application potentially stole our audio focus
147
+                        // temporarily. Restore our mode.
148
+                        if (audioFocusLost) {
149
+                            module.updateAudioRoute();
150
+                        }
151
+                        audioFocusLost = false;
152
+                        break;
153
+                    }
154
+                    case AudioManager.AUDIOFOCUS_LOSS:
155
+                    case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
156
+                    case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK: {
157
+                        JitsiMeetLogger.d(TAG + " Audio focus lost");
158
+                        audioFocusLost = true;
159
+                        break;
160
+                    }
161
+                }
162
+            }
163
+        });
164
+    }
165
+
166
+    /**
167
+     * Helper method to set the output route to a Bluetooth device.
168
+     *
169
+     * @param enabled true if Bluetooth should use used, false otherwise.
170
+     */
171
+    private void setBluetoothAudioRoute(boolean enabled) {
172
+        if (enabled) {
173
+            audioManager.startBluetoothSco();
174
+            audioManager.setBluetoothScoOn(true);
175
+        } else {
176
+            audioManager.setBluetoothScoOn(false);
177
+            audioManager.stopBluetoothSco();
178
+        }
179
+    }
180
+
181
+    @Override
182
+    public void start(AudioModeModule audioModeModule) {
183
+        JitsiMeetLogger.i("Using " + TAG + " as the audio device handler");
184
+
185
+        module = audioModeModule;
186
+
187
+        // Setup runtime device change detection.
188
+        audioManager.registerAudioDeviceCallback(audioDeviceCallback, null);
189
+
190
+        // Do an initial detection.
191
+        onAudioDeviceChange();
192
+    }
193
+
194
+    @Override
195
+    public void stop() {
196
+        audioManager.unregisterAudioDeviceCallback(audioDeviceCallback);
197
+    }
198
+
199
+    @Override
200
+    public void setAudioRoute(String device) {
201
+        // Turn speaker on / off
202
+        audioManager.setSpeakerphoneOn(device.equals(AudioModeModule.DEVICE_SPEAKER));
203
+
204
+        // Turn bluetooth on / off
205
+        setBluetoothAudioRoute(device.equals(AudioModeModule.DEVICE_BLUETOOTH));
206
+    }
207
+
208
+    @Override
209
+    public boolean setMode(int mode) {
210
+        if (mode == AudioModeModule.DEFAULT) {
211
+            audioFocusLost = false;
212
+            audioManager.setMode(AudioManager.MODE_NORMAL);
213
+            audioManager.abandonAudioFocus(this);
214
+            audioManager.setSpeakerphoneOn(false);
215
+            setBluetoothAudioRoute(false);
216
+
217
+            return true;
218
+        }
219
+
220
+        audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
221
+        audioManager.setMicrophoneMute(false);
222
+
223
+        if (audioManager.requestAudioFocus(this, AudioManager.STREAM_VOICE_CALL, AudioManager.AUDIOFOCUS_GAIN)
224
+            == AudioManager.AUDIOFOCUS_REQUEST_FAILED) {
225
+            JitsiMeetLogger.w(TAG + " Audio focus request failed");
226
+            return false;
227
+        }
228
+
229
+        return true;
230
+    }
231
+}

+ 0
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/AudioDeviceHandlerLegacy.java Parādīt failu


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels

Notiek ielāde…
Atcelt
Saglabāt