|
17 | 17 | under the License.
|
18 | 18 | */
|
19 | 19 |
|
20 |
| -const execa = require('execa'); |
21 | 20 | const path = require('node:path');
|
22 | 21 | const fs = require('node:fs');
|
23 | 22 | const { forgivingWhichSync, isWindows, isDarwin } = require('./utils');
|
@@ -104,46 +103,7 @@ function getUserCompileSdkVersion (projectRoot) {
|
104 | 103 | }
|
105 | 104 |
|
106 | 105 | module.exports.get_gradle_wrapper = function () {
|
107 |
| - let androidStudioPath; |
108 |
| - let i = 0; |
109 |
| - let foundStudio = false; |
110 |
| - let program_dir; |
111 |
| - // OK, This hack only works on Windows, not on Mac OS or Linux. We will be deleting this eventually! |
112 |
| - if (module.exports.isWindows()) { |
113 |
| - // "shell" option enabled for CVE-2024-27980 (Windows) Mitigation |
114 |
| - // See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2 for more details |
115 |
| - const result = execa.sync(path.join(__dirname, 'getASPath.bat'), { shell: true }); |
116 |
| - // console.log('result.stdout =' + result.stdout.toString()); |
117 |
| - // console.log('result.stderr =' + result.stderr.toString()); |
118 |
| - |
119 |
| - if (result.stderr.toString().length > 0) { |
120 |
| - const androidPath = path.join(process.env.ProgramFiles, 'Android') + '/'; |
121 |
| - if (fs.existsSync(androidPath)) { |
122 |
| - program_dir = fs.readdirSync(androidPath); |
123 |
| - while (i < program_dir.length && !foundStudio) { |
124 |
| - if (program_dir[i].startsWith('Android Studio')) { |
125 |
| - foundStudio = true; |
126 |
| - androidStudioPath = path.join(process.env.ProgramFiles, 'Android', program_dir[i], 'gradle'); |
127 |
| - } else { ++i; } |
128 |
| - } |
129 |
| - } |
130 |
| - } else { |
131 |
| - // console.log('got android studio path from registry'); |
132 |
| - // remove the (os independent) new line char at the end of stdout |
133 |
| - // add gradle to match the above. |
134 |
| - androidStudioPath = path.join(result.stdout.toString().split('\r\n')[0], 'gradle'); |
135 |
| - } |
136 |
| - } |
137 |
| - |
138 |
| - if (androidStudioPath !== null && fs.existsSync(androidStudioPath)) { |
139 |
| - const dirs = fs.readdirSync(androidStudioPath); |
140 |
| - if (dirs[0].split('-')[0] === 'gradle') { |
141 |
| - return path.join(androidStudioPath, dirs[0], 'bin', 'gradle'); |
142 |
| - } |
143 |
| - } else { |
144 |
| - // OK, let's try to check for Gradle! |
145 |
| - return forgivingWhichSync('gradle'); |
146 |
| - } |
| 106 | + return forgivingWhichSync('gradle'); |
147 | 107 | };
|
148 | 108 |
|
149 | 109 | // Returns a promise. Called only by build and clean commands.
|
|
0 commit comments