diff --git a/java/com/facebook/jni/HybridData.java b/java/com/facebook/jni/HybridData.java index 12fba77..e7fff38 100644 --- a/java/com/facebook/jni/HybridData.java +++ b/java/com/facebook/jni/HybridData.java @@ -16,7 +16,7 @@ package com.facebook.jni; -import com.facebook.jni.annotations.DoNotStripAny; +import com.facebook.jni.annotations.DoNotStrip; import com.facebook.soloader.nativeloader.NativeLoader; /** @@ -27,14 +27,14 @@ *
{@link #resetNative} deletes the corresponding native object synchronously on whatever thread * the method is called on. Otherwise, deletion will occur on the {@link DestructorThread} thread. */ -@DoNotStripAny +@DoNotStrip public class HybridData { static { NativeLoader.loadLibrary("fbjni"); } - private final Destructor mDestructor = new Destructor(this); + @DoNotStrip private Destructor mDestructor = new Destructor(this); /** * To explicitly delete the instance, call resetNative(). If the C++ instance is referenced after @@ -64,11 +64,11 @@ public boolean isValid() { return mDestructor.mNativePointer != 0; } - @DoNotStripAny + @DoNotStrip public static class Destructor extends DestructorThread.Destructor { // Private C++ instance - private volatile long mNativePointer; + @DoNotStrip private volatile long mNativePointer; Destructor(Object referent) { super(referent); diff --git a/java/com/facebook/jni/annotations/DoNotStripAny.java b/java/com/facebook/jni/annotations/DoNotStripAny.java deleted file mode 100644 index f3d5679..0000000 --- a/java/com/facebook/jni/annotations/DoNotStripAny.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.facebook.jni.annotations; - -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Add this annotation to a class to instruct Proguard to not strip it or any of its fields or - * methods out. - * - *
This is useful for methods called via reflection that could appear as unused to Proguard. - */ -@Target({ElementType.TYPE}) -@Retention(CLASS) -public @interface DoNotStripAny {}