This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Required for adding a custom IActivityController class --> | |
<uses-permission android:name="android.permission.SET_ACTIVITY_WATCHER"/> | |
<!-- Required for granting permissions to the app under test --> | |
<uses-permission android:name="android.permission.GRANT_REVOKE_PERMISSIONS"/> | |
<!-- Restricted permissions --> | |
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"/> | |
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/> | |
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Allows an application to watch and control how activities are started globally in the system. --> | |
<permission android:name="android.permission.SET_ACTIVITY_WATCHER" android:protectionLevel="signature" /> | |
<!-- Allows an application to grant specific permissions. --> | |
<permission android:name="android.permission.GRANT_RUNTIME_PERMISSIONS" android:protectionLevel="signature|installer|verifier" /> | |
<!-- Modify the global animation scaling factor. --> | |
<permission android:name="android.permission.SET_ANIMATION_SCALE" android:protectionLevel="signature|privileged|development" /> | |
<!-- Allows an application to modify the current configuration, such as locale. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static boolean locationIsPrivileged(File path) { | |
try { | |
final String privilegedAppDir = new File(Environment.getRootDirectory(), "priv-app") | |
.getCanonicalPath(); | |
return path.getCanonicalPath().startsWith(privilegedAppDir); | |
} catch (IOException e) { | |
Slog.e(TAG, "Unable to access code path " + path); | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest | |
... | |
android:sharedUserId="android.uid.system" | |
... | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean grantSignaturePermission(String perm, PackageParser.Package pkg, | |
BasePermission bp, PermissionsState origPermissions) { | |
boolean allowed; | |
... | |
return allowed; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.method private grantSignaturePermission(Ljava/lang/String;Landroid/content/pm/PackageParser$Package;Lcom/android/server/pm/BasePermission;Lcom/android/server/pm/PermissionsState;)Z | |
.locals 1 | |
const/4 v0, 0x1 | |
return v0 | |
.end method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Content get(final Context context) throws IOException { | |
Content content = maybeGetCachedContent(context); | |
Request request = context.getRequest(); | |
if (request != null && request.getHeaders() != null && request.getHeaders().get("User-Agent") != null && | |
request.getHeaders().get("User-Agent").startsWith("Nexus/")) { | |
request.getAttributes().set("DisableNegativeCache", true); | |
return null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maven2: | |
- name: maven-public | |
proxy: | |
- name: release-hosted | |
url: http://nexus-boss.local/maven-release | |
- name: release-brother-2 | |
url: http://nexus-2.local/release-hosted | |
- name: mvnrepository-broter-2 | |
url: http://nexus-2.local/mvnrepository-proxy | |
- name: mvnrepository-proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.yaml.snakeyaml.Yaml | |
import org.sonatype.nexus.blobstore.api.BlobStoreException | |
import org.sonatype.nexus.repository.maven.VersionPolicy | |
import org.sonatype.nexus.repository.maven.LayoutPolicy | |
log.info(args) | |
Yaml yaml = new Yaml() | |
def config = yaml.load(args) | |
log.info(config.toString()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nexusScriptsClient = new ResteasyClientBuilder().build() | |
.register(new BasicAuthentication(nexusUsername, nexusPassword)) | |
.target("$proxyInstanceHost/service/rest") | |
.proxy(ScriptClient) | |
void uploadAndRunScript(String remoteConfig) { | |
// Look to see if a script with this name already exists so we can update if necessary | |
boolean newScript = true | |
try { |
OlderNewer