|
1 | 1 | (function() { |
2 | 2 | // properties |
3 | | - |
4 | | - |
5 | 3 |
|
6 | 4 | const path = require("path"); |
7 | 5 | const xmlHelper = require("../lib/xmlHelper.js"); |
|
67 | 65 | ); |
68 | 66 | manifest = xmlHelper.readXmlAsJson(pathToManifest); |
69 | 67 | } catch (e) { |
70 | | - throw new Error(`BRANCH SDK: Cannot read AndroidManfiest.xml ${ e}`); |
| 68 | + throw new Error(`BRANCH SDK: Cannot read AndroidManfiest.xml ${e}`); |
71 | 69 | } |
72 | 70 | } |
73 | 71 | const mainActivityIndex = getMainLaunchActivityIndex( |
|
91 | 89 | let metadatas = manifest.manifest.application[0]["meta-data"] || []; |
92 | 90 | const metadata = []; |
93 | 91 | const keys = ["io.branch.sdk.BranchKey", "io.branch.sdk.TestMode"]; |
94 | | - const vals = [preferences.branchKey, preferences.androidTestMode || "false"]; |
| 92 | + const vals = [ |
| 93 | + preferences.branchKey, |
| 94 | + preferences.androidTestMode || "false" |
| 95 | + ]; |
95 | 96 |
|
96 | 97 | // remove old |
97 | 98 | for (var i = 0; i < keys.length; i++) { |
|
109 | 110 | } |
110 | 111 | }); |
111 | 112 | } |
112 | | - manifest.manifest.application[0]["meta-data"] = metadatas.concat( |
113 | | - metadata |
114 | | - ); |
| 113 | + manifest.manifest.application[0]["meta-data"] = metadatas.concat(metadata); |
115 | 114 |
|
116 | 115 | return manifest; |
117 | 116 | } |
|
298 | 297 | .split(".") |
299 | 298 | .slice(1) |
300 | 299 | .join("."); |
301 | | - const alternate = `${first }-alternate` + `.${ rest}`; |
| 300 | + const alternate = `${first}-alternate` + `.${rest}`; |
302 | 301 |
|
303 | 302 | intentFilterData.push(getAppLinkIntentFilterDictionary(linkDomain)); |
304 | 303 | intentFilterData.push(getAppLinkIntentFilterDictionary(alternate)); |
305 | 304 | } else { |
306 | | - // bnc.lt and custom domains |
307 | | - if (preferences.androidPrefix === null) { |
| 305 | + // bnc.lt |
| 306 | + if ( |
| 307 | + linkDomain.indexOf("bnc.lt") !== -1 && |
| 308 | + preferences.androidPrefix === null |
| 309 | + ) { |
308 | 310 | throw new Error( |
309 | 311 | 'BRANCH SDK: Invalid "android-prefix" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP' |
310 | 312 | ); |
|
343 | 345 | const without = []; |
344 | 346 | for (let i = 0; i < items.length; i++) { |
345 | 347 | const item = items[i]; |
346 | | - if ( |
347 | | - item.hasOwnProperty("$") && |
348 | | - item.$.hasOwnProperty("android:name") |
349 | | - ) { |
| 348 | + if (item.hasOwnProperty("$") && item.$.hasOwnProperty("android:name")) { |
350 | 349 | const key = item.$["android:name"]; |
351 | 350 | if (key === androidName) { |
352 | 351 | continue; |
|
383 | 382 | return false; |
384 | 383 | } |
385 | 384 |
|
386 | | - isLauncher = intentFilters.some((intentFilter) => { |
| 385 | + isLauncher = intentFilters.some(intentFilter => { |
387 | 386 | const action = intentFilter.action; |
388 | 387 | const category = intentFilter.category; |
389 | 388 |
|
|
0 commit comments