我的库项目有一个位置服务,并且根据 Android Q 要求,它android:foregroundServiceType="location"在清单中设置属性。当应用模块使用我的库并针对 API 级别 28 进行编译时,它会失败并显示以下错误:
AndroidManifest.xml:57: AAPT: error: attribute android:foregroundServiceType not found.
Run Code Online (Sandbox Code Playgroud)
我的库如何保持与旧版本的兼容性,同时确保该功能适用于 Android Q?
我有以下问题.我使用此代码加密C#中的示例文本,并希望在java中解密它.我使用以下java代码.
byte[] IV = { 65, 1, 2, 23, 4, 5, 6, 7, 32, 21, 10, 11, 12, 13, 84, 45 };
byte[] KEY = { 0, 42, 2, 54, 4, 45, 6, 7, 65, 9, 54, 11, 12, 13, 60, 15 };
byte baData[] = new byte[1024];
int iRead = 0;
SecretKeySpec key = new SecretKeySpec(KEY, "AES/CBC/PKCS5Padding");
Cipher cipher = Cipher.getInstance ("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(IV));
File file = new File("/sdcard", "SAMPLE.txt");
FileInputStream in = new FileInputStream(file); …Run Code Online (Sandbox Code Playgroud)